diff options
Diffstat (limited to 'pkgs/applications/radio/gnuradio')
-rw-r--r-- | pkgs/applications/radio/gnuradio/3.8.nix | 12 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/3.9.nix | 310 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/default.nix | 21 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_9.patch | 15 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/shared.nix | 18 | ||||
-rw-r--r-- | pkgs/applications/radio/gnuradio/wrapper.nix | 4 |
6 files changed, 28 insertions, 352 deletions
diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index 37533bb05d34d..b611ef66b8250 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -103,11 +103,11 @@ let runtime = [ thrift ]; - pythonRuntime = with python.pkgs; [ + pythonRuntime = [ python.pkgs.thrift # For gr-perf-monitorx - matplotlib - networkx + python.pkgs.matplotlib + python.pkgs.networkx ]; }; gnuradio-companion = { @@ -150,8 +150,8 @@ let }; gr-audio = { runtime = [] - ++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ] - ++ lib.optionals stdenv.isDarwin [ CoreAudio ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libjack2 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreAudio ] ; cmakeEnableFlag = "GR_AUDIO"; }; @@ -296,7 +296,7 @@ stdenv.mkDerivation (finalAttrs: (shared // { # This is the only python reference worth removing, if needed (3.7 doesn't # set that reference). + lib.optionalString (!hasFeature "python-support") '' - ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake + remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake '' ; })) diff --git a/pkgs/applications/radio/gnuradio/3.9.nix b/pkgs/applications/radio/gnuradio/3.9.nix deleted file mode 100644 index 606681b1d6c83..0000000000000 --- a/pkgs/applications/radio/gnuradio/3.9.nix +++ /dev/null @@ -1,310 +0,0 @@ -{ lib, stdenv -, fetchpatch -, fetchFromGitHub -, cmake -# Remove gcc and python references -, removeReferencesTo -, pkg-config -, volk -, cppunit -, orc -, boost -, log4cpp -, mpir -, doxygen -, python -, codec2 -, gsm -, fftwFloat -, alsa-lib -, libjack2 -, CoreAudio -, uhd -, SDL -, gsl -, soapysdr -, libsodium -, libsndfile -, libunwind -, thrift -, cppzmq -# Needed only if qt-gui is disabled, from some reason -, icu -# GUI related -, gtk3 -, pango -, gobject-introspection -, cairo -, qt5 -, libsForQt5 -# Features available to override, the list of them is in featuresInfo. They -# are all turned on by default. -, features ? {} -# If one wishes to use a different src or name for a very custom build -, overrideSrc ? {} -, pname ? "gnuradio" -, version ? "3.9.8.0" -}: - -let - sourceSha256 = "sha256-0umGUOjD5l84CBBeDy1uFgUyEDpI9o9/SEQ8BZm22j4="; - featuresInfo = { - # Needed always - basic = { - native = [ - cmake - pkg-config - orc - ]; - runtime = [ - volk - boost - log4cpp - mpir - ] - # when gr-qtgui is disabled, icu needs to be included, otherwise - # building with boost 1.7x fails - ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ]; - pythonNative = with python.pkgs; [ - mako - six - ]; - }; - doxygen = { - native = [ doxygen ]; - cmakeEnableFlag = "DOXYGEN"; - }; - man-pages = { - cmakeEnableFlag = "MANPAGES"; - }; - python-support = { - pythonRuntime = [ python.pkgs.six ]; - native = [ - python - ]; - cmakeEnableFlag = "PYTHON"; - }; - testing-support = { - native = [ cppunit ]; - cmakeEnableFlag = "TESTING"; - }; - post-install = { - cmakeEnableFlag = "POSTINSTALL"; - }; - gnuradio-runtime = { - cmakeEnableFlag = "GNURADIO_RUNTIME"; - pythonRuntime = [ - python.pkgs.pybind11 - ]; - }; - gr-ctrlport = { - runtime = [ - libunwind - thrift - ]; - pythonRuntime = with python.pkgs; [ - python.pkgs.thrift - # For gr-perf-monitorx - matplotlib - networkx - ]; - cmakeEnableFlag = "GR_CTRLPORT"; - }; - gnuradio-companion = { - pythonRuntime = with python.pkgs; [ - pyyaml - mako - numpy - pygobject3 - ]; - native = [ - python.pkgs.pytest - ]; - runtime = [ - gtk3 - pango - gobject-introspection - cairo - libsndfile - ]; - cmakeEnableFlag = "GRC"; - }; - jsonyaml_blocks = { - pythonRuntime = [ - python.pkgs.jsonschema - ]; - cmakeEnableFlag = "JSONYAML_BLOCKS"; - }; - gr-blocks = { - cmakeEnableFlag = "GR_BLOCKS"; - runtime = [ - libsndfile - ]; - }; - gr-fec = { - cmakeEnableFlag = "GR_FEC"; - }; - gr-fft = { - runtime = [ fftwFloat ]; - cmakeEnableFlag = "GR_FFT"; - }; - gr-filter = { - runtime = [ fftwFloat ]; - cmakeEnableFlag = "GR_FILTER"; - pythonRuntime = with python.pkgs; [ - scipy - pyqtgraph - ]; - }; - gr-analog = { - cmakeEnableFlag = "GR_ANALOG"; - }; - gr-digital = { - cmakeEnableFlag = "GR_DIGITAL"; - }; - gr-dtv = { - cmakeEnableFlag = "GR_DTV"; - }; - gr-audio = { - runtime = [] - ++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ] - ++ lib.optionals stdenv.isDarwin [ CoreAudio ] - ; - cmakeEnableFlag = "GR_AUDIO"; - }; - gr-channels = { - cmakeEnableFlag = "GR_CHANNELS"; - }; - gr-qtgui = { - runtime = [ qt5.qtbase libsForQt5.qwt ]; - pythonRuntime = [ python.pkgs.pyqt5 ]; - cmakeEnableFlag = "GR_QTGUI"; - }; - gr-trellis = { - cmakeEnableFlag = "GR_TRELLIS"; - }; - gr-uhd = { - runtime = [ - uhd - ]; - 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 - ]; - cmakeEnableFlag = "GR_MODTOOL"; - }; - gr-blocktool = { - cmakeEnableFlag = "GR_BLOCKTOOL"; - }; - gr-video-sdl = { - runtime = [ SDL ]; - cmakeEnableFlag = "GR_VIDEO_SDL"; - }; - gr-vocoder = { - runtime = [ codec2 gsm ]; - cmakeEnableFlag = "GR_VOCODER"; - }; - gr-wavelet = { - cmakeEnableFlag = "GR_WAVELET"; - runtime = [ gsl libsodium ]; - }; - gr-zeromq = { - runtime = [ cppzmq ]; - cmakeEnableFlag = "GR_ZEROMQ"; - pythonRuntime = [ - # Will compile without this, but it is required by tests, and by some - # gr blocks. - python.pkgs.pyzmq - ]; - }; - gr-network = { - cmakeEnableFlag = "GR_NETWORK"; - }; - gr-soapy = { - cmakeEnableFlag = "GR_SOAPY"; - runtime = [ - soapysdr - ]; - }; - }; - shared = (import ./shared.nix { - inherit - stdenv - lib - python - removeReferencesTo - featuresInfo - features - version - sourceSha256 - overrideSrc - fetchFromGitHub - ; - qt = qt5; - gtk = gtk3; - }); - inherit (shared.passthru) hasFeature; # function -in - -stdenv.mkDerivation (finalAttrs: (shared // { - inherit pname version; - # Will still evaluate correctly if not used here. It only helps nix-update - # find the right file in which version is defined. - inherit (shared) src; - # Remove failing tests - preConfigure = (shared.preConfigure or "") + '' - # https://github.com/gnuradio/gnuradio/issues/3801 - rm gr-blocks/python/blocks/qa_cpp_py_binding.py - rm gr-blocks/python/blocks/qa_cpp_py_binding_set.py - rm gr-blocks/python/blocks/qa_ctrlport_probes.py - ''; - patches = [ - # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227 - ./modtool-newmod-permissions.3_9.patch - # Fix compilation with GCC 13 - (fetchpatch { - url = "https://github.com/gnuradio/gnuradio/commit/fe1b3592776c26e349e9985d47d3178568dfe6ec.patch"; - hash = "sha256-bu6fJuUo/i4kM+cZqSw8moB0ymoSVooLfwUIW+WDpWI="; - }) - ]; - passthru = shared.passthru // { - # Deps that are potentially overridden and are used inside GR plugins - the same version must - inherit - boost - volk - ; - # Used by many gnuradio modules, the same attribute is present in - # gnuradio3.10 where there it's spdlog. - logLib = log4cpp; - } // lib.optionalAttrs (hasFeature "gr-uhd") { - inherit uhd; - } // 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") '' - ${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${stdenv.hostPlatform.extensions.sharedLibrary}) - ${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake - '' - ; -})) diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index de851c24fa28a..f9113b0a23c39 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -44,11 +44,11 @@ # If one wishes to use a different src or name for a very custom build , overrideSrc ? {} , pname ? "gnuradio" -, version ? "3.10.10.0" +, version ? "3.10.11.0" }: let - sourceSha256 = "sha256-pEVWhXDjOevrduDbZQbiDbODZY8PpsGY4O8yxrwlCcs="; + sourceSha256 = "sha256-QOZXUj+ZmfpazsrHEs8Gx3WSmoHG/zO43NEpyhIjpN8="; featuresInfo = { # Needed always basic = { @@ -103,11 +103,11 @@ let libunwind thrift ]; - pythonRuntime = with python.pkgs; [ + pythonRuntime = [ python.pkgs.thrift # For gr-perf-monitorx - matplotlib - networkx + python.pkgs.matplotlib + python.pkgs.networkx ]; cmakeEnableFlag = "GR_CTRLPORT"; }; @@ -156,6 +156,7 @@ let pythonRuntime = with python.pkgs; [ scipy pyqtgraph + pyqt5 ]; }; gr-analog = { @@ -169,8 +170,8 @@ let }; gr-audio = { runtime = [] - ++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ] - ++ lib.optionals stdenv.isDarwin [ CoreAudio ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libjack2 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreAudio ] ; cmakeEnableFlag = "GR_AUDIO"; }; @@ -311,9 +312,9 @@ stdenv.mkDerivation (finalAttrs: (shared // { postInstall = shared.postInstall # This is the only python reference worth removing, if needed. + 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${stdenv.hostPlatform.extensions.sharedLibrary}) - ${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake + remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake + remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary}) + 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_9.patch b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_9.patch deleted file mode 100644 index 7cab73fede0cc..0000000000000 --- a/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_9.patch +++ /dev/null @@ -1,15 +0,0 @@ -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 da3479777d4a9..75a2a97e0d22f 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -38,7 +38,7 @@ in { sha256 = sourceSha256; } ; - nativeBuildInputs = lib.flatten (lib.mapAttrsToList ( + nativeBuildInputs = [ removeReferencesTo ] ++ lib.flatten (lib.mapAttrsToList ( feat: info: ( lib.optionals (hasFeature feat) ( (lib.optionals (builtins.hasAttr "native" info) info.native) ++ @@ -85,11 +85,11 @@ in { postInstall = "" # Gcc references + lib.optionalString (hasFeature "gnuradio-runtime") '' - ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary}) + remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary}) '' # Clang references in InstalledDir - + lib.optionalString (hasFeature "gnuradio-runtime" && stdenv.isDarwin) '' - ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary}) + + lib.optionalString (hasFeature "gnuradio-runtime" && stdenv.hostPlatform.isDarwin) '' + remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary}) '' ; # NOTE: Outputs are disabled due to upstream not using GNU InstallDIrs cmake @@ -116,14 +116,14 @@ in { dontWrapQtApps = true; # On darwin, it requires playing with DYLD_FALLBACK_LIBRARY_PATH to make if # find libgnuradio-runtim.3.*.dylib . - doCheck = !stdenv.isDarwin; + doCheck = !stdenv.hostPlatform.isDarwin; preCheck = '' export HOME=$(mktemp -d) export QT_QPA_PLATFORM=offscreen export QT_PLUGIN_PATH="${qt.qtbase.bin}/${qt.qtbase.qtPluginPrefix}" ''; - meta = with lib; { + meta = { description = "Software Defined Radio (SDR) software"; mainProgram = "gnuradio-config-info"; longDescription = '' @@ -136,8 +136,8 @@ in { real-world radio systems. ''; homepage = "https://www.gnuradio.org"; - license = licenses.gpl3; - platforms = platforms.unix; - maintainers = with maintainers; [ doronbehar bjornfor fpletz jiegec ]; + license = lib.licenses.gpl3; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ doronbehar bjornfor fpletz jiegec ]; }; } diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index f468aadb27b5d..4ffe42593ec5d 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -127,7 +127,7 @@ let unwrapped.qt.qtbase.qtPluginPrefix (builtins.map lib.getBin ([ unwrapped.qt.qtbase - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ unwrapped.qt.qtwayland ])) }" @@ -137,7 +137,7 @@ let unwrapped.qt.qtbase.qtQmlPrefix (builtins.map lib.getBin ([ unwrapped.qt.qtbase - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ unwrapped.qt.qtwayland ])) }" |