1{
2 lib,
3 stdenv,
4 fetchurl,
5 perl,
6 swig,
7 gd,
8 ncurses,
9 python311,
10 libxml2,
11 tcl,
12 libusb-compat-0_1,
13 pkg-config,
14 boost,
15 libtool,
16 pythonBindings ? true,
17 tclBindings ? true,
18 perlBindings ? stdenv.buildPlatform == stdenv.hostPlatform,
19 buildPackages,
20}:
21let
22 python3 = python311; # needs distutils and imp
23in
24stdenv.mkDerivation rec {
25 pname = "hamlib";
26 version = "3.3";
27
28 src = fetchurl {
29 url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
30 sha256 = "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9";
31 };
32
33 strictDeps = true;
34 depsBuildBuild = [ buildPackages.stdenv.cc ];
35 nativeBuildInputs = [
36 swig
37 pkg-config
38 libtool
39 ]
40 ++ lib.optionals pythonBindings [ python3 ]
41 ++ lib.optionals tclBindings [ tcl ]
42 ++ lib.optionals perlBindings [ perl ];
43
44 buildInputs = [
45 gd
46 libxml2
47 libusb-compat-0_1
48 boost
49 ]
50 ++ lib.optionals pythonBindings [
51 python3
52 ncurses
53 ]
54 ++ lib.optionals tclBindings [ tcl ];
55
56 configureFlags = [
57 "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc"
58 ]
59 ++ lib.optionals perlBindings [ "--with-perl-binding" ]
60 ++ lib.optionals tclBindings [
61 "--with-tcl-binding"
62 "--with-tcl=${tcl}/lib/"
63 ]
64 ++ lib.optionals pythonBindings [ "--with-python-binding" ];
65
66 meta = with lib; {
67 description = "Runtime library to control radio transceivers and receivers";
68 longDescription = ''
69 Hamlib provides a standardized programming interface that applications
70 can use to send the appropriate commands to a radio.
71
72 Also included in the package is a simple radio control program 'rigctl',
73 which lets one control a radio transceiver or receiver, either from
74 command line interface or in a text-oriented interactive interface.
75 '';
76 license = with licenses; [
77 gpl2Plus
78 lgpl2Plus
79 ];
80 homepage = "https://hamlib.sourceforge.net";
81 maintainers = with maintainers; [ relrod ];
82 platforms = with platforms; unix;
83 };
84}