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
, 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 = {

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