texstudio: 4.8.4 -> 4.8.5 (#365076)
[NixPkgs.git] / pkgs / applications / radio / direwolf / default.nix
blobf35f66ecc2a4a95876ecf48f39574386762c6bec
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   alsa-lib,
7   gpsd,
8   gpsdSupport ? false,
9   hamlib,
10   hamlibSupport ? true,
11   perl,
12   portaudio,
13   python3,
14   espeak,
15   udev,
16   extraScripts ? false,
19 stdenv.mkDerivation rec {
20   pname = "direwolf";
21   version = "1.7";
23   src = fetchFromGitHub {
24     owner = "wb2osz";
25     repo = "direwolf";
26     rev = version;
27     hash = "sha256-Vbxc6a6CK+wrBfs15dtjfRa1LJDKKyHMrg8tqsF7EX4=";
28   };
30   nativeBuildInputs = [ cmake ];
32   strictDeps = true;
34   buildInputs =
35     lib.optionals stdenv.hostPlatform.isLinux [
36       alsa-lib
37       udev
38     ]
39     ++ lib.optionals stdenv.hostPlatform.isDarwin [ portaudio ]
40     ++ lib.optionals gpsdSupport [ gpsd ]
41     ++ lib.optionals hamlibSupport [ hamlib ]
42     ++ lib.optionals extraScripts [
43       python3
44       perl
45       espeak
46     ];
48   preConfigure = lib.optionals (!extraScripts) ''
49     echo "" > scripts/CMakeLists.txt
50   '';
52   postPatch =
53     ''
54       substituteInPlace conf/CMakeLists.txt \
55         --replace /etc/udev/rules.d/ $out/lib/udev/rules.d/
56       substituteInPlace src/symbols.c \
57         --replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \
58         --replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt
59       substituteInPlace src/decode_aprs.c \
60         --replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
61         --replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
62       substituteInPlace cmake/cpack/direwolf.desktop.in \
63         --replace 'Terminal=false' 'Terminal=true' \
64         --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf'
65       substituteInPlace src/dwgpsd.c \
66         --replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14'
67     ''
68     + lib.optionalString extraScripts ''
69       patchShebangs scripts/dwespeak.sh
70       substituteInPlace scripts/dwespeak.sh \
71         --replace espeak ${espeak}/bin/espeak
72     '';
74   meta = with lib; {
75     description = "Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway";
76     homepage = "https://github.com/wb2osz/direwolf/";
77     license = licenses.gpl2;
78     platforms = platforms.unix;
79     maintainers = with maintainers; [
80       lasandell
81       sarcasticadmin
82     ];
83   };