diff options
Diffstat (limited to 'pkgs/applications/radio')
18 files changed, 251 insertions, 77 deletions
diff --git a/pkgs/applications/radio/dump1090/default.nix b/pkgs/applications/radio/dump1090/default.nix index 927fa32bd55..00e5e0089cf 100644 --- a/pkgs/applications/radio/dump1090/default.nix +++ b/pkgs/applications/radio/dump1090/default.nix @@ -5,17 +5,19 @@ , libusb1 , ncurses , rtl-sdr +, hackrf +, limesuite }: stdenv.mkDerivation rec { pname = "dump1090"; - version = "5.0"; + version = "6.1"; src = fetchFromGitHub { owner = "flightaware"; repo = pname; rev = "v${version}"; - sha256 = "1fckfcgypmplzl1lidd04jxiabczlfx9mv21d6rbsfknghsjpn03"; + sha256 = "sha256-OLXnT5TD6ZBNJUk4qXOMbr+NWdw3j1rv1xkFPZi4Wo8="; }; nativeBuildInputs = [ pkg-config ]; @@ -25,7 +27,15 @@ stdenv.mkDerivation rec { libusb1 ncurses rtl-sdr - ]; + hackrf + ] ++ lib.optional stdenv.isLinux limesuite; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang + "-Wno-implicit-function-declaration -Wno-int-conversion"; + + buildFlags = [ "dump1090" "view1090" ]; + + doCheck = true; installPhase = '' runHook preInstall @@ -41,7 +51,7 @@ stdenv.mkDerivation rec { description = "A simple Mode S decoder for RTLSDR devices"; homepage = "https://github.com/flightaware/dump1090"; license = licenses.gpl2Plus; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ earldouglas ]; }; } diff --git a/pkgs/applications/radio/gnss-sdr/default.nix b/pkgs/applications/radio/gnss-sdr/default.nix index 44a8ed14c2e..479b3b641cd 100644 --- a/pkgs/applications/radio/gnss-sdr/default.nix +++ b/pkgs/applications/radio/gnss-sdr/default.nix @@ -8,6 +8,7 @@ , openssl , gflags , gnuradio3_8 +, thrift , libpcap , orc , pkg-config @@ -21,6 +22,8 @@ gnuradio3_8.pkgs.mkDerivation rec { pname = "gnss-sdr"; + # There's an issue with cpufeatures on 0.0.15, see: + # https://github.com/NixOS/nixpkgs/pull/142557#issuecomment-950217925 version = "0.0.13"; src = fetchFromGitHub { @@ -56,6 +59,9 @@ gnuradio3_8.pkgs.mkDerivation rec { protobuf gnuradio3_8.pkgs.osmosdr libpcap + ] ++ lib.optionals (gnuradio3_8.hasFeature "gr-ctrlport") [ + thrift + gnuradio3_8.unwrapped.python.pkgs.thrift ]; cmakeFlags = [ diff --git a/pkgs/applications/radio/gnuradio/3.7.nix b/pkgs/applications/radio/gnuradio/3.7.nix index 3e423e025b7..372300895ca 100644 --- a/pkgs/applications/radio/gnuradio/3.7.nix +++ b/pkgs/applications/radio/gnuradio/3.7.nix @@ -44,8 +44,6 @@ minor = "14"; patch = "0"; } -# We use our build of volk and not the one bundled with the release -, fetchSubmodules ? false }: let @@ -213,7 +211,6 @@ let sourceSha256 overrideSrc fetchFromGitHub - fetchSubmodules ; qt = qt4; gtk = gtk2; @@ -238,34 +235,34 @@ stdenv.mkDerivation rec { passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must inherit boost volk; - } // lib.optionalAttrs (hasFeature "gr-uhd" features) { + } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; }; cmakeFlags = shared.cmakeFlags # From some reason, if these are not set, libcodec2 and gsm are # not detected properly (slightly different then what's in # ./default.nix). - ++ lib.optionals (hasFeature "gr-vocoder" features) [ + ++ lib.optionals (hasFeature "gr-vocoder") [ "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so" "-DLIBCODEC2_INCLUDE_DIR=${codec2}/include" "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" "-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm" ] - ++ lib.optionals (hasFeature "volk" features && volk != null) [ + ++ lib.optionals (hasFeature "volk" && volk != null) [ "-DENABLE_INTERNAL_VOLK=OFF" ] ; stripDebugList = shared.stripDebugList # gr-fcd feature was dropped in 3.8 - ++ lib.optionals (hasFeature "gr-fcd" features) [ "share/gnuradio/examples/fcd" ] + ++ lib.optionals (hasFeature "gr-fcd") [ "share/gnuradio/examples/fcd" ] ; preConfigure = "" # wxgui and pygtk are not looked up properly, so we force them to be # detected as found, if they are requested by the `features` attrset. - + lib.optionalString (hasFeature "gr-wxgui" features) '' + + lib.optionalString (hasFeature "gr-wxgui") '' sed -i 's/.*wx\.version.*/set(WX_FOUND TRUE)/g' gr-wxgui/CMakeLists.txt '' - + lib.optionalString (hasFeature "gnuradio-companion" features) '' + + lib.optionalString (hasFeature "gnuradio-companion") '' sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt '' ; diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index 05a87a480f3..0e5b7701e98 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchFromGitHub +, fetchpatch , cmake # Remove gcc and python references , removeReferencesTo @@ -15,6 +16,7 @@ , python , codec2 , gsm +, thrift , fftwFloat , alsa-lib , libjack2 @@ -41,15 +43,13 @@ , pname ? "gnuradio" , versionAttr ? { major = "3.8"; - minor = "3"; - patch = "1"; + minor = "4"; + patch = "0"; } -# We use our build of volk and not the one bundled with the release -, fetchSubmodules ? false }: let - sourceSha256 = "0vd39azp8n576dbqsanax7bgsnxwc80riaxid2ihxs4xzyjmbw9r"; + sourceSha256 = "sha256-C8S3iF7vj9A8SpxriW9y7idrhXzonvenoQtVAMex+Iw="; featuresInfo = { # Needed always basic = { @@ -65,7 +65,7 @@ let ] # when gr-qtgui is disabled, icu needs to be included, otherwise # building with boost 1.7x fails - ++ lib.optionals (!(hasFeature "gr-qtgui" features)) [ icu ]; + ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ]; pythonNative = with python.pkgs; [ Mako six @@ -101,13 +101,19 @@ let cmakeEnableFlag = "GNURADIO_RUNTIME"; }; gr-ctrlport = { - # Thrift support is not really working well, and even the patch they - # recommend applying on 0.9.2 won't apply. See: - # https://github.com/gnuradio/gnuradio/blob/v3.8.2.0/gnuradio-runtime/lib/controlport/thrift/README cmakeEnableFlag = "GR_CTRLPORT"; native = [ swig ]; + runtime = [ + thrift + ]; + pythonRuntime = with python.pkgs; [ + python.pkgs.thrift + # For gr-perf-monitorx + matplotlib + networkx + ]; }; gnuradio-companion = { pythonRuntime = with python.pkgs; [ @@ -171,9 +177,14 @@ let }; gr-utils = { cmakeEnableFlag = "GR_UTILS"; + pythonRuntime = with python.pkgs; [ + # For gr_plot + matplotlib + ]; }; gr-modtool = { pythonRuntime = with python.pkgs; [ + setuptools click click-plugins ]; @@ -208,7 +219,6 @@ let sourceSha256 overrideSrc fetchFromGitHub - fetchSubmodules ; qt = qt5; gtk = gtk3; @@ -230,12 +240,21 @@ stdenv.mkDerivation rec { dontWrapQtApps meta ; + patches = [ + # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227 + ./modtool-newmod-permissions.3_8.patch + (fetchpatch { + # https://github.com/gnuradio/gnuradio/pull/5226 + url = "https://github.com/gnuradio/gnuradio/commit/9d7343526dd793120b6425cd9a6969416ed32503.patch"; + sha256 = "sha256-usSoRDDuClUfdX4yFbQNu8wDzve6UEhZYTFj1oZbFic="; + }) + ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must inherit boost volk; - } // lib.optionalAttrs (hasFeature "gr-uhd" features) { + } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; - } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + } // lib.optionalAttrs (hasFeature "gr-qtgui") { inherit (libsForQt5) qwt; }; cmakeFlags = shared.cmakeFlags @@ -246,7 +265,7 @@ stdenv.mkDerivation rec { # # NOTE: qradiolink needs libcodec2 to be detected in # order to build, see https://github.com/qradiolink/qradiolink/issues/67 - ++ lib.optionals (hasFeature "gr-vocoder" features) [ + ++ lib.optionals (hasFeature "gr-vocoder") [ "-DLIBCODEC2_FOUND=TRUE" "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so" "-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include" @@ -255,7 +274,7 @@ stdenv.mkDerivation rec { "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" ] - ++ lib.optionals (hasFeature "volk" features && volk != null) [ + ++ lib.optionals (hasFeature "volk" && volk != null) [ "-DENABLE_INTERNAL_VOLK=OFF" ] ; @@ -263,7 +282,7 @@ stdenv.mkDerivation rec { postInstall = shared.postInstall # This is the only python reference worth removing, if needed (3.7 doesn't # set that reference). - + lib.optionalString (!hasFeature "python-support" features) '' + + lib.optionalString (!hasFeature "python-support") '' ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake '' ; diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index c62b031d813..d92af80701b 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -26,6 +26,7 @@ , libsodium , libsndfile , libunwind +, thrift , cppzmq , zeromq # Needed only if qt-gui is disabled, from some reason @@ -45,14 +46,13 @@ , pname ? "gnuradio" , versionAttr ? { major = "3.9"; - minor = "2"; + minor = "3"; patch = "0"; } -, fetchSubmodules ? false }: let - sourceSha256 = "01wyqazrpphmb0fl69j93k0w4vm4d1l4177m1fyg7qx8hzia0aaq"; + sourceSha256 = "sha256-jVfExv1CcnlOaaj/XtnfhWAHnQsshZJ1l/zXo0uovdo="; featuresInfo = { # Needed always basic = { @@ -69,7 +69,7 @@ let ] # when gr-qtgui is disabled, icu needs to be included, otherwise # building with boost 1.7x fails - ++ lib.optionals (!(hasFeature "gr-qtgui" features)) [ icu ]; + ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ]; pythonNative = with python.pkgs; [ Mako six @@ -100,11 +100,15 @@ let ]; }; gr-ctrlport = { - # Thrift support is not really working well, and even the patch they - # recommend applying on 0.9.2 won't apply. See: - # https://github.com/gnuradio/gnuradio/blob/v3.9.0.0/gnuradio-runtime/lib/controlport/thrift/README runtime = [ libunwind + thrift + ]; + pythonRuntime = with python.pkgs; [ + python.pkgs.thrift + # For gr-perf-monitorx + matplotlib + networkx ]; cmakeEnableFlag = "GR_CTRLPORT"; }; @@ -140,6 +144,10 @@ let gr-filter = { runtime = [ fftwFloat ]; cmakeEnableFlag = "GR_FILTER"; + pythonRuntime = with python.pkgs; [ + scipy + pyqtgraph + ]; }; gr-analog = { cmakeEnableFlag = "GR_ANALOG"; @@ -174,11 +182,22 @@ let ]; cmakeEnableFlag = "GR_UHD"; }; + gr-uhd-rfnoc = { + runtime = [ + uhd + ]; + cmakeEnableFlag = "UHD_RFNOC"; + }; gr-utils = { cmakeEnableFlag = "GR_UTILS"; + pythonRuntime = with python.pkgs; [ + # For gr_plot + matplotlib + ]; }; gr-modtool = { pythonRuntime = with python.pkgs; [ + setuptools click click-plugins ]; @@ -225,7 +244,6 @@ let sourceSha256 overrideSrc fetchFromGitHub - fetchSubmodules ; qt = qt5; gtk = gtk3; @@ -248,18 +266,27 @@ stdenv.mkDerivation rec { dontWrapQtApps meta ; + patches = [ + # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227 + ./modtool-newmod-permissions.patch + (fetchpatch { + # https://github.com/gnuradio/gnuradio/pull/5225 + url = "https://github.com/gnuradio/gnuradio/commit/4cef46e3ea0faf04e05ca1a5846cd1568fa51bb2.patch"; + sha256 = "sha256-6AlGbtD1S0c3I9JSoLTMP4YqwDU17i2j+XRkuR+QTuc="; + }) + ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must inherit boost volk; - } // lib.optionalAttrs (hasFeature "gr-uhd" features) { + } // lib.optionalAttrs (hasFeature "gr-uhd") { inherit uhd; - } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + } // lib.optionalAttrs (hasFeature "gr-qtgui") { inherit (libsForQt5) qwt; }; postInstall = shared.postInstall # This is the only python reference worth removing, if needed. - + lib.optionalString (!hasFeature "python-support" features) '' + + lib.optionalString (!hasFeature "python-support") '' ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake ${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so) ${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake diff --git a/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch new file mode 100644 index 00000000000..f6a6a06e89c --- /dev/null +++ b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch @@ -0,0 +1,26 @@ +commit bf870157e0a9c3d19e968afb276b4e7d96b4df30 +Author: Doron Behar <doron.behar@gmail.com> +Date: Thu Oct 21 13:10:42 2021 +0300 + + gr-modtool: Don't copy source permissions + + This is needed for systems such as NixOS, where the build tree isn't + writable and the files copied should be. + + Signed-off-by: Doron Behar <doron.behar@gmail.com> + +diff --git a/gr-utils/python/modtool/core/newmod.py b/gr-utils/python/modtool/core/newmod.py +index 123059907..0c734e7ae 100644 +--- a/gr-utils/python/modtool/core/newmod.py ++++ b/gr-utils/python/modtool/core/newmod.py +@@ -78,7 +78,9 @@ class ModToolNewModule(ModTool): + self._setup_scm(mode='new') + logger.info("Creating out-of-tree module in {}...".format(self.dir)) + try: +- shutil.copytree(self.srcdir, self.dir) ++ # https://stackoverflow.com/a/17022146/4935114 ++ shutil.copystat = lambda x, y: x ++ shutil.copytree(self.srcdir, self.dir, copy_function=shutil.copyfile) + os.chdir(self.dir) + except OSError: + raise ModToolException('Could not create directory {}.'.format(self.dir)) diff --git a/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch new file mode 100644 index 00000000000..7cab73fede0 --- /dev/null +++ b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch @@ -0,0 +1,15 @@ +diff --git c/gr-utils/modtool/core/newmod.py w/gr-utils/modtool/core/newmod.py +index babebfcde..9a02f663e 100644 +--- c/gr-utils/modtool/core/newmod.py ++++ w/gr-utils/modtool/core/newmod.py +@@ -62,7 +62,9 @@ class ModToolNewModule(ModTool): + self._setup_scm(mode='new') + logger.info(f"Creating out-of-tree module in {self.dir}...") + try: +- shutil.copytree(self.srcdir, self.dir) ++ # https://stackoverflow.com/a/17022146/4935114 ++ shutil.copystat = lambda x, y: x ++ shutil.copytree(self.srcdir, self.dir, copy_function=shutil.copyfile) + try: + shutil.copyfile(os.path.join(gr.prefix(), 'share', 'gnuradio', 'clang-format.conf'), + os.path.join(self.dir, '.clang-format')) diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index f8ea2f0b160..ea97864bc61 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -11,7 +11,6 @@ # the main expressions , overrideSrc , fetchFromGitHub -, fetchSubmodules }: rec { @@ -26,12 +25,11 @@ rec { owner = "gnuradio"; rev = "v${version}"; sha256 = sourceSha256; - inherit fetchSubmodules; } ; # Check if a feature is enabled, while defaulting to true if feat is not # specified. - hasFeature = feat: features: ( + hasFeature = feat: ( if builtins.hasAttr feat features then features.${feat} else @@ -39,7 +37,7 @@ rec { ); nativeBuildInputs = lib.flatten (lib.mapAttrsToList ( feat: info: ( - if hasFeature feat features then + if hasFeature feat then (if builtins.hasAttr "native" info then info.native else []) ++ (if builtins.hasAttr "pythonNative" info then info.pythonNative else []) else @@ -48,7 +46,7 @@ rec { ) featuresInfo); buildInputs = lib.flatten (lib.mapAttrsToList ( feat: info: ( - if hasFeature feat features then + if hasFeature feat then (if builtins.hasAttr "runtime" info then info.runtime else []) ++ (if builtins.hasAttr "pythonRuntime" info then info.pythonRuntime else []) else @@ -63,7 +61,7 @@ rec { # satisfied, let only our cmakeFlags decide. "-DENABLE_DEFAULT=OFF" else - if hasFeature feat features then + if hasFeature feat then "-DENABLE_${info.cmakeEnableFlag}=ON" else "-DENABLE_${info.cmakeEnableFlag}=OFF" @@ -75,17 +73,17 @@ rec { stdenv.cc.cc ] # If python-support is disabled, we probably don't want it referenced - ++ lib.optionals (!hasFeature "python-support" features) [ python ] + ++ lib.optionals (!hasFeature "python-support") [ python ] ; # Gcc references from examples stripDebugList = [ "lib" "bin" ] - ++ lib.optionals (hasFeature "gr-audio" features) [ "share/gnuradio/examples/audio" ] - ++ lib.optionals (hasFeature "gr-uhd" features) [ "share/gnuradio/examples/uhd" ] - ++ lib.optionals (hasFeature "gr-qtgui" features) [ "share/gnuradio/examples/qt-gui" ] + ++ lib.optionals (hasFeature "gr-audio") [ "share/gnuradio/examples/audio" ] + ++ lib.optionals (hasFeature "gr-uhd") [ "share/gnuradio/examples/uhd" ] + ++ lib.optionals (hasFeature "gr-qtgui") [ "share/gnuradio/examples/qt-gui" ] ; postInstall = "" # Gcc references - + lib.optionalString (hasFeature "gnuradio-runtime" features) '' + + lib.optionalString (hasFeature "gnuradio-runtime") '' ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so) '' ; @@ -101,9 +99,9 @@ rec { featuresInfo python ; - } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + } // lib.optionalAttrs (hasFeature "gr-qtgui") { inherit qt; - } // lib.optionalAttrs (hasFeature "gnuradio-companion" features) { + } // lib.optionalAttrs (hasFeature "gnuradio-companion") { inherit gtk; }; # Wrapping is done with an external wrapper diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index 7dcb6d467d6..4cbccbd5181 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -33,25 +33,20 @@ }: let + # We don't check if `python-support` feature is on, as it's unlikely someone + # may wish to wrap GR without python support. pythonPkgs = extraPythonPackages + ++ [ (unwrapped.python.pkgs.toPythonModule unwrapped) ] # Add the extraPackages as python modules as well ++ (builtins.map unwrapped.python.pkgs.toPythonModule extraPackages) ++ lib.flatten (lib.mapAttrsToList ( feat: info: ( - if unwrapped.hasFeature feat unwrapped.features then + if unwrapped.hasFeature feat then (if builtins.hasAttr "pythonRuntime" info then info.pythonRuntime else []) else [] ) ) unwrapped.featuresInfo) - ++ lib.optionals - (unwrapped.hasFeature "python-support" unwrapped.features) - ( - # Add unwrapped itself as a python module - [ (unwrapped.python.pkgs.toPythonModule unwrapped) ] - # Add all extraPackages as python modules - ++ (builtins.map unwrapped.python.pkgs.toPythonModule extraPackages) - ) ; pythonEnv = unwrapped.python.withPackages(ps: pythonPkgs); @@ -60,8 +55,8 @@ let ] # Emulating wrapGAppsHook & wrapQtAppsHook working together ++ lib.optionals ( - (unwrapped.hasFeature "gnuradio-companion" unwrapped.features) - || (unwrapped.hasFeature "gr-qtgui" unwrapped.features) + (unwrapped.hasFeature "gnuradio-companion") + || (unwrapped.hasFeature "gr-qtgui") ) [ "--prefix" "XDG_DATA_DIRS" ":" "$out/share" "--prefix" "XDG_DATA_DIRS" ":" "$out/share/gsettings-schemas/${name}" @@ -71,7 +66,7 @@ let # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1764890.html "--prefix" "PATH" ":" "${lib.getBin glib}/bin" ] - ++ lib.optionals (unwrapped.hasFeature "gnuradio-companion" unwrapped.features) [ + ++ lib.optionals (unwrapped.hasFeature "gnuradio-companion") [ "--set" "GDK_PIXBUF_MODULE_FILE" "${librsvg}/${gdk-pixbuf.moduleDir}.cache" "--prefix" "GIO_EXTRA_MODULES" ":" "${lib.getLib dconf}/lib/gio/modules" "--prefix" "XDG_DATA_DIRS" ":" "${unwrapped.gtk}/share" @@ -94,7 +89,7 @@ let ++ lib.optionals (extraPackages != []) [ "--prefix" "GRC_BLOCKS_PATH" ":" "${lib.makeSearchPath "share/gnuradio/grc/blocks" extraPackages}" ] - ++ lib.optionals (unwrapped.hasFeature "gr-qtgui" unwrapped.features) + ++ lib.optionals (unwrapped.hasFeature "gr-qtgui") # 3.7 builds with qt4 (if lib.versionAtLeast unwrapped.versionAttr.major "3.8" then [ diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index 272c381db89..572efa3fac6 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -4,6 +4,7 @@ , pkg-config , qt5 , gnuradio3_8Minimal +, thrift , log4cpp , mpir , fftwFloat @@ -19,13 +20,13 @@ assert pulseaudioSupport -> libpulseaudio != null; gnuradio3_8Minimal.pkgs.mkDerivation rec { pname = "gqrx"; - version = "2.14.4"; + version = "2.14.6"; src = fetchFromGitHub { owner = "csete"; repo = "gqrx"; rev = "v${version}"; - sha256 = "sha256-mMaxu0jq2GaNLWjLsJQXx+zCxtyiCAZQJJZ8GJtnllQ="; + sha256 = "sha256-DMmQXcGPudAVOwuc+LVrcIzfwMMQVBZPbM6Bt1w56D8="; }; nativeBuildInputs = [ @@ -45,6 +46,9 @@ gnuradio3_8Minimal.pkgs.mkDerivation rec { gnuradio3_8Minimal.pkgs.osmosdr rtl-sdr hackrf + ] ++ lib.optionals (gnuradio3_8Minimal.hasFeature "gr-ctrlport") [ + thrift + gnuradio3_8Minimal.unwrapped.python.pkgs.thrift ] ++ lib.optionals pulseaudioSupport [ libpulseaudio ]; postInstall = '' diff --git a/pkgs/applications/radio/inspectrum/default.nix b/pkgs/applications/radio/inspectrum/default.nix index 9d61ab4b601..0f0b89d4316 100644 --- a/pkgs/applications/radio/inspectrum/default.nix +++ b/pkgs/applications/radio/inspectrum/default.nix @@ -1,5 +1,6 @@ { lib , gnuradio3_8Minimal +, thrift , fetchFromGitHub , pkg-config , cmake @@ -28,6 +29,9 @@ gnuradio3_8Minimal.pkgs.mkDerivation rec { fftwFloat liquid-dsp qt5.qtbase + ] ++ lib.optionals (gnuradio3_8Minimal.hasFeature "gr-ctrlport") [ + thrift + gnuradio3_8Minimal.unwrapped.python.pkgs.thrift ]; meta = with lib; { diff --git a/pkgs/applications/radio/pothos/default.nix b/pkgs/applications/radio/pothos/default.nix index 77a7d8cf69f..817013dbf3e 100644 --- a/pkgs/applications/radio/pothos/default.nix +++ b/pkgs/applications/radio/pothos/default.nix @@ -69,6 +69,6 @@ mkDerivation rec { homepage = "https://github.com/pothosware/PothosCore/wiki"; license = licenses.boost; platforms = platforms.linux; - maintainers = with maintainers; [ eduardosm ]; + maintainers = with maintainers; [ ]; }; } diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 2f31761537d..31be8f4fb8b 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -4,6 +4,7 @@ , libconfig # Needs a gnuradio built with qt gui support , gnuradio3_8 +, thrift # Not gnuradioPackages' , codec2 , log4cpp @@ -61,6 +62,9 @@ gnuradio3_8.pkgs.mkDerivation rec { libftdi libsndfile gnuradio3_8.qwt + ] ++ lib.optionals (gnuradio3_8.hasFeature "gr-ctrlport") [ + thrift + gnuradio3_8.unwrapped.python.pkgs.thrift ]; nativeBuildInputs = [ protobuf diff --git a/pkgs/applications/radio/sdrpp/default.nix b/pkgs/applications/radio/sdrpp/default.nix index 2324d400323..5a993f4fc10 100644 --- a/pkgs/applications/radio/sdrpp/default.nix +++ b/pkgs/applications/radio/sdrpp/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, cmake, pkg-config -, libX11, glfw, glew, fftwFloat, volk +, libX11, glfw, glew, fftwFloat, volk, AppKit # Sources , airspy_source ? true, airspy , airspyhf_source ? true, airspyhf @@ -13,7 +13,7 @@ , sdrplay_source ? false, sdrplay , soapy_source ? true, soapysdr , spyserver_source ? true -, plutosdr_source ? true, libiio, libad9361 +, plutosdr_source ? stdenv.isLinux, libiio, libad9361 # Sinks , audio_sink ? true, rtaudio , portaudio_sink ? false, portaudio @@ -42,9 +42,12 @@ stdenv.mkDerivation rec { hash = "sha256-g9tpWvVRMXRhPfgvOeJhX6IMouF9+tLUr9wo5r35i/c="; }; + patches = [ ./runtime-prefix.patch ]; + postPatch = '' substituteInPlace CMakeLists.txt \ - --replace "/usr" $out + --replace "/usr/share" "share" \ + --replace "set(CMAKE_INSTALL_PREFIX" "#set(CMAKE_INSTALL_PREFIX" substituteInPlace decoder_modules/m17_decoder/src/m17dsp.h \ --replace "codec2.h" "codec2/codec2.h" ''; @@ -52,6 +55,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ glfw glew fftwFloat volk ] + ++ lib.optional stdenv.isDarwin AppKit ++ lib.optional stdenv.isLinux libX11 ++ lib.optional airspy_source airspy ++ lib.optional airspyhf_source airspyhf @@ -95,13 +99,18 @@ stdenv.mkDerivation rec { OPT_BUILD_RIGCTL_SERVER = rigctl_server; }; + CXXFLAGS = lib.optional stdenv.cc.isClang "-std=c++17"; + LDFLAGS = lib.optional stdenv.cc.isClang "-lc++fs"; + NIX_CFLAGS_COMPILE = "-fpermissive"; + hardeningDisable = lib.optional stdenv.cc.isClang "format"; + meta = with lib; { description = "Cross-Platform SDR Software"; homepage = "https://github.com/AlexandreRouma/SDRPlusPlus"; license = licenses.gpl3Only; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ sikmir ]; }; } diff --git a/pkgs/applications/radio/sdrpp/runtime-prefix.patch b/pkgs/applications/radio/sdrpp/runtime-prefix.patch new file mode 100644 index 00000000000..55ecd8ce3ee --- /dev/null +++ b/pkgs/applications/radio/sdrpp/runtime-prefix.patch @@ -0,0 +1,60 @@ +From a80a739163d2013ec400223a68a387f4f9297b2a Mon Sep 17 00:00:00 2001 +From: Nikolay Korotkiy <sikmir@gmail.com> +Date: Fri, 29 Oct 2021 01:38:21 +0300 +Subject: [PATCH] Fix sdrpp breaking every time the package is rebuilt. + +On NixOS, the INSTALL_PREFIX changes on every rebuild to the package, but sdrpp +fills it in as part of the default config and then installs that config +to the users home folder. Fix this by not substituting @INSTALL_PREFIX@ in the +default config until runtime. +--- + core/src/core.cpp | 8 ++++++-- + core/src/gui/main_window.cpp | 6 ++++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/core/src/core.cpp b/core/src/core.cpp +index 9546e60..98d6065 100644 +--- a/core/src/core.cpp ++++ b/core/src/core.cpp +@@ -242,8 +242,8 @@ int sdrpp_main(int argc, char *argv[]) { + defConfig["modulesDirectory"] = "./modules"; + defConfig["resourcesDirectory"] = "./res"; + #else +- defConfig["modulesDirectory"] = INSTALL_PREFIX "/lib/sdrpp/plugins"; +- defConfig["resourcesDirectory"] = INSTALL_PREFIX "/share/sdrpp"; ++ defConfig["modulesDirectory"] = "@prefix@/lib/sdrpp/plugins"; ++ defConfig["resourcesDirectory"] = "@prefix@/share/sdrpp"; + #endif + + // Load config +@@ -290,6 +290,10 @@ int sdrpp_main(int argc, char *argv[]) { + int winHeight = core::configManager.conf["windowSize"]["h"]; + maximized = core::configManager.conf["maximized"]; + std::string resDir = core::configManager.conf["resourcesDirectory"]; ++ { ++ std::size_t pos = resDir.find("@prefix@"); ++ if (pos != std::string::npos) resDir.replace(pos, 8, INSTALL_PREFIX); ++ } + json bandColors = core::configManager.conf["bandColors"]; + core::configManager.release(); + +diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp +index 954dbd6..52f0eed 100644 +--- a/core/src/gui/main_window.cpp ++++ b/core/src/gui/main_window.cpp +@@ -44,6 +44,12 @@ void MainWindow::init() { + json menuElements = core::configManager.conf["menuElements"]; + std::string modulesDir = core::configManager.conf["modulesDirectory"]; + std::string resourcesDir = core::configManager.conf["resourcesDirectory"]; ++ { ++ std::size_t pos = modulesDir.find("@prefix@"); ++ if (pos != std::string::npos) modulesDir.replace(pos, 8, INSTALL_PREFIX); ++ pos = resourcesDir.find("@prefix@"); ++ if (pos != std::string::npos) resourcesDir.replace(pos, 8, INSTALL_PREFIX); ++ } + core::configManager.release(); + + // Load menu elements +-- +2.33.0 + diff --git a/pkgs/applications/radio/soapyrtlsdr/default.nix b/pkgs/applications/radio/soapyrtlsdr/default.nix index 855213fc514..5adf07053ab 100644 --- a/pkgs/applications/radio/soapyrtlsdr/default.nix +++ b/pkgs/applications/radio/soapyrtlsdr/default.nix @@ -26,6 +26,6 @@ in stdenv.mkDerivation { description = "SoapySDR plugin for RTL-SDR devices"; license = licenses.mit; maintainers = with maintainers; [ ragge ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } diff --git a/pkgs/applications/radio/wsjtx/default.nix b/pkgs/applications/radio/wsjtx/default.nix index 8dbdd5d4ff2..3e889c21064 100644 --- a/pkgs/applications/radio/wsjtx/default.nix +++ b/pkgs/applications/radio/wsjtx/default.nix @@ -4,12 +4,12 @@ stdenv.mkDerivation rec { pname = "wsjtx"; - version = "2.4.0"; + version = "2.5.1"; # This is a "superbuild" tarball containing both wsjtx and a hamlib fork src = fetchurl { url = "http://physics.princeton.edu/pulsar/k1jt/wsjtx-${version}.tgz"; - sha256 = "sha256-LpfGzI/Hpsp7/K0ZZu2EFVlvWcN0cnAQ1RNAxCMugcg="; + sha256 = "sha256-aof+OavQ+IBw3eef1+bQ9YwIXCdecYiADS+eRXTrmvQ="; }; # Hamlib builds with autotools, wsjtx builds with cmake diff --git a/pkgs/applications/radio/xlog/default.nix b/pkgs/applications/radio/xlog/default.nix index 06b7c108fa9..59af9a94d96 100644 --- a/pkgs/applications/radio/xlog/default.nix +++ b/pkgs/applications/radio/xlog/default.nix @@ -1,11 +1,11 @@ { lib, stdenv, fetchurl, glib, gtk2, pkg-config, hamlib }: stdenv.mkDerivation rec { pname = "xlog"; - version = "2.0.23"; + version = "2.0.24"; src = fetchurl { url = "https://download.savannah.gnu.org/releases/xlog/${pname}-${version}.tar.gz"; - sha256 = "sha256-JSPyXOJbYOCeWY6h0v8fbmBkf1Dop1gdmnn4gKdBgac="; + sha256 = "sha256-jUU6xt3H9bY9CAQRTFQjprlsC77VwjIB/6sSRNzE+Lw="; }; # glib-2.62 deprecations |