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