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