about summary refs log tree commit diff
path: root/pkgs/applications/radio
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-09-30 00:01:53 +0000
committerGitHub <noreply@github.com>2023-09-30 00:01:53 +0000
commit6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f (patch)
treee4fdca32d3125aaf7f2ba8b8cdaa813b89c528cf /pkgs/applications/radio
parent14d44173e4081f0617e9f3e1786a829ca2c592b5 (diff)
parented66c817ab4ec6f086d2ea7cb5770f380a84a5a3 (diff)
downloadnixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar.gz
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar.bz2
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar.lz
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar.xz
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.tar.zst
nixlib-6b41a98c6c0f4fec2bd9a533aae34b53a8eddd3f.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/radio')
-rw-r--r--pkgs/applications/radio/direwolf/default.nix42
1 files changed, 30 insertions, 12 deletions
diff --git a/pkgs/applications/radio/direwolf/default.nix b/pkgs/applications/radio/direwolf/default.nix
index 463ac0b50af9..c93f336b6059 100644
--- a/pkgs/applications/radio/direwolf/default.nix
+++ b/pkgs/applications/radio/direwolf/default.nix
@@ -1,7 +1,18 @@
-{ lib, stdenv, fetchFromGitHub, cmake, alsa-lib, espeak, gpsd
-, hamlib, perl, python3, udev }:
-
-with lib;
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, alsa-lib
+, gpsd
+, gpsdSupport ? false
+, hamlib
+, hamlibSupport ? true
+, perl
+, python3
+, espeak
+, udev
+, extraScripts ? false
+}:
 
 stdenv.mkDerivation rec {
   pname = "direwolf";
@@ -20,9 +31,14 @@ stdenv.mkDerivation rec {
 
   strictDeps = true;
 
-  buildInputs = [
-    espeak gpsd hamlib perl python3
-  ] ++ (optionals stdenv.isLinux [alsa-lib udev]);
+  buildInputs = lib.optionals stdenv.isLinux [ alsa-lib udev ]
+    ++ lib.optionals gpsdSupport [ gpsd ]
+    ++ lib.optionals hamlibSupport [ hamlib ]
+    ++ lib.optionals extraScripts [ python3 perl espeak ];
+
+  preConfigure = lib.optionals (!extraScripts) ''
+    echo "" > scripts/CMakeLists.txt
+  '';
 
   postPatch = ''
     substituteInPlace conf/CMakeLists.txt \
@@ -33,21 +49,23 @@ stdenv.mkDerivation rec {
     substituteInPlace src/decode_aprs.c \
       --replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
       --replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
-    patchShebangs scripts/dwespeak.sh
-    substituteInPlace scripts/dwespeak.sh \
-      --replace espeak ${espeak}/bin/espeak
     substituteInPlace cmake/cpack/direwolf.desktop.in \
       --replace 'Terminal=false' 'Terminal=true' \
       --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf'
     substituteInPlace src/dwgpsd.c \
       --replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14'
+  ''
+  + lib.optionalString extraScripts ''
+    patchShebangs scripts/dwespeak.sh
+    substituteInPlace scripts/dwespeak.sh \
+      --replace espeak ${espeak}/bin/espeak
   '';
 
-  meta = {
+  meta = with lib; {
     description = "A Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway";
     homepage = "https://github.com/wb2osz/direwolf/";
     license = licenses.gpl2;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ lasandell ];
+    maintainers = with maintainers; [ lasandell sarcasticadmin ];
   };
 }