2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, alsa-lib
|
|
|
|
, gpsd
|
|
|
|
, gpsdSupport ? false
|
|
|
|
, hamlib
|
|
|
|
, hamlibSupport ? true
|
|
|
|
, perl
|
2023-11-16 04:20:00 +00:00
|
|
|
, portaudio
|
2023-10-09 19:29:22 +00:00
|
|
|
, python3
|
|
|
|
, espeak
|
|
|
|
, udev
|
|
|
|
, extraScripts ? false
|
|
|
|
}:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "direwolf";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.7";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wb2osz";
|
|
|
|
repo = "direwolf";
|
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Vbxc6a6CK+wrBfs15dtjfRa1LJDKKyHMrg8tqsF7EX4=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ alsa-lib udev ]
|
2023-11-16 04:20:00 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ portaudio ]
|
2023-10-09 19:29:22 +00:00
|
|
|
++ lib.optionals gpsdSupport [ gpsd ]
|
|
|
|
++ lib.optionals hamlibSupport [ hamlib ]
|
|
|
|
++ lib.optionals extraScripts [ python3 perl espeak ];
|
|
|
|
|
|
|
|
preConfigure = lib.optionals (!extraScripts) ''
|
|
|
|
echo "" > scripts/CMakeLists.txt
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-04 12:37:57 +00:00
|
|
|
substituteInPlace conf/CMakeLists.txt \
|
|
|
|
--replace /etc/udev/rules.d/ $out/lib/udev/rules.d/
|
2020-12-07 07:45:13 +00:00
|
|
|
substituteInPlace src/symbols.c \
|
2020-08-20 17:08:02 +00:00
|
|
|
--replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \
|
|
|
|
--replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt
|
2020-12-07 07:45:13 +00:00
|
|
|
substituteInPlace src/decode_aprs.c \
|
2020-08-20 17:08:02 +00:00
|
|
|
--replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
|
|
|
|
--replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt
|
2020-12-07 07:45:13 +00:00
|
|
|
substituteInPlace cmake/cpack/direwolf.desktop.in \
|
|
|
|
--replace 'Terminal=false' 'Terminal=true' \
|
2021-10-04 12:37:57 +00:00
|
|
|
--replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf'
|
|
|
|
substituteInPlace src/dwgpsd.c \
|
2022-10-30 15:09:59 +00:00
|
|
|
--replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14'
|
2023-10-09 19:29:22 +00:00
|
|
|
''
|
|
|
|
+ lib.optionalString extraScripts ''
|
|
|
|
patchShebangs scripts/dwespeak.sh
|
|
|
|
substituteInPlace scripts/dwespeak.sh \
|
|
|
|
--replace espeak ${espeak}/bin/espeak
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway";
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://github.com/wb2osz/direwolf/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.unix;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ lasandell sarcasticadmin ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|