wfview: init at 2.10

+245
+74
pkgs/by-name/wf/wfview/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitLab, 5 + eigen, 6 + hidapi, 7 + libopus, 8 + libpulseaudio, 9 + portaudio, 10 + qt6, 11 + qt6Packages, 12 + rtaudio, 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "wfview"; 17 + version = "2.10"; 18 + 19 + src = fetchFromGitLab { 20 + owner = "eliggett"; 21 + repo = "wfview"; 22 + rev = "v${finalAttrs.version}"; 23 + hash = "sha256-bFTblsDtFAakbSJfSfKgvoxd1DTSv++rxU6R3/uWo+4="; 24 + }; 25 + 26 + patches = [ 27 + # Remove syscalls during build to make it reproducible 28 + # We also need to adjust some header paths for darwin 29 + ./remove-hard-encodings.patch 30 + ]; 31 + 32 + buildInputs = 33 + [ 34 + eigen 35 + hidapi 36 + libopus 37 + portaudio 38 + rtaudio 39 + qt6.qtbase 40 + qt6.qtserialport 41 + qt6.qtmultimedia 42 + qt6.qtwebsockets 43 + qt6Packages.qcustomplot 44 + ] 45 + ++ lib.optionals stdenv.hostPlatform.isLinux [ 46 + libpulseaudio 47 + ]; 48 + 49 + nativeBuildInputs = with qt6; [ 50 + wrapQtAppsHook 51 + qmake 52 + ]; 53 + 54 + env.LANG = "C.UTF-8"; 55 + 56 + qmakeFlags = [ "wfview.pro" ]; 57 + 58 + postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' 59 + mkdir -pv $out/Applications 60 + mv -v "$out/bin/wfview.app" $out/Applications 61 + 62 + # wrap executable to $out/bin 63 + makeWrapper "$out/Applications/wfview.app/Contents/MacOS/wfview" "$out/bin/wfview" 64 + ''; 65 + 66 + meta = { 67 + description = "Open-source software for the control of modern Icom radios"; 68 + homepage = "https://wfview.org/"; 69 + license = lib.licenses.gpl3Only; 70 + platforms = lib.platforms.unix; 71 + mainProgram = "wfview"; 72 + maintainers = with lib.maintainers; [ Cryolitia ]; 73 + }; 74 + })
+171
pkgs/by-name/wf/wfview/remove-hard-encodings.patch
··· 1 + diff --git a/audioconverter.h b/audioconverter.h 2 + index d3cf510..308725d 100644 3 + --- a/audioconverter.h 4 + +++ b/audioconverter.h 5 + @@ -20,13 +20,8 @@ 6 + #endif 7 + 8 + /* Opus and Eigen */ 9 + -#ifndef Q_OS_LINUX 10 + -#include "opus.h" 11 + -#include <Eigen/Eigen> 12 + -#else 13 + #include "opus/opus.h" 14 + #include <eigen3/Eigen/Eigen> 15 + -#endif 16 + 17 + #include "wfviewtypes.h" 18 + 19 + diff --git a/audiodevices.h b/audiodevices.h 20 + index 3521eb5..0569e49 100644 21 + --- a/audiodevices.h 22 + +++ b/audiodevices.h 23 + @@ -13,11 +13,7 @@ 24 + #include <QFontMetrics> 25 + 26 + #include <portaudio.h> 27 + -#ifndef Q_OS_LINUX 28 + -#include "RtAudio.h" 29 + -#else 30 + #include "rtaudio/RtAudio.h" 31 + -#endif 32 + 33 + #include "wfviewtypes.h" 34 + 35 + diff --git a/rthandler.h b/rthandler.h 36 + index b422cc2..02b1117 100644 37 + --- a/rthandler.h 38 + +++ b/rthandler.h 39 + @@ -6,11 +6,7 @@ 40 + #include <QThread> 41 + #include <QMutex> 42 + 43 + -#ifndef Q_OS_LINUX 44 + -#include "RtAudio.h" 45 + -#else 46 + #include "rtaudio/RtAudio.h" 47 + -#endif 48 + 49 + 50 + #include <QAudioFormat> 51 + diff --git a/tciserver.h b/tciserver.h 52 + index 9b38886..af56763 100644 53 + --- a/tciserver.h 54 + +++ b/tciserver.h 55 + @@ -9,13 +9,8 @@ 56 + #include "cachingqueue.h" 57 + 58 + /* Opus and Eigen */ 59 + -#ifndef Q_OS_LINUX 60 + -#include "opus.h" 61 + -#include <Eigen/Eigen> 62 + -#else 63 + #include "opus/opus.h" 64 + #include <eigen3/Eigen/Eigen> 65 + -#endif 66 + 67 + #define TCI_AUDIO_LENGTH 4096 68 + struct tciCommandStruct 69 + diff --git a/wfmain.h b/wfmain.h 70 + index 0404fda..e400a74 100644 71 + --- a/wfmain.h 72 + +++ b/wfmain.h 73 + @@ -68,11 +68,7 @@ 74 + #include <memory> 75 + 76 + #include <portaudio.h> 77 + -#ifndef Q_OS_LINUX 78 + -#include "RtAudio.h" 79 + -#else 80 + #include "rtaudio/RtAudio.h" 81 + -#endif 82 + 83 + #ifdef USB_CONTROLLER 84 + #ifdef Q_OS_WIN 85 + diff --git a/wfview.pro b/wfview.pro 86 + index a0943bd..e8f97e1 100644 87 + --- a/wfview.pro 88 + +++ b/wfview.pro 89 + @@ -62,10 +62,8 @@ win32:DEFINES += __WINDOWS_WASAPI__ 90 + #linux:DEFINES += __LINUX_OSS__ 91 + linux:DEFINES += __LINUX_PULSE__ 92 + macx:DEFINES += __MACOSX_CORE__ 93 + -!linux:SOURCES += ../rtaudio/RTAudio.cpp 94 + -!linux:HEADERS += ../rtaudio/RTAUdio.h 95 + -!linux:INCLUDEPATH += ../rtaudio 96 + 97 + +macx:LIBS += -lrtaudio 98 + linux:LIBS += -lpulse -lpulse-simple -lrtaudio -lpthread -ludev 99 + 100 + win32:INCLUDEPATH += ../portaudio/include 101 + @@ -107,8 +105,6 @@ win32:RC_ICONS = "resources/icons/Windows/wfview 512x512.ico" 102 + 103 + macx{ 104 + ICON = resources/wfview.icns 105 + - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15 106 + - QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 107 + MY_ENTITLEMENTS.name = CODE_SIGN_ENTITLEMENTS 108 + MY_ENTITLEMENTS.value = resources/wfview.entitlements 109 + QMAKE_MAC_XCODE_SETTINGS += MY_ENTITLEMENTS 110 + @@ -120,8 +116,7 @@ macx{ 111 + 112 + QMAKE_TARGET_BUNDLE_PREFIX = org.wfview 113 + 114 + -!win32:DEFINES += HOST=\\\"`hostname`\\\" UNAME=\\\"`whoami`\\\" 115 + -!win32:DEFINES += GITSHORT="\\\"$(shell git -C \"$$PWD\" rev-parse --short HEAD)\\\"" 116 + +!win32:DEFINES += HOST=\\\"nixos\\\" UNAME=\\\"nix\\\" GITSHORT=\\\"0.0\\\" 117 + 118 + win32:DEFINES += GITSHORT=\\\"$$system(git -C $$PWD rev-parse --short HEAD)\\\" 119 + win32:DEFINES += HOST=\\\"$$system(hostname)\\\" 120 + @@ -169,19 +164,8 @@ macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread -lopus 121 + 122 + CONFIG(debug, release|debug) { 123 + 124 + - macos:LIBS += -L ../qcustomplot/qcustomplot-sharedlib/build -lqcustomplotd 125 + - 126 + - lessThan(QT_MAJOR_VERSION, 6) { 127 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libQCustomPlotd.so/ {print \"-lQCustomPlotd\"}'") 128 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplotd2.so/ {print \"-lqcustomplotd2\"}'") 129 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplotd.so/ {print \"-lqcustomplotd\"}'") 130 + - 131 + - } else { 132 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libQCustomPlotdQt6.so/ {print \"-lQCustomPlotdQt6\"}'") 133 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplotd2qt6.so/ {print \"-lqcustomplotd2qt6\"}'") 134 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplotdqt6.so/ {print \"-lqcustomplotdqt6\"}'") 135 + - } 136 + - 137 + + macos:LIBS += -lqcustomplotd 138 + + linux:LIBS += -lqcustomplotd 139 + win32 { 140 + contains(QMAKE_TARGET.arch, x86_64) { 141 + LIBS += -L../opus/win32/VS2015/x64/DebugDLL/ 142 + @@ -211,17 +195,8 @@ CONFIG(debug, release|debug) { 143 + } 144 + } else { 145 + 146 + - macos:LIBS += -L ../qcustomplot/qcustomplot-sharedlib/build -lqcustomplot 147 + - 148 + - lessThan(QT_MAJOR_VERSION, 6) { 149 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libQCustomPlot.so/ {print \"-lQCustomPlot\"}'") 150 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplot2.so/ {print \"-lqcustomplot2\"}'") 151 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplot.so/ {print \"-lqcustomplot\"}'") 152 + - } else { 153 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libQCustomPlotQt6.so/ {print \"-lQCustomPlotQt6\"}'") 154 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplot2qt6.so/ {print \"-lqcustomplot2qt6\"}'") 155 + - linux:LIBS += $$system("/sbin/ldconfig -p | awk '/libqcustomplotqt6.so/ {print \"-lqcustomplotqt6\"}'") 156 + - } 157 + + macos:LIBS += -lqcustomplot 158 + + linux:LIBS += -lqcustomplot 159 + win32 { 160 + contains(QMAKE_TARGET.arch, x86_64) { 161 + LIBS += -L../opus/win32/VS2015/x64/ReleaseDLL/ 162 + @@ -264,9 +239,6 @@ win32:LIBS += -lopus -lole32 -luser32 163 + #macx:HEADERS += ../qcustomplot/qcustomplot.h 164 + 165 + win32:INCLUDEPATH += ../qcustomplot 166 + -!linux:INCLUDEPATH += ../opus/include 167 + -!linux:INCLUDEPATH += ../eigen 168 + -!linux:INCLUDEPATH += ../r8brain-free-src 169 + 170 + INCLUDEPATH += resampler 171 +