From 0d431518893b1461cff9c777561fc53d94061a0a Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Fri, 4 Dec 2020 11:52:02 -0600 Subject: [PATCH] direwolf: 1.5 -> 1.6 --- pkgs/applications/radio/direwolf/default.nix | 37 +++++++------------ .../radio/direwolf/udev-fix.patch | 11 ++++++ 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 pkgs/applications/radio/direwolf/udev-fix.patch diff --git a/pkgs/applications/radio/direwolf/default.nix b/pkgs/applications/radio/direwolf/default.nix index aab76574968b..321b103c7f7a 100644 --- a/pkgs/applications/radio/direwolf/default.nix +++ b/pkgs/applications/radio/direwolf/default.nix @@ -1,50 +1,41 @@ -{ stdenv, fetchFromGitHub -, alsaLib, espeak, glibc, gpsd +{ stdenv, fetchFromGitHub, cmake, alsaLib, espeak, glibc, gpsd , hamlib, perl, python, udev }: with stdenv.lib; stdenv.mkDerivation rec { pname = "direwolf"; - version = "1.5"; + version = "1.6"; src = fetchFromGitHub { owner = "wb2osz"; repo = "direwolf"; rev = version; - sha256 = "1w55dv9xqgc9mpincsj017838vmvdy972fhis3ddskyfvhhzgcsk"; + sha256 = "0xmz64m02knbrpasfij4rrq53ksxna5idxwgabcw4n2b1ig7pyx5"; }; + nativeBuildInputs = [ cmake ]; + buildInputs = [ espeak gpsd hamlib perl python ] ++ (optionals stdenv.isLinux [alsaLib udev]); - makeFlags = [ "DESTDIR=$(out)" ]; + patches = [ + ./udev-fix.patch + ]; postPatch = '' - substituteInPlace symbols.c \ + 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 decode_aprs.c \ + 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 dwespeak.sh \ + substituteInPlace scripts/dwespeak.sh \ --replace espeak ${espeak}/bin/espeak - '' + (optionalString stdenv.isLinux '' - substituteInPlace Makefile.linux \ - --replace /usr/include/pthread.h ${stdenv.glibc.dev}/include/pthread.h \ - --replace /usr/include/alsa ${alsaLib.dev}/include/alsa \ - --replace /usr/include/gps.h ${gpsd}/include/gps.h \ - --replace /usr/include/hamlib ${hamlib}/include/hamlib \ - --replace /usr/include/libudev.h ${udev.dev}/include/libudev.h \ - --replace /etc/udev $out/etc/udev \ - --replace 'Exec=xterm -hold -title \"Dire Wolf\" -bg white -e \"$(DESTDIR)/bin/direwolf\"' "Exec=$out/bin/direwolf" \ - --replace '#Terminal=true' 'Terminal=true' \ - --replace 'Path=$(HOME)' '#Path=' - ''); - - preInstall = '' - mkdir -p $out/bin + substituteInPlace cmake/cpack/direwolf.desktop.in \ + --replace 'Terminal=false' 'Terminal=true' \ + --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf' \ ''; meta = { diff --git a/pkgs/applications/radio/direwolf/udev-fix.patch b/pkgs/applications/radio/direwolf/udev-fix.patch new file mode 100644 index 000000000000..cff17fb88621 --- /dev/null +++ b/pkgs/applications/radio/direwolf/udev-fix.patch @@ -0,0 +1,11 @@ +--- direwolf/conf/CMakeLists.txt.orig 2020-12-04 11:12:59.739390894 -0600 ++++ direwolf/conf/CMakeLists.txt 2020-12-04 11:23:09.146594795 -0600 +@@ -26,7 +26,7 @@ + + # install udev rules for CM108 + if(LINUX) +- install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/) ++ install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d/") + endif() + + install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR})