direwolf: 1.5 -> 1.6

This commit is contained in:
Hunter Jones 2020-12-04 11:52:02 -06:00
parent 657fef798b
commit 0d43151889
2 changed files with 25 additions and 23 deletions

View file

@ -1,50 +1,41 @@
{ stdenv, fetchFromGitHub { stdenv, fetchFromGitHub, cmake, alsaLib, espeak, glibc, gpsd
, alsaLib, espeak, glibc, gpsd
, hamlib, perl, python, udev }: , hamlib, perl, python, udev }:
with stdenv.lib; with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "direwolf"; pname = "direwolf";
version = "1.5"; version = "1.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "wb2osz"; owner = "wb2osz";
repo = "direwolf"; repo = "direwolf";
rev = version; rev = version;
sha256 = "1w55dv9xqgc9mpincsj017838vmvdy972fhis3ddskyfvhhzgcsk"; sha256 = "0xmz64m02knbrpasfij4rrq53ksxna5idxwgabcw4n2b1ig7pyx5";
}; };
nativeBuildInputs = [ cmake ];
buildInputs = [ buildInputs = [
espeak gpsd hamlib perl python espeak gpsd hamlib perl python
] ++ (optionals stdenv.isLinux [alsaLib udev]); ] ++ (optionals stdenv.isLinux [alsaLib udev]);
makeFlags = [ "DESTDIR=$(out)" ]; patches = [
./udev-fix.patch
];
postPatch = '' postPatch = ''
substituteInPlace symbols.c \ substituteInPlace src/symbols.c \
--replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \ --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 --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 /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \
--replace /opt/local/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 --replace espeak ${espeak}/bin/espeak
'' + (optionalString stdenv.isLinux '' substituteInPlace cmake/cpack/direwolf.desktop.in \
substituteInPlace Makefile.linux \ --replace 'Terminal=false' 'Terminal=true' \
--replace /usr/include/pthread.h ${stdenv.glibc.dev}/include/pthread.h \ --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf' \
--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
''; '';
meta = { meta = {

View file

@ -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})