depot/third_party/nixpkgs/pkgs/applications/radio/direwolf/default.nix
Default email 48af15f7a5 Project import generated by Copybara.
GitOrigin-RevId: 04a2b269d8921505a2969fc9ec25c1f517f2b307
2021-03-20 04:20:00 +00:00

50 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, cmake, alsaLib, espeak, glibc, gpsd
, hamlib, perl, python3, udev }:
with lib;
stdenv.mkDerivation rec {
pname = "direwolf";
version = "1.6";
src = fetchFromGitHub {
owner = "wb2osz";
repo = "direwolf";
rev = version;
sha256 = "0xmz64m02knbrpasfij4rrq53ksxna5idxwgabcw4n2b1ig7pyx5";
};
nativeBuildInputs = [ cmake ];
strictDeps = true;
buildInputs = [
espeak gpsd hamlib perl python3
] ++ (optionals stdenv.isLinux [alsaLib udev]);
patches = [
./udev-fix.patch
];
postPatch = ''
substituteInPlace src/symbols.c \
--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
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
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' \
'';
meta = {
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 ];
};
}