From 4f2573e8750bf8c223cb9d9fddf8933d690f10bd Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 23 Feb 2021 18:08:16 +0200 Subject: [PATCH 01/11] uhd: 3.15.0.0 -> 4.0.0.0 --- pkgs/applications/radio/uhd/3.5.nix | 159 ++++++++++++++++++++++++ pkgs/applications/radio/uhd/default.nix | 17 +-- pkgs/top-level/all-packages.nix | 3 + 3 files changed, 171 insertions(+), 8 deletions(-) create mode 100644 pkgs/applications/radio/uhd/3.5.nix diff --git a/pkgs/applications/radio/uhd/3.5.nix b/pkgs/applications/radio/uhd/3.5.nix new file mode 100644 index 00000000000..d913927a7b9 --- /dev/null +++ b/pkgs/applications/radio/uhd/3.5.nix @@ -0,0 +1,159 @@ +{ lib +, stdenv +, fetchurl +, fetchFromGitHub +, cmake +, pkg-config +# See https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html for dependencies explanations +, boost +, enableLibuhd_C_api ? true +# requires numpy +, enableLibuhd_Python_api ? false +, python3 +, enableExamples ? false +, enableUtils ? false +, enableLiberio ? false +, liberio +, libusb1 +, enableDpdk ? false +, dpdk +# Devices +, enableOctoClock ? true +, enableMpmd ? true +, enableB100 ? true +, enableB200 ? true +, enableUsrp1 ? true +, enableUsrp2 ? true +, enableX300 ? true +, enableN230 ? true +, enableN300 ? true +, enableN320 ? true +, enableE300 ? true +, enableE320 ? true +}: + +let + onOffBool = b: if b then "ON" else "OFF"; + inherit (lib) optionals; +in + +stdenv.mkDerivation rec { + pname = "uhd"; + # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz + # and xxx.yyy.zzz. Hrmpf... style keeps changing + version = "3.15.0.0"; + + src = fetchFromGitHub { + owner = "EttusResearch"; + repo = "uhd"; + rev = "v${version}"; + sha256 = "0jknln88a69fh244670nb7qrflbyv0vvdxfddb5g8ncpb6hcg8qf"; + }; + # Firmware images are downloaded (pre-built) from the respective release on Github + uhdImagesSrc = fetchurl { + url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz"; + sha256 = "1fir1a13ac07mqhm4sr34cixiqj2difxq0870qv1wr7a7cbfw6vp"; + }; + + cmakeFlags = [ + "-DENABLE_LIBUHD=ON" + "-DENABLE_USB=ON" + "-DENABLE_TESTS=ON" # This installs tests as well so we delete them via postPhases + "-DENABLE_EXAMPLES=${onOffBool enableExamples}" + "-DENABLE_UTILS=${onOffBool enableUtils}" + "-DENABLE_LIBUHD_C_API=${onOffBool enableLibuhd_C_api}" + "-DENABLE_LIBUHD_PYTHON_API=${onOffBool enableLibuhd_Python_api}" + "-DENABLE_LIBERIO=${onOffBool enableLiberio}" + "-DENABLE_DPDK=${onOffBool enableDpdk}" + # Devices + "-DENABLE_OCTOCLOCK=${onOffBool enableOctoClock}" + "-DENABLE_MPMD=${onOffBool enableMpmd}" + "-DENABLE_B100=${onOffBool enableB100}" + "-DENABLE_B200=${onOffBool enableB200}" + "-DENABLE_USRP1=${onOffBool enableUsrp1}" + "-DENABLE_USRP2=${onOffBool enableUsrp2}" + "-DENABLE_X300=${onOffBool enableX300}" + "-DENABLE_N230=${onOffBool enableN230}" + "-DENABLE_N300=${onOffBool enableN300}" + "-DENABLE_N320=${onOffBool enableN320}" + "-DENABLE_E300=${onOffBool enableE300}" + "-DENABLE_E320=${onOffBool enableE320}" + ] + # TODO: Check if this still needed + # ABI differences GCC 7.1 + # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 + ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ] + ; + + # Python + Mako are always required for the build itself but not necessary for runtime. + pythonEnv = python3.withPackages (ps: with ps; [ Mako ] + ++ optionals (enableLibuhd_Python_api) [ numpy setuptools ] + ++ optionals (enableUtils) [ requests six ] + ); + + nativeBuildInputs = [ + cmake + pkg-config + ] + # If both enableLibuhd_Python_api and enableUtils are off, we don't need + # pythonEnv in buildInputs as it's a 'build' dependency and not a runtime + # dependency + ++ optionals (!enableLibuhd_Python_api && !enableUtils) [ pythonEnv ] + ; + buildInputs = [ + boost + libusb1 + ] + # However, if enableLibuhd_Python_api *or* enableUtils is on, we need + # pythonEnv for runtime as well. The utilities' runtime dependencies are + # handled at the environment + ++ optionals (enableLibuhd_Python_api || enableUtils) [ pythonEnv ] + ++ optionals (enableLiberio) [ liberio ] + ++ optionals (enableDpdk) [ dpdk ] + ; + + doCheck = true; + + # Build only the host software + preConfigure = "cd host"; + # TODO: Check if this still needed, perhaps relevant: + # https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html#build_instructions_unix_arm + patches = if stdenv.isAarch32 then ./neon.patch else null; + + postPhases = [ "installFirmware" "removeInstalledTests" ] + ++ optionals (enableUtils) [ "moveUdevRules" ] + ; + + # UHD expects images in `$CMAKE_INSTALL_PREFIX/share/uhd/images` + installFirmware = '' + mkdir -p "$out/share/uhd/images" + tar --strip-components=1 -xvf "${uhdImagesSrc}" -C "$out/share/uhd/images" + ''; + + # -DENABLE_TESTS=ON installs the tests, we don't need them in the output + removeInstalledTests = '' + rm -r $out/lib/uhd/tests + ''; + + # Moves the udev rules to the standard location, needed only if utils are + # enabled + moveUdevRules = '' + mkdir -p $out/lib/udev/rules.d + mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/ + ''; + + meta = with lib; { + description = "USRP Hardware Driver (for Software Defined Radio)"; + longDescription = '' + The USRP Hardware Driver (UHD) software is the hardware driver for all + USRP (Universal Software Radio Peripheral) devices. + + USRP devices are designed and sold by Ettus Research, LLC and its parent + company, National Instruments. + ''; + homepage = "https://uhd.ettus.com/"; + license = licenses.gpl3Plus; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ bjornfor fpletz tomberek ]; + }; +} diff --git a/pkgs/applications/radio/uhd/default.nix b/pkgs/applications/radio/uhd/default.nix index bafb2f637df..9f2f39aab2c 100644 --- a/pkgs/applications/radio/uhd/default.nix +++ b/pkgs/applications/radio/uhd/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , fetchFromGitHub , cmake @@ -8,14 +9,14 @@ , enableLibuhd_C_api ? true # requires numpy , enableLibuhd_Python_api ? false -, python3 ? null +, python3 , enableExamples ? false , enableUtils ? false , enableLiberio ? false -, liberio ? null -, libusb1 ? null +, liberio +, libusb1 , enableDpdk ? false -, dpdk ? null +, dpdk # Devices , enableOctoClock ? true , enableMpmd ? true @@ -40,18 +41,18 @@ stdenv.mkDerivation rec { pname = "uhd"; # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz # and xxx.yyy.zzz. Hrmpf... style keeps changing - version = "3.15.0.0"; + version = "4.0.0.0"; src = fetchFromGitHub { owner = "EttusResearch"; repo = "uhd"; rev = "v${version}"; - sha256 = "0jknln88a69fh244670nb7qrflbyv0vvdxfddb5g8ncpb6hcg8qf"; + sha256 = "NCyiI4pIPw0nBRFdUGpgZ/x2mWz+Qm78ZGACUnSbGSs="; }; # Firmware images are downloaded (pre-built) from the respective release on Github uhdImagesSrc = fetchurl { url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz"; - sha256 = "1fir1a13ac07mqhm4sr34cixiqj2difxq0870qv1wr7a7cbfw6vp"; + sha256 = "Xfx0bsHUQ5+Dp+xk0sVWWP83oyXQcUH5AX4PNEE7fY4="; }; cmakeFlags = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b8038e97d9e..c5fb1cafbc1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13141,6 +13141,7 @@ in uefi-firmware-parser = callPackage ../development/tools/analysis/uefi-firmware-parser { }; + uhd3_5 = callPackage ../applications/radio/uhd/3.5.nix { }; uhd = callPackage ../applications/radio/uhd { }; uisp = callPackage ../development/tools/misc/uisp { }; @@ -22358,6 +22359,8 @@ in gnuradio3_7-unwrapped = callPackage ../applications/radio/gnuradio/3.7.nix { inherit (darwin.apple_sdk.frameworks) CoreAudio; python = python2; + # Incompatible with uhd4+ + uhd = uhd3_5; }; # A build without gui components and other utilites not needed if gnuradio is # used as a c++ library. From 7690f9a312e49e56b6df443169e5bf2ea420e0a7 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 24 Feb 2021 23:03:45 +0200 Subject: [PATCH 02/11] gnuradio, uhd: Use boost17x gnss-sdr needs it: https://github.com/boostorg/format/issues/67 . uhd and gnuradio need to use the same boost version to avoid incompatibilities issues. icu is needed from some reason with boost17x. --- pkgs/applications/radio/gnuradio/default.nix | 18 ++++++++++++++++-- pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 9bc1511968b..f8fc1fa10f8 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -24,6 +24,8 @@ , gsl , cppzmq , zeromq +# Needed only if qt-gui is disabled, from some reason +, icu # GUI related , gtk3 , pango @@ -60,7 +62,10 @@ let 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" features)) [ icu ]; pythonNative = with python.pkgs; [ Mako six @@ -160,7 +165,9 @@ let cmakeEnableFlag = "GR_TRELLIS"; }; gr-uhd = { - runtime = [ uhd ]; + runtime = [ + uhd + ]; cmakeEnableFlag = "GR_UHD"; }; gr-utils = { @@ -265,6 +272,13 @@ let url = "https://github.com/gnuradio/gnuradio/commit/dbc8ad7e7361fddc7b1dbc267c07a776a3f9664b.diff"; sha256 = "tQcCpcUbJv3yqAX8rSHN/pAuBq4ueEvoVo7sNzZGvf4="; }) + # Needed to use boost 1.7x, see: + # https://github.com/gnuradio/gnuradio/issues/3720 + # https://github.com/gnuradio/gnuradio/pull/3967 + (fetchpatch { + url = "https://github.com/gnuradio/gnuradio/commit/cbcb968358fad56f3646619b258f18b0e6693a07.diff"; + sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; + }) ]; in diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5fb1cafbc1..97da2fa1699 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13142,7 +13142,9 @@ in uefi-firmware-parser = callPackage ../development/tools/analysis/uefi-firmware-parser { }; uhd3_5 = callPackage ../applications/radio/uhd/3.5.nix { }; - uhd = callPackage ../applications/radio/uhd { }; + uhd = callPackage ../applications/radio/uhd { + boost = boost17x; + }; uisp = callPackage ../development/tools/misc/uisp { }; @@ -22337,6 +22339,7 @@ in gnuradio-unwrapped = callPackage ../applications/radio/gnuradio { inherit (darwin.apple_sdk.frameworks) CoreAudio; python = python3; + boost = boost17x; }; # A build without gui components and other utilites not needed for end user # libraries From 2d08e55e9b8f96cf00466bd55fe0d132f1abd008 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 16 Oct 2020 23:31:20 +0300 Subject: [PATCH 03/11] gnuradio.pkgs: init - Write a `mkDerivation` and `mkDerivationWith` function for gnuradio, like qt5. - qradiolink, gqrx: Use gnuradio's callPackage and mkDerivation. - Use gnuradio.callPackage to define all gnuradio.pkgs. - Move all gnuradio packages expressions to pkgs/development/gnuradio-modules/ - modeled after Python's. - Add more paths to gnuradio's wrapper - add the extra packages as python modules, and add their executables with proper env vars wrapping. Co-authored-by: Frederik Rietdijk --- nixos/doc/manual/release-notes/rl-2105.xml | 12 +- pkgs/applications/radio/gnuradio/3.7.nix | 8 +- pkgs/applications/radio/gnuradio/ais.nix | 53 -------- pkgs/applications/radio/gnuradio/default.nix | 8 ++ pkgs/applications/radio/gnuradio/gsm.nix | 37 ----- pkgs/applications/radio/gnuradio/limesdr.nix | 38 ------ pkgs/applications/radio/gnuradio/osmosdr.nix | 45 ------- pkgs/applications/radio/gnuradio/rds.nix | 36 ----- pkgs/applications/radio/gnuradio/wrapper.nix | 125 +++++++++++------ .../applications/radio/qradiolink/default.nix | 32 +++-- .../gnuradio-modules/ais/default.nix | 45 +++++++ .../gnuradio-modules/gsm/default.nix | 48 +++++++ .../gnuradio-modules/limesdr/default.nix | 59 ++++++++ .../gnuradio-modules/mkDerivation.nix | 23 ++++ .../gnuradio-modules/nacl/default.nix} | 41 +++--- .../gnuradio-modules/osmosdr/default.nix | 84 ++++++++++++ .../gnuradio-modules/rds/default.nix | 57 ++++++++ pkgs/top-level/aliases.nix | 24 ++-- pkgs/top-level/all-packages.nix | 127 +++++++----------- pkgs/top-level/gnuradio-packages.nix | 46 +++++++ 20 files changed, 581 insertions(+), 367 deletions(-) delete mode 100644 pkgs/applications/radio/gnuradio/ais.nix delete mode 100644 pkgs/applications/radio/gnuradio/gsm.nix delete mode 100644 pkgs/applications/radio/gnuradio/limesdr.nix delete mode 100644 pkgs/applications/radio/gnuradio/osmosdr.nix delete mode 100644 pkgs/applications/radio/gnuradio/rds.nix create mode 100644 pkgs/development/gnuradio-modules/ais/default.nix create mode 100644 pkgs/development/gnuradio-modules/gsm/default.nix create mode 100644 pkgs/development/gnuradio-modules/limesdr/default.nix create mode 100644 pkgs/development/gnuradio-modules/mkDerivation.nix rename pkgs/{applications/radio/gnuradio/nacl.nix => development/gnuradio-modules/nacl/default.nix} (50%) create mode 100644 pkgs/development/gnuradio-modules/osmosdr/default.nix create mode 100644 pkgs/development/gnuradio-modules/rds/default.nix create mode 100644 pkgs/top-level/gnuradio-packages.nix diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index e052632ecaf..b091bdb3e27 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -36,7 +36,17 @@ now point to an externally wrapped by default derivations, that allow you to also add `extraPythonPackages` to the Python interpreter used by GNURadio. Missing environmental variables needed for operational GUI were also added - (#7547). + (#75478). + + + + + GNURadio has a + pkgs attribute set, and there's a gnuradio.callPackage + function that extends pkgs with a mkDerivation, and a + mkDerivationWith, like Qt5. Now all gnuradio.pkgs are + defined with gnuradio.callPackage and some packages that depend + on gnuradio are defined with this as well. diff --git a/pkgs/applications/radio/gnuradio/3.7.nix b/pkgs/applications/radio/gnuradio/3.7.nix index a48efb9aa6d..7ad2d297982 100644 --- a/pkgs/applications/radio/gnuradio/3.7.nix +++ b/pkgs/applications/radio/gnuradio/3.7.nix @@ -221,11 +221,17 @@ let buildInputs disallowedReferences postInstall - passthru doCheck dontWrapPythonPrograms meta ; + + passthru = shared.passthru // { + # Deps that are potentially overriden and are used inside GR plugins - the same version must + inherit boost; + } // lib.optionalAttrs (hasFeature "gr-uhd" features) { + 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 diff --git a/pkgs/applications/radio/gnuradio/ais.nix b/pkgs/applications/radio/gnuradio/ais.nix deleted file mode 100644 index 8d6e8509772..00000000000 --- a/pkgs/applications/radio/gnuradio/ais.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, pkg-config -, boost -, gnuradio -, makeWrapper -, cppunit -, gr-osmosdr -, log4cpp -, pythonSupport ? true -, python -, swig -, fetchpatch -}: - -stdenv.mkDerivation { - pname = "gr-ais"; - version = "2015-12-20"; - - src = fetchFromGitHub { - owner = "bistromath"; - repo = "gr-ais"; - rev = "cdc1f52745853f9c739c718251830eb69704b26e"; - sha256 = "1vl3kk8xr2mh5lf31zdld7yzmwywqffffah8iblxdzblgsdwxfl6"; - }; - - patches = [ - (fetchpatch { - url = "https://github.com/bistromath/gr-ais/commit/8502d0252a2a1a9b8d1a71795eaeb5d820684054.patch"; - sha256 = "1cwalphldvf6dbhzwz1gi53z0cb4921qsvlz4138q7m6dxccvssg"; - }) - ]; - - nativeBuildInputs = [ cmake makeWrapper pkg-config ]; - buildInputs = [ boost gnuradio cppunit gr-osmosdr log4cpp ] - ++ lib.optionals pythonSupport [ python swig ]; - - postInstall = '' - for prog in "$out"/bin/*; do - wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out") - done - ''; - - meta = with lib; { - description = "Gnuradio block for ais"; - homepage = "https://github.com/bistromath/gr-ais"; - license = licenses.gpl3Plus; - platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ mog ]; - }; -} diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index f8fc1fa10f8..fc7890299c5 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -228,6 +228,14 @@ let dontWrapQtApps meta ; + passthru = shared.passthru // { + # Deps that are potentially overriden and are used inside GR plugins - the same version must + inherit boost; + } // lib.optionalAttrs (hasFeature "gr-uhd" features) { + inherit uhd; + } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + inherit (libsForQt5) qwt; + }; cmakeFlags = shared.cmakeFlags # From some reason, if these are not set, libcodec2 and gsm are not # detected properly. NOTE: qradiolink needs libcodec2 to be detected in diff --git a/pkgs/applications/radio/gnuradio/gsm.nix b/pkgs/applications/radio/gnuradio/gsm.nix deleted file mode 100644 index 28c5045081b..00000000000 --- a/pkgs/applications/radio/gnuradio/gsm.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, gnuradio, log4cpp -, makeWrapper, cppunit, libosmocore, gr-osmosdr -, pythonSupport ? true, python, swig -}: - -assert pythonSupport -> python != null && swig != null; - -stdenv.mkDerivation { - pname = "gr-gsm"; - version = "2016-08-25"; - - src = fetchFromGitHub { - owner = "ptrkrysik"; - repo = "gr-gsm"; - rev = "3ca05e6914ef29eb536da5dbec323701fbc2050d"; - sha256 = "13nnq927kpf91iqccr8db9ripy5czjl5jiyivizn6bia0bam2pvx"; - }; - - nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ - boost gnuradio makeWrapper cppunit libosmocore gr-osmosdr log4cpp - ] ++ lib.optionals pythonSupport [ python swig ]; - - postInstall = '' - for prog in "$out"/bin/*; do - wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:${gr-osmosdr}/lib/${python.libPrefix}/site-packages:$(toPythonPath "$out") - done - ''; - - meta = with lib; { - description = "Gnuradio block for gsm"; - homepage = "https://github.com/ptrkrysik/gr-gsm"; - license = licenses.gpl3Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ mog ]; - }; -} diff --git a/pkgs/applications/radio/gnuradio/limesdr.nix b/pkgs/applications/radio/gnuradio/limesdr.nix deleted file mode 100644 index afe3de64527..00000000000 --- a/pkgs/applications/radio/gnuradio/limesdr.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, gnuradio -, pythonSupport ? true, python, swig, limesuite, log4cpp -} : - -assert pythonSupport -> python != null && swig != null; - -let - version = "2.0.0"; - -in stdenv.mkDerivation { - pname = "gr-limesdr"; - inherit version; - - src = fetchFromGitHub { - owner = "myriadrf"; - repo = "gr-limesdr"; - rev = "v${version}"; - sha256 = "0ldqvfwl0gil89l9s31fjf9d7ki0dk572i8vna336igfaz348ypq"; - }; - - nativeBuildInputs = [ - cmake - pkg-config - ] ++ lib.optionals pythonSupport [ swig ]; - - buildInputs = [ - boost gnuradio limesuite log4cpp - ] ++ lib.optionals pythonSupport [ python ]; - - - meta = with lib; { - description = "Gnuradio source and sink blocks for LimeSDR"; - homepage = "https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = [ maintainers.markuskowa ]; - }; -} diff --git a/pkgs/applications/radio/gnuradio/osmosdr.nix b/pkgs/applications/radio/gnuradio/osmosdr.nix deleted file mode 100644 index 436c4309a5b..00000000000 --- a/pkgs/applications/radio/gnuradio/osmosdr.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ lib, stdenv, fetchgit, cmake, pkg-config, makeWrapper -, boost -, pythonSupport ? true, python, swig -, airspy -, gnuradio -, hackrf -, libbladeRF -, rtl-sdr -, soapysdr-with-plugins -, uhd -, log4cpp -}: - -assert pythonSupport -> python != null && swig != null; - -stdenv.mkDerivation rec { - pname = "gr-osmosdr"; - version = "0.1.5"; - - src = fetchgit { - url = "git://git.osmocom.org/gr-osmosdr"; - rev = "v${version}"; - sha256 = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv"; - }; - - nativeBuildInputs = [ cmake makeWrapper pkg-config ]; - buildInputs = [ - boost log4cpp airspy gnuradio hackrf libbladeRF rtl-sdr uhd - ] ++ lib.optionals stdenv.isLinux [ soapysdr-with-plugins ] - ++ lib.optionals pythonSupport [ python swig python.pkgs.cheetah ]; - - postInstall = '' - for prog in "$out"/bin/*; do - wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out") - done - ''; - - meta = with lib; { - description = "Gnuradio block for OsmoSDR and rtl-sdr"; - homepage = "https://sdr.osmocom.org/trac/wiki/GrOsmoSDR"; - license = licenses.gpl3Plus; - platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ bjornfor ]; - }; -} diff --git a/pkgs/applications/radio/gnuradio/rds.nix b/pkgs/applications/radio/gnuradio/rds.nix deleted file mode 100644 index 4f15f2a961e..00000000000 --- a/pkgs/applications/radio/gnuradio/rds.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, gnuradio, log4cpp -, makeWrapper, pythonSupport ? true, python, swig -}: - -assert pythonSupport -> python != null && swig != null; - -stdenv.mkDerivation rec { - pname = "gr-rds"; - version = "1.1.0"; - - src = fetchFromGitHub { - owner = "bastibl"; - repo = "gr-rds"; - rev = "v${version}"; - sha256 = "0jkzchvw0ivcxsjhi1h0mf7k13araxf5m4wi5v9xdgqxvipjzqfy"; - }; - - nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ - boost gnuradio makeWrapper log4cpp - ] ++ lib.optionals pythonSupport [ python swig ]; - - postInstall = '' - for prog in "$out"/bin/*; do - wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out") - done - ''; - - meta = with lib; { - description = "Gnuradio block for radio data system"; - homepage = "https://github.com/bastibl/gr-rds"; - license = licenses.gpl2Plus; - platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ mog ]; - }; -} diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index aaf74abc2c5..d255b199bc9 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -1,9 +1,16 @@ { lib , stdenv +# The unwrapped gnuradio derivation , unwrapped +# If it's a minimal build, we don't want to wrap it with lndir and +# wrapProgram.. +, wrap ? true +# For the wrapper , makeWrapper # For lndir , xorg +# To define a the gnuradio.pkgs scope +, newScope # For Emulating wrapGAppsHook , gsettings-desktop-schemas , glib @@ -37,12 +44,16 @@ let [] ) ) unwrapped.featuresInfo) - ++ lib.optionals (unwrapped.hasFeature "python-support" unwrapped.features) [ - # Add unwrapped itself as a python module - (unwrapped.python.pkgs.toPythonModule unwrapped) - ] + ++ 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) + ) ; - python3Env = unwrapped.python.withPackages(ps: pythonPkgs); + pythonEnv = unwrapped.python.withPackages(ps: pythonPkgs); name = (lib.appendToName "wrapped" unwrapped).name; makeWrapperArgs = builtins.concatStringsSep " " ([ @@ -88,48 +99,84 @@ let (if unwrapped.versionAttr.major == "3.8" then [ "--prefix" "QT_PLUGIN_PATH" ":" - "${lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtPluginPrefix}" + "${ + lib.makeSearchPath + unwrapped.qt.qtbase.qtPluginPrefix + (builtins.map lib.getBin [ + unwrapped.qt.qtbase + unwrapped.qt.qtwayland + ]) + }" "--prefix" "QML2_IMPORT_PATH" ":" - "${lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtQmlPrefix}" + "${ + lib.makeSearchPath + unwrapped.qt.qtbase.qtQmlPrefix + (builtins.map lib.getBin [ + unwrapped.qt.qtbase + unwrapped.qt.qtwayland + ]) + }" ] else - # TODO: Add here qt4 related environment for 3.7? + # Add here qt4 related environment for 3.7? [ ] ) ++ extraMakeWrapperArgs ); -in -stdenv.mkDerivation { - inherit name; - buildInputs = [ - makeWrapper - xorg.lndir - ]; - - passthru = { - inherit python3Env pythonPkgs unwrapped; + packages = import ../../../top-level/gnuradio-packages.nix { + inherit lib stdenv newScope; + gnuradio = unwrapped; }; - - buildCommand = '' - mkdir $out - cd $out - lndir -silent ${unwrapped} - for i in $out/bin/*; do - if [[ ! -x "$i" ]]; then - continue - fi - cp -L "$i" "$i".tmp - mv -f "$i".tmp "$i" - if head -1 "$i" | grep -q ${unwrapped.python}; then - substituteInPlace "$i" \ - --replace ${unwrapped.python} ${python3Env} - fi - wrapProgram "$i" ${makeWrapperArgs} - done - ''; - - inherit (unwrapped) meta; -} + passthru = unwrapped.passthru // { + inherit + pythonEnv + pythonPkgs + unwrapped + ; + pkgs = packages; + }; + self = if wrap then + stdenv.mkDerivation { + inherit name passthru; + buildInputs = [ + makeWrapper + xorg.lndir + ]; + buildCommand = '' + mkdir $out + cd $out + lndir -silent ${unwrapped} + ${lib.optionalString + (extraPackages != []) + (builtins.concatStringsSep "\n" + (builtins.map (pkg: '' + if [[ -d ${lib.getBin pkg}/bin/ ]]; then + lndir -silent ${pkg}/bin ./bin + fi + '') extraPackages) + ) + } + for i in $out/bin/*; do + if [[ ! -x "$i" ]]; then + continue + fi + cp -L "$i" "$i".tmp + mv -f "$i".tmp "$i" + if head -1 "$i" | grep -q ${unwrapped.python}; then + substituteInPlace "$i" \ + --replace ${unwrapped.python} ${pythonEnv} + fi + wrapProgram "$i" ${makeWrapperArgs} + done + ''; + inherit (unwrapped) meta; + } + else + unwrapped.overrideAttrs(_: { + inherit passthru; + }) + ; +in self diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 24c5f987f17..1688d0010fe 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -1,13 +1,22 @@ -{ lib, stdenv, fetchFromGitHub, alsaLib, boost -, qt4, libpulseaudio, codec2, libconfig -, gnuradio, gr-osmosdr, gsm -, libopus, libjpeg, protobuf, qwt, speex +{ lib +, mkDerivation +, fetchFromGitHub +, libpulseaudio +, libconfig +, gnuradio +, gnuradioPackages +, gsm +, libopus +, libjpeg +, protobuf +, speex +, qmake4Hook } : let version = "0.5.0"; -in stdenv.mkDerivation { +in mkDerivation { pname = "qradiolink"; inherit version; @@ -32,20 +41,17 @@ in stdenv.mkDerivation { ''; buildInputs = [ - qt4 - alsaLib - boost libpulseaudio - codec2 libconfig gsm - gnuradio - gr-osmosdr + gnuradioPackages.osmosdr libopus libjpeg - protobuf speex - qwt + ]; + nativeBuildInputs = [ + protobuf + qmake4Hook ]; enableParallelBuilding = true; diff --git a/pkgs/development/gnuradio-modules/ais/default.nix b/pkgs/development/gnuradio-modules/ais/default.nix new file mode 100644 index 00000000000..0770d83f21d --- /dev/null +++ b/pkgs/development/gnuradio-modules/ais/default.nix @@ -0,0 +1,45 @@ +{ lib +, stdenv +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, python +, boost +, cppunit +, log4cpp +, osmosdr +}: + +mkDerivation rec { + pname = "gr-ais"; + version = "2015-12-20"; + src = fetchFromGitHub { + owner = "bistromath"; + repo = "gr-ais"; + rev = "cdc1f52745853f9c739c718251830eb69704b26e"; + sha256 = "1vl3kk8xr2mh5lf31zdld7yzmwywqffffah8iblxdzblgsdwxfl6"; + }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + python + ]; + + buildInputs = [ + cppunit + osmosdr + boost + log4cpp + ]; + + meta = with lib; { + description = "Gnuradio block for ais"; + homepage = "https://github.com/bistromath/gr-ais"; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ mog ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/gsm/default.nix b/pkgs/development/gnuradio-modules/gsm/default.nix new file mode 100644 index 00000000000..835c5456668 --- /dev/null +++ b/pkgs/development/gnuradio-modules/gsm/default.nix @@ -0,0 +1,48 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, cppunit +, swig +, boost +, log4cpp +, python +, libosmocore +, osmosdr +}: + +mkDerivation { + pname = "gr-gsm"; + version = "2016-08-25"; + src = fetchFromGitHub { + owner = "ptrkrysik"; + repo = "gr-gsm"; + rev = "3ca05e6914ef29eb536da5dbec323701fbc2050d"; + sha256 = "13nnq927kpf91iqccr8db9ripy5czjl5jiyivizn6bia0bam2pvx"; + }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + + buildInputs = [ + cppunit + log4cpp + boost + libosmocore + osmosdr + ]; + + meta = with lib; { + description = "Gnuradio block for gsm"; + homepage = "https://github.com/ptrkrysik/gr-gsm"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ mog ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/limesdr/default.nix b/pkgs/development/gnuradio-modules/limesdr/default.nix new file mode 100644 index 00000000000..63136b33d65 --- /dev/null +++ b/pkgs/development/gnuradio-modules/limesdr/default.nix @@ -0,0 +1,59 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, gnuradio +, cmake +, pkg-config +, doxygen +, swig +, python +, log4cpp +, mpir +, boost +, gmp +, icu +, limesuite +}: + +let + version = { + "3.7" = "2.0.0"; + "3.8" = "3.0.1"; + }.${gnuradio.versionAttr.major}; + src = fetchFromGitHub { + owner = "myriadrf"; + repo = "gr-limesdr"; + rev = "v${version}"; + sha256 = { + "3.7" = "0ldqvfwl0gil89l9s31fjf9d7ki0dk572i8vna336igfaz348ypq"; + "3.8" = "ffs+8TU0yr6IW1xZJ/abQ1CQWGZM+zYqPRJxy3ZvM9U="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-limesdr"; + inherit version src; + disabledForGRafter = "3.9"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + buildInputs = [ + log4cpp + mpir + boost + gmp + icu + limesuite + ]; + + meta = with lib; { + description = "Gnuradio source and sink blocks for LimeSDR"; + homepage = "https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = [ maintainers.markuskowa ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/mkDerivation.nix b/pkgs/development/gnuradio-modules/mkDerivation.nix new file mode 100644 index 00000000000..235eff25cdb --- /dev/null +++ b/pkgs/development/gnuradio-modules/mkDerivation.nix @@ -0,0 +1,23 @@ +{ lib +, unwrapped +}: + +mkDerivation: + +args: + +# Check if it's supposed to not get built for the current gnuradio version +if (builtins.hasAttr "disabledForGRafter" args) && +(lib.versionAtLeast unwrapped.versionAttr.major args.disabledForGRafter) then +let name = args.name or "${args.pname}"; in +throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}" +else + +let + args_ = { + enableParallelBuilding = args.enableParallelBuilding or true; + nativeBuildInputs = (args.nativeBuildInputs or []); + # We add gnuradio itself by default + buildInputs = (args.buildInputs or []) ++ [ unwrapped ]; + }; +in mkDerivation (args // args_) diff --git a/pkgs/applications/radio/gnuradio/nacl.nix b/pkgs/development/gnuradio-modules/nacl/default.nix similarity index 50% rename from pkgs/applications/radio/gnuradio/nacl.nix rename to pkgs/development/gnuradio-modules/nacl/default.nix index f6c21e79454..1ffb0afee07 100644 --- a/pkgs/applications/radio/gnuradio/nacl.nix +++ b/pkgs/development/gnuradio-modules/nacl/default.nix @@ -1,31 +1,40 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, gnuradio, uhd -, makeWrapper, libsodium, cppunit, log4cpp -, pythonSupport ? true, python, swig +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, cppunit +, swig +, boost +, log4cpp +, python +, libsodium }: -assert pythonSupport -> python != null && swig != null; - -stdenv.mkDerivation { +mkDerivation { pname = "gr-nacl"; version = "2017-04-10"; - src = fetchFromGitHub { owner = "stwunsch"; repo = "gr-nacl"; rev = "15276bb0fcabf5fe4de4e58df3d579b5be0e9765"; sha256 = "018np0qlk61l7mlv3xxx5cj1rax8f1vqrsrch3higsl25yydbv7v"; }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; - nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ - boost gnuradio uhd makeWrapper libsodium cppunit log4cpp - ] ++ lib.optionals pythonSupport [ python swig ]; - - postInstall = '' - for prog in "$out"/bin/*; do - wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out") - done - ''; + cppunit + log4cpp + boost + libsodium + ]; meta = with lib; { description = "Gnuradio block for encryption"; diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix new file mode 100644 index 00000000000..4159862bbed --- /dev/null +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -0,0 +1,84 @@ +{ lib +, mkDerivation +, fetchgit +, gnuradio +, cmake +, pkg-config +, log4cpp +, mpir +, boost +, gmp +, fftwFloat +, python +, swig +, uhd +, icu +, airspy +, hackrf +, libbladeRF +, rtl-sdr +, soapysdr-with-plugins +}: + +let + version = { + "3.7" = "0.1.5"; + "3.8" = "0.2.2"; + }.${gnuradio.versionAttr.major}; + src = fetchgit { + url = "git://git.osmocom.org/gr-osmosdr"; + rev = "v${version}"; + sha256 = { + "3.7" = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv"; + "3.8" = "HT6xlN6cJAnvF+s1g2I1uENhBJJizdADlLXeSD0rEqs="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-osmosdr"; + inherit version src; + disabledForGRafter = "3.9"; + + buildInputs = [ + log4cpp + mpir + boost + fftwFloat + gmp + icu + airspy + hackrf + libbladeRF + rtl-sdr + soapysdr-with-plugins + ] ++ lib.optional (gnuradio.hasFeature "gr-uhd" gnuradio.features) [ + uhd + ]; + cmakeFlags = [ + (if (gnuradio.hasFeature "python-support" gnuradio.features) then + "-DENABLE_PYTHON=ON" + else + "-DENABLE_PYTHON=OFF" + ) + ]; + nativeBuildInputs = [ + cmake + pkg-config + swig + ] ++ lib.optionals (gnuradio.hasFeature "python-support" gnuradio.features) [ + (if (gnuradio.versionAttr.major == "3.7") then + python.pkgs.cheetah + else + python.pkgs.Mako + ) + python + ] + ; + + meta = with lib; { + description = "Gnuradio block for OsmoSDR and rtl-sdr"; + homepage = "https://sdr.osmocom.org/trac/wiki/GrOsmoSDR"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ bjornfor ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/gnuradio-modules/rds/default.nix b/pkgs/development/gnuradio-modules/rds/default.nix new file mode 100644 index 00000000000..a2062783bd7 --- /dev/null +++ b/pkgs/development/gnuradio-modules/rds/default.nix @@ -0,0 +1,57 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, gnuradio +, cmake +, pkg-config +, swig +, python +, log4cpp +, mpir +, boost +, gmp +, icu +}: + +let + version = { + "3.7" = "1.1.0"; + "3.8" = "3.8.0"; + }.${gnuradio.versionAttr.major}; + src = fetchFromGitHub { + owner = "bastibl"; + repo = "gr-rds"; + rev = "v${version}"; + sha256 = { + "3.7" = "0jkzchvw0ivcxsjhi1h0mf7k13araxf5m4wi5v9xdgqxvipjzqfy"; + "3.8" = "+yKLJu2bo7I2jkAiOdjvdhZwxFz9NFgTmzcLthH9Y5o="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-rds"; + inherit version src; + disabledForGRafter = "3.9"; + + buildInputs = [ + log4cpp + mpir + boost + gmp + icu + ]; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + + meta = with lib; { + description = "Gnuradio block for radio data system"; + homepage = "https://github.com/bastibl/gr-rds"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ mog ]; + }; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 6036e421683..260c5cfb2bc 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -240,16 +240,24 @@ mapAliases ({ gnome_doc_utils = gnome-doc-utils; # added 2018-02-25 gnome_themes_standard = gnome-themes-standard; # added 2018-02-25 gnunet_git = throw "gnunet_git was removed due to gnunet becoming stable"; # added 2019-05-27 - gnuradio-nacl = gr-nacl; # added 2019-05-27 - gnuradio-gsm = gr-gsm; # added 2019-05-27 - gnuradio-ais = gr-ais; # added 2019-05-27 - gnuradio-limesdr = gr-limesdr; # added 2019-05-27 - gnuradio-rds = gr-rds; # added 2019-05-27 - gnuradio-osmosdr = gr-osmosdr; # added 2019-05-27 - # added 20-10-2020 + # Added 2020-10-16 gnuradio-with-packages = gnuradio3_7.override { - extraPackages = [ gr-nacl gr-gsm gr-ais gr-limesdr gr-rds gr-osmosdr ]; + extraPackages = lib.attrVals [ + "osmosdr" "ais" "gsm" "nacl" "rds" "limesdr" + ] gnuradio3_7Packages; }; + gnuradio-nacl = gnuradio3_7.pkgs.nacl; # added 2019-05-27, changed 2020-10-16 + gnuradio-gsm = gnuradio3_7.pkgs.gsm; # added 2019-05-27, changed 2020-10-16 + gnuradio-ais = gnuradio3_7.pkgs.ais; # added 2019-05-27, changed 2020-10-16 + gnuradio-limesdr = gnuradio3_7.pkgs.limesdr; # added 2019-05-27, changed 2020-10-16 + gnuradio-rds = gnuradio3_7.pkgs.rds; # added 2019-05-27, changed 2020-10-16 + gnuradio-osmosdr = gnuradio3_7.pkgs.osmosdr; # added 2019-05-27, changed 2020-10-16 + gr-nacl = gnuradio3_7.pkgs.nacl; # added 2019-05-27, changed 2020-10-16 + gr-gsm = gnuradio3_7.pkgs.gsm; # added 2019-05-27, changed 2020-10-16 + gr-ais = gnuradio3_7.pkgs.ais; # added 2019-05-27, changed 2020-10-16 + gr-limesdr = gnuradio3_7.pkgs.limesdr; # added 2019-05-27, changed 2020-10-16 + gr-rds = gnuradio3_7.pkgs.rds; # added 2019-05-27, changed 2020-10-16 + gr-osmosdr = gnuradio3_7.pkgs.osmosdr; # added 2019-05-27, changed 2020-10-16 gnustep-make = gnustep.make; # added 2016-7-6 gnupg20 = throw "gnupg20 has been removed from nixpkgs as upstream dropped support on 2017-12-31";# added 2020-07-12 gnuvd = throw "gnuvd was removed because the backend service is missing"; # added 2020-01-14 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 97da2fa1699..4a6fe9410cc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16776,13 +16776,7 @@ in qm-dsp = callPackage ../development/libraries/audio/qm-dsp { }; - qradiolink = callPackage ../applications/radio/qradiolink { - # 3.8 support is not ready yet: - # https://github.com/qradiolink/qradiolink/issues/67#issuecomment-703222573 - # The non minimal build is used because the 'qtgui' component is needed. - # gr-osmosdr is using the same gnuradio as of now. - gnuradio = gnuradio3_7-unwrapped; - }; + qradiolink = callPackage ../applications/radio/qradiolink { }; qrupdate = callPackage ../development/libraries/qrupdate { }; @@ -22333,82 +22327,62 @@ in gnss-sdr = callPackage ../applications/radio/gnss-sdr { boost = boost166; - gnuradio = gnuradio3_7-unwrapped; + gnuradio = gnuradio3_7.unwrapped; }; - gnuradio-unwrapped = callPackage ../applications/radio/gnuradio { - inherit (darwin.apple_sdk.frameworks) CoreAudio; - python = python3; - boost = boost17x; - }; - # A build without gui components and other utilites not needed for end user - # libraries - gnuradioMinimal = gnuradio-unwrapped.override { - features = { - gnuradio-companion = false; - python-support = false; - gr-ctrlport = false; - examples = false; - gr-qtgui = false; - gr-utils = false; - gr-modtool = false; - sphinx = false; - doxygen = false; + gnuradio = callPackage ../applications/radio/gnuradio/wrapper.nix { + unwrapped = callPackage ../applications/radio/gnuradio { + inherit (darwin.apple_sdk.frameworks) CoreAudio; + python = python3; + boost = boost17x; }; }; - gnuradio = callPackage ../applications/radio/gnuradio/wrapper.nix { - unwrapped = gnuradio-unwrapped; - }; - gnuradio3_7-unwrapped = callPackage ../applications/radio/gnuradio/3.7.nix { - inherit (darwin.apple_sdk.frameworks) CoreAudio; - python = python2; - # Incompatible with uhd4+ - uhd = uhd3_5; - }; - # A build without gui components and other utilites not needed if gnuradio is - # used as a c++ library. - gnuradio3_7Minimal = gnuradio3_7-unwrapped.override { - features = { - gnuradio-companion = false; - python-support = false; - gr-ctrlport = false; - gr-qtgui = false; - gr-utils = false; - sphinx = false; - doxygen = false; - gr-wxgui = false; + gnuradioPackages = lib.recurseIntoAttrs gnuradio.pkgs; + # A build without gui components and other utilites not needed for end user + # libraries + gnuradioMinimal = gnuradio.override { + wrap = false; + unwrapped = gnuradio.unwrapped.override { + features = { + gnuradio-companion = false; + python-support = false; + examples = false; + gr-qtgui = false; + gr-utils = false; + gr-modtool = false; + sphinx = false; + doxygen = false; + }; }; }; gnuradio3_7 = callPackage ../applications/radio/gnuradio/wrapper.nix { - unwrapped = gnuradio3_7-unwrapped; + unwrapped = callPackage ../applications/radio/gnuradio/3.7.nix { + inherit (darwin.apple_sdk.frameworks) CoreAudio; + python = python2; + # Incompatible with uhd4+ + uhd = uhd3_5; + }; + }; + gnuradio3_7Packages = lib.recurseIntoAttrs gnuradio3_7.pkgs; + # A build without gui components and other utilites not needed if gnuradio is + # used as a c++ library. + gnuradio3_7Minimal = gnuradio3_7.override { + wrap = false; + unwrapped = gnuradio3_7.unwrapped.override { + features = { + gnuradio-companion = false; + python-support = false; + gr-qtgui = false; + gr-utils = false; + sphinx = false; + doxygen = false; + gr-wxgui = false; + }; + }; }; grandorgue = callPackage ../applications/audio/grandorgue { }; - gr-nacl = callPackage ../applications/radio/gnuradio/nacl.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - - gr-gsm = callPackage ../applications/radio/gnuradio/gsm.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - - gr-ais = callPackage ../applications/radio/gnuradio/ais.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - - gr-limesdr = callPackage ../applications/radio/gnuradio/limesdr.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - - gr-rds = callPackage ../applications/radio/gnuradio/rds.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - - gr-osmosdr = callPackage ../applications/radio/gnuradio/osmosdr.nix { - gnuradio = gnuradio3_7-unwrapped; - }; - goldendict = libsForQt5.callPackage ../applications/misc/goldendict { inherit (darwin) libiconv; }; @@ -22435,14 +22409,7 @@ in gpx = callPackage ../applications/misc/gpx { }; - gqrx = libsForQt514.callPackage ../applications/radio/gqrx { - gnuradio = gnuradio3_7Minimal; - # Use the same gnuradio for gr-osmosdr as well - gr-osmosdr = gr-osmosdr.override { - gnuradio = gnuradio3_7Minimal; - pythonSupport = false; - }; - }; + gqrx = callPackage ../applications/radio/gqrx { }; gpx-viewer = callPackage ../applications/misc/gpx-viewer { }; diff --git a/pkgs/top-level/gnuradio-packages.nix b/pkgs/top-level/gnuradio-packages.nix new file mode 100644 index 00000000000..6c8db76cb3e --- /dev/null +++ b/pkgs/top-level/gnuradio-packages.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, newScope +, gnuradio # unwrapped gnuradio +}: + +lib.makeScope newScope ( self: + +let + # Modeled after qt's + mkDerivationWith = import ../development/gnuradio-modules/mkDerivation.nix { + inherit lib; + unwrapped = gnuradio; + }; + mkDerivation = mkDerivationWith stdenv.mkDerivation; + + callPackage = self.newScope { + inherit (gnuradio) + # Packages that are potentially overriden and commonly + boost + uhd + ; + inherit mkDerivationWith mkDerivation; + }; + +in { + + inherit callPackage mkDerivation mkDerivationWith; + + ### Packages + + inherit gnuradio; + + osmosdr = callPackage ../development/gnuradio-modules/osmosdr/default.nix { }; + + ais = callPackage ../development/gnuradio-modules/ais/default.nix { }; + + gsm = callPackage ../development/gnuradio-modules/gsm/default.nix { }; + + nacl = callPackage ../development/gnuradio-modules/nacl/default.nix { }; + + rds = callPackage ../development/gnuradio-modules/rds/default.nix { }; + + limesdr = callPackage ../development/gnuradio-modules/limesdr/default.nix { }; + +}) From 6a4744a09436803e6a0865fe7c2ed2e3c4cd5497 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 15 Dec 2020 12:31:32 +0200 Subject: [PATCH 04/11] gnuradio: Remove qt5 and gtk from passthru if not used Attributes such as gnuradioMinimal built without gui support should not have the `qt` and `gtk` attributes in it's passthru. --- pkgs/applications/radio/gnuradio/shared.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index 9b354d5b960..271819e6072 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -103,9 +103,11 @@ rec { features featuresInfo python - qt - gtk ; + } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + inherit qt; + } // lib.optionalAttrs (hasFeature "gnuradio-companion" features) { + inherit gtk; }; # Wrapping is done with an external wrapper dontWrapPythonPrograms = true; From b944ca935012fb48c7f801fcc5edd745ad1639da Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 15 Dec 2020 11:56:54 +0200 Subject: [PATCH 05/11] gnss-sdr: Refactor to use gnuradio.pkgs.mkDerivation Use the same dependencies that gnuradio uses, thanks to gnuradio's `mkDerivation`. Add `gnuradio.pkgs.osmosdr` as dependency. --- pkgs/applications/radio/gnss-sdr/default.nix | 30 ++++++++++++-------- pkgs/top-level/all-packages.nix | 5 +--- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/radio/gnss-sdr/default.nix b/pkgs/applications/radio/gnss-sdr/default.nix index f48a21db75e..13636cf4415 100644 --- a/pkgs/applications/radio/gnss-sdr/default.nix +++ b/pkgs/applications/radio/gnss-sdr/default.nix @@ -1,15 +1,16 @@ -{ lib, stdenv, fetchFromGitHub +{ lib +, fetchFromGitHub , armadillo -, boost , cmake +, gmp , glog , gmock , openssl , gflags , gnuradio +, libpcap , orc , pkg-config -, pythonPackages , uhd , log4cpp , blas, lapack @@ -18,7 +19,7 @@ , protobuf }: -stdenv.mkDerivation rec { +gnuradio.pkgs.mkDerivation rec { pname = "gnss-sdr"; version = "0.0.13"; @@ -29,27 +30,32 @@ stdenv.mkDerivation rec { sha256 = "0a3k47fl5dizzhbqbrbmckl636lznyjby2d2nz6fz21637hvrnby"; }; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [ + cmake + gnuradio.unwrapped.python + gnuradio.unwrapped.python.pkgs.Mako + gnuradio.unwrapped.python.pkgs.six + ]; + buildInputs = [ + gmp armadillo - boost.dev + gnuradio.unwrapped.boost glog gmock - openssl.dev + openssl gflags - gnuradio orc - pythonPackages.Mako - pythonPackages.six - # UHD support is optional, but gnuradio is built with it, so there's # nothing to be gained by leaving it out. - uhd + gnuradio.unwrapped.uhd log4cpp blas lapack matio pugixml protobuf + gnuradio.pkgs.osmosdr + libpcap ]; cmakeFlags = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a6fe9410cc..bee79ffc8d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22325,10 +22325,7 @@ in gksu = callPackage ../applications/misc/gksu { }; - gnss-sdr = callPackage ../applications/radio/gnss-sdr { - boost = boost166; - gnuradio = gnuradio3_7.unwrapped; - }; + gnss-sdr = callPackage ../applications/radio/gnss-sdr { }; gnuradio = callPackage ../applications/radio/gnuradio/wrapper.nix { unwrapped = callPackage ../applications/radio/gnuradio { From fea0ac887eaa649dfc0d45cf58cb37d767f5071e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 10 Dec 2020 22:49:07 +0200 Subject: [PATCH 06/11] qradiolink: 0.5.0 -> 0.8.5-2 Use gnuradio.pkgs.mkDerivation (gnuradio 3.8) and updated deps. --- pkgs/applications/radio/gnuradio/default.nix | 1 - .../applications/radio/qradiolink/default.nix | 48 ++++++++++++------- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index fc7890299c5..4ba1782bfab 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -222,7 +222,6 @@ let buildInputs disallowedReferences stripDebugList - passthru doCheck dontWrapPythonPrograms dontWrapQtApps diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 1688d0010fe..db459eb3bb3 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -1,57 +1,71 @@ { lib -, mkDerivation , fetchFromGitHub , libpulseaudio , libconfig +# Needs a gnuradio built with qt gui support , gnuradio -, gnuradioPackages +# Not gnuradioPackages' +, codec2 +, log4cpp +, gmp , gsm , libopus , libjpeg +, libsndfile +, libftdi , protobuf , speex -, qmake4Hook -} : +, speexdsp +}: -let - version = "0.5.0"; - -in mkDerivation { +gnuradio.pkgs.mkDerivation rec { pname = "qradiolink"; - inherit version; + version = "0.8.5-2"; src = fetchFromGitHub { - owner = "kantooon"; + owner = "qradiolink"; repo = "qradiolink"; rev = version; - sha256 = "0xhg5zhjznmls5m3rhpk1qx0dipxmca12s85w15d0i7qwva2f1gi"; + sha256 = "MgHfKR3AJW3pIN9oCBr4BWxk1fGSCpLmMzjxvuTmuFA="; }; preBuild = '' - cd ext + cd src/ext protoc --cpp_out=. Mumble.proto protoc --cpp_out=. QRadioLink.proto - cd .. + cd ../.. qmake ''; installPhase = '' - mkdir -p $out/bin - cp qradiolink $out/bin + install -D qradiolink $out/bin/qradiolink + install -Dm644 src/res/icon.png $out/share/pixmaps/qradiolink.png + install -Dm644 qradiolink.desktop $out/share/applications/qradiolink.desktop ''; buildInputs = [ + gnuradio.unwrapped.boost + codec2 + log4cpp + gmp libpulseaudio libconfig gsm - gnuradioPackages.osmosdr + gnuradio.pkgs.osmosdr libopus libjpeg speex + speexdsp + gnuradio.qt.qtbase + gnuradio.qt.qtmultimedia + libftdi + libsndfile + gnuradio.qwt ]; nativeBuildInputs = [ protobuf - qmake4Hook + gnuradio.qt.qmake + gnuradio.qt.wrapQtAppsHook ]; enableParallelBuilding = true; From 99c3bdb9b610b8782abca17c36c7be51d28c9d30 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 15 Dec 2020 11:58:49 +0200 Subject: [PATCH 07/11] gqrx: Refactor to use gnuradioMinimal.pkgs.mkDerivation - Use gnuradio's `mkDerivation` which includes most of the deps needed. - Always enable pulseaudio support as that's part of gnuradio's deps anyway. - Use gnuradioMinimal.pkgs.osmosdr - not from the alias gr-osmosdr. --- pkgs/applications/radio/gqrx/default.nix | 36 ++++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index 217818f67c2..9514ce2e936 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -1,13 +1,23 @@ -{ lib, fetchFromGitHub, cmake, qtbase, qtsvg, gnuradio, boost, gr-osmosdr -, mkDerivation +{ lib +, fetchFromGitHub +, cmake +, pkg-config +, qt5 +, gnuradioMinimal +, log4cpp +, mpir +, fftwFloat +, alsaLib +, libjack2 # drivers (optional): -, rtl-sdr, hackrf +, rtl-sdr +, hackrf , pulseaudioSupport ? true, libpulseaudio }: assert pulseaudioSupport -> libpulseaudio != null; -mkDerivation rec { +gnuradioMinimal.pkgs.mkDerivation rec { pname = "gqrx"; version = "2.14.4"; @@ -18,9 +28,23 @@ mkDerivation rec { sha256 = "sha256-mMaxu0jq2GaNLWjLsJQXx+zCxtyiCAZQJJZ8GJtnllQ="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ + cmake + pkg-config + qt5.wrapQtAppsHook + ]; buildInputs = [ - qtbase qtsvg gnuradio boost gr-osmosdr rtl-sdr hackrf + log4cpp + mpir + fftwFloat + alsaLib + libjack2 + gnuradioMinimal.unwrapped.boost + qt5.qtbase + qt5.qtsvg + gnuradioMinimal.pkgs.osmosdr + rtl-sdr + hackrf ] ++ lib.optionals pulseaudioSupport [ libpulseaudio ]; postInstall = '' From 9545bbadfa9a67c5c9a28aed951e3fcadb955dc9 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 15 Dec 2020 12:24:56 +0200 Subject: [PATCH 08/11] inspectrum: Refactor to use gnuradioMinimal.pkgs.mkDerivation Use the same deps of gnuradioMinimal - thanks to gnuradio's mkDerivation. --- .../applications/radio/inspectrum/default.nix | 19 +++++++++---------- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/radio/inspectrum/default.nix b/pkgs/applications/radio/inspectrum/default.nix index 37131a686b5..3cc8c59cc02 100644 --- a/pkgs/applications/radio/inspectrum/default.nix +++ b/pkgs/applications/radio/inspectrum/default.nix @@ -1,17 +1,14 @@ { lib -, mkDerivation +, gnuradioMinimal , fetchFromGitHub , pkg-config , cmake -, boost , fftwFloat -, gnuradio +, qt5 , liquid-dsp -, qtbase -, wrapQtAppsHook }: -mkDerivation rec { +gnuradioMinimal.pkgs.mkDerivation rec { pname = "inspectrum"; version = "0.2.3"; @@ -22,13 +19,15 @@ mkDerivation rec { sha256 = "1x6nyn429pk0f7lqzskrgsbq09mq5787xd4piic95add6n1cc355"; }; - nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake + qt5.wrapQtAppsHook + pkg-config + ]; buildInputs = [ fftwFloat - boost - gnuradio liquid-dsp - qtbase + qt5.qtbase ]; meta = with lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bee79ffc8d0..c43d5a1d992 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23250,9 +23250,7 @@ in inkscape-extensions = recurseIntoAttrs (callPackages ../applications/graphics/inkscape/extensions.nix {}); - inspectrum = libsForQt514.callPackage ../applications/radio/inspectrum { - gnuradio = gnuradioMinimal; - }; + inspectrum = callPackage ../applications/radio/inspectrum { }; ion3 = callPackage ../applications/window-managers/ion-3 { lua = lua5_1; From 7df0fa108a76aeb892db5e0499aa9e57b61b6a2b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 15 Feb 2021 22:09:25 +0200 Subject: [PATCH 09/11] volk: init at 2.4.1 --- pkgs/development/libraries/volk/default.nix | 51 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/libraries/volk/default.nix diff --git a/pkgs/development/libraries/volk/default.nix b/pkgs/development/libraries/volk/default.nix new file mode 100644 index 00000000000..574a90d2272 --- /dev/null +++ b/pkgs/development/libraries/volk/default.nix @@ -0,0 +1,51 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchpatch +, cmake +, cppunit +, python3 +, enableModTool ? true +, removeReferencesTo +}: + +stdenv.mkDerivation rec { + pname = "volk"; + version = "2.4.1"; + + src = fetchFromGitHub { + owner = "gnuradio"; + repo = pname; + rev = "v${version}"; + sha256 = "fuHJ+p5VN4ThdbQFbzB08VCuy/Zo7m/I1Gs5EQGPeNY="; + fetchSubmodules = true; + }; + + patches = [ + # Fixes a failing test: https://github.com/gnuradio/volk/pull/434 + (fetchpatch { + url = "https://github.com/gnuradio/volk/pull/434/commits/bce8531b6f1a3c5abe946ed6674b283d54258281.patch"; + sha256 = "OLW9uF6iL47z63kjvYqwsWtkINav8Xhs+Htqg6Kr4uI="; + }) + ]; + cmakeFlags = lib.optionals (!enableModTool) [ "-DENABLE_MODTOOL=OFF" ]; + postInstall = '' + ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so) + ''; + + nativeBuildInputs = [ + cmake + python3 + python3.pkgs.Mako + ]; + + doCheck = true; + + meta = with lib; { + homepage = "http://libvolk.org/"; + description = "The Vector Optimized Library of Kernels"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ doronbehar ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c43d5a1d992..23bbaccd54d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3953,6 +3953,8 @@ in volctl = callPackage ../tools/audio/volctl { }; + volk = callPackage ../development/libraries/volk { }; + vorta = libsForQt5.callPackage ../applications/backup/vorta { }; utahfs = callPackage ../applications/networking/utahfs { }; From 650ee258fde069a1ac3544cdce89029e9f91d5c5 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 13 Mar 2021 13:50:15 +0200 Subject: [PATCH 10/11] gnuradio3_{7,8}: Use external volk Now that volk is packaged, we can use our build and save some closure space for those that have more then 1 version of gnuradio installed. Also, simplify a bit how attributes are inherited in the expression. --- pkgs/applications/radio/gnuradio/3.7.nix | 49 ++++++------------- pkgs/applications/radio/gnuradio/default.nix | 44 ++++------------- pkgs/applications/radio/gnuradio/shared.nix | 3 -- .../gnuradio-modules/mkDerivation.nix | 6 ++- pkgs/top-level/all-packages.nix | 7 +++ pkgs/top-level/gnuradio-packages.nix | 3 +- 6 files changed, 38 insertions(+), 74 deletions(-) diff --git a/pkgs/applications/radio/gnuradio/3.7.nix b/pkgs/applications/radio/gnuradio/3.7.nix index 7ad2d297982..50993dd6f8e 100644 --- a/pkgs/applications/radio/gnuradio/3.7.nix +++ b/pkgs/applications/radio/gnuradio/3.7.nix @@ -5,6 +5,7 @@ # Remove gcc and python references , removeReferencesTo , pkg-config +, volk , cppunit , swig , orc @@ -43,11 +44,12 @@ minor = "14"; patch = "0"; } -, fetchSubmodules ? true +# We use our build of volk and not the one bundled with the release +, fetchSubmodules ? false }: let - sourceSha256 = "1nh4f9dmygprlbqybd3j1byg9fsr6065n140mvc4b0v8qqygmhrc"; + sourceSha256 = "BiUDibXV/5cEYmAAaIxT4WTxF/ni4MJumF5oJ/vuOyc="; featuresInfo = { # Needed always basic = { @@ -61,6 +63,9 @@ let }; volk = { cmakeEnableFlag = "VOLK"; + runtime = [ + volk + ]; }; doxygen = { native = [ doxygen ]; @@ -213,10 +218,14 @@ let qt = qt4; gtk = gtk2; }); + inherit (shared) hasFeature; # function +in + +stdenv.mkDerivation rec { + inherit pname; inherit (shared) version src - hasFeature # function nativeBuildInputs buildInputs disallowedReferences @@ -228,7 +237,7 @@ let passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must - inherit boost; + inherit boost volk; } // lib.optionalAttrs (hasFeature "gr-uhd" features) { inherit uhd; }; @@ -242,6 +251,9 @@ let "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" "-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm" ] + ++ lib.optionals (hasFeature "volk" features && volk != null) [ + "-DENABLE_INTERNAL_VOLK=OFF" + ] ; stripDebugList = shared.stripDebugList # gr-fcd feature was dropped in 3.8 @@ -256,15 +268,6 @@ let + lib.optionalString (hasFeature "gnuradio-companion" features) '' sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt '' - # If python-support is disabled, don't install volk's (git submodule) - # volk_modtool - it references python. - # - # NOTE: The same is done for 3.8, but we don't put this string in - # ./shared.nix since on the next release of 3.8 it won't be needed there, - # but it will be needed for 3.7, probably for ever. - + lib.optionalString (!hasFeature "python-support" features) '' - sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt - '' ; patches = [ # Don't install python referencing files if python support is disabled. @@ -278,24 +281,4 @@ let sha256 = "2Pitgu8accs16B5X5+/q51hr+IY9DMsA15f56gAtBs8="; }) ]; -in - -stdenv.mkDerivation rec { - inherit - pname - version - src - nativeBuildInputs - buildInputs - cmakeFlags - preConfigure - # disallowedReferences - stripDebugList - patches - postInstall - passthru - doCheck - dontWrapPythonPrograms - meta - ; } diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 4ba1782bfab..304fccf91d0 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -214,6 +214,11 @@ let qt = qt5; gtk = gtk3; }); + inherit (shared) hasFeature; # function +in + +stdenv.mkDerivation rec { + inherit pname; inherit (shared) version src @@ -229,7 +234,7 @@ let ; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must - inherit boost; + inherit boost volk; } // lib.optionalAttrs (hasFeature "gr-uhd" features) { inherit uhd; } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { @@ -246,6 +251,9 @@ let "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" ] + ++ lib.optionals (hasFeature "volk" features && volk != null) [ + "-DENABLE_INTERNAL_VOLK=OFF" + ] ; postInstall = shared.postInstall @@ -255,19 +263,6 @@ let ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake '' ; - preConfigure = "" - # If python-support is disabled, don't install volk's (git submodule) - # volk_modtool - it references python. - # - # NOTE: on the next release, volk will always be required to be installed - # externally (submodule removed upstream). Hence this hook will fail and - # we'll need to package volk while able to tell it to install or not - # install python referencing files. When we'll be there, this will help: - # https://github.com/gnuradio/volk/pull/404 - + lib.optionalString (!hasFeature "python-support" features) '' - sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt - '' - ; patches = [ # Don't install python referencing files if python support is disabled. # See: https://github.com/gnuradio/gnuradio/pull/3839 @@ -287,25 +282,4 @@ let sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; }) ]; -in - -stdenv.mkDerivation rec { - inherit - pname - version - src - nativeBuildInputs - buildInputs - cmakeFlags - preConfigure - # disallowedReferences - stripDebugList - patches - postInstall - passthru - doCheck - dontWrapPythonPrograms - dontWrapQtApps - meta - ; } diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index 271819e6072..f8ea2f0b160 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -85,9 +85,6 @@ rec { ; postInstall = "" # Gcc references - + lib.optionalString (hasFeature "volk" features) '' - ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so) - '' + lib.optionalString (hasFeature "gnuradio-runtime" features) '' ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so) '' diff --git a/pkgs/development/gnuradio-modules/mkDerivation.nix b/pkgs/development/gnuradio-modules/mkDerivation.nix index 235eff25cdb..014968f82cc 100644 --- a/pkgs/development/gnuradio-modules/mkDerivation.nix +++ b/pkgs/development/gnuradio-modules/mkDerivation.nix @@ -17,7 +17,9 @@ let args_ = { enableParallelBuilding = args.enableParallelBuilding or true; nativeBuildInputs = (args.nativeBuildInputs or []); - # We add gnuradio itself by default - buildInputs = (args.buildInputs or []) ++ [ unwrapped ]; + # We add gnuradio and volk itself by default - most gnuradio based packages + # will not consider it a depenency worth mentioning and it will almost + # always be needed + buildInputs = (args.buildInputs or []) ++ [ unwrapped unwrapped.volk ]; }; in mkDerivation (args // args_) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23bbaccd54d..fd680c47af1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22342,6 +22342,10 @@ in gnuradioMinimal = gnuradio.override { wrap = false; unwrapped = gnuradio.unwrapped.override { + volk = volk.override { + # So it will not reference python + enableModTool = false; + }; features = { gnuradio-companion = false; python-support = false; @@ -22368,6 +22372,9 @@ in gnuradio3_7Minimal = gnuradio3_7.override { wrap = false; unwrapped = gnuradio3_7.unwrapped.override { + volk = volk.override { + enableModTool = false; + }; features = { gnuradio-companion = false; python-support = false; diff --git a/pkgs/top-level/gnuradio-packages.nix b/pkgs/top-level/gnuradio-packages.nix index 6c8db76cb3e..e5c2c8be313 100644 --- a/pkgs/top-level/gnuradio-packages.nix +++ b/pkgs/top-level/gnuradio-packages.nix @@ -16,9 +16,10 @@ let callPackage = self.newScope { inherit (gnuradio) - # Packages that are potentially overriden and commonly + # Packages that are potentially overriden and used as deps here. boost uhd + volk ; inherit mkDerivationWith mkDerivation; }; From fb024f50e5557e42b4bb8249d0298c244ff8082d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 15 Feb 2021 22:14:54 +0200 Subject: [PATCH 11/11] gnuradio: 3.8 -> 3.9 Add some "3.9" attributes to srcs in gnuradio packages And update packages using GR3.8 and that are incompatible yet with GR3.9 to use GR3.8 explicitly. --- pkgs/applications/radio/gnss-sdr/default.nix | 16 +- pkgs/applications/radio/gnuradio/3.8.nix | 284 ++++++++++++++++++ pkgs/applications/radio/gnuradio/default.nix | 104 +++---- pkgs/applications/radio/gqrx/default.nix | 8 +- .../applications/radio/inspectrum/default.nix | 4 +- .../applications/radio/qradiolink/default.nix | 18 +- .../gnuradio-modules/limesdr/default.nix | 2 + .../gnuradio-modules/osmosdr/default.nix | 2 + .../gnuradio-modules/rds/default.nix | 2 + pkgs/top-level/all-packages.nix | 29 ++ 10 files changed, 384 insertions(+), 85 deletions(-) create mode 100644 pkgs/applications/radio/gnuradio/3.8.nix diff --git a/pkgs/applications/radio/gnss-sdr/default.nix b/pkgs/applications/radio/gnss-sdr/default.nix index 13636cf4415..46757601867 100644 --- a/pkgs/applications/radio/gnss-sdr/default.nix +++ b/pkgs/applications/radio/gnss-sdr/default.nix @@ -7,7 +7,7 @@ , gmock , openssl , gflags -, gnuradio +, gnuradio3_8 , libpcap , orc , pkg-config @@ -19,7 +19,7 @@ , protobuf }: -gnuradio.pkgs.mkDerivation rec { +gnuradio3_8.pkgs.mkDerivation rec { pname = "gnss-sdr"; version = "0.0.13"; @@ -32,15 +32,15 @@ gnuradio.pkgs.mkDerivation rec { nativeBuildInputs = [ cmake - gnuradio.unwrapped.python - gnuradio.unwrapped.python.pkgs.Mako - gnuradio.unwrapped.python.pkgs.six + gnuradio3_8.unwrapped.python + gnuradio3_8.unwrapped.python.pkgs.Mako + gnuradio3_8.unwrapped.python.pkgs.six ]; buildInputs = [ gmp armadillo - gnuradio.unwrapped.boost + gnuradio3_8.unwrapped.boost glog gmock openssl @@ -48,13 +48,13 @@ gnuradio.pkgs.mkDerivation rec { orc # UHD support is optional, but gnuradio is built with it, so there's # nothing to be gained by leaving it out. - gnuradio.unwrapped.uhd + gnuradio3_8.unwrapped.uhd log4cpp blas lapack matio pugixml protobuf - gnuradio.pkgs.osmosdr + gnuradio3_8.pkgs.osmosdr libpcap ]; diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix new file mode 100644 index 00000000000..799b429800d --- /dev/null +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -0,0 +1,284 @@ +{ lib, stdenv +, fetchFromGitHub +, fetchpatch +, cmake +# Remove gcc and python references +, removeReferencesTo +, pkg-config +, volk +, cppunit +, swig +, orc +, boost +, log4cpp +, mpir +, doxygen +, python +, codec2 +, gsm +, fftwFloat +, alsaLib +, libjack2 +, CoreAudio +, uhd +, SDL +, gsl +, cppzmq +, zeromq +# 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" +, versionAttr ? { + major = "3.8"; + minor = "2"; + patch = "0"; +} +# We use our build of volk and not the one bundled with the release +, fetchSubmodules ? false +}: + +let + sourceSha256 = "SFDjtyQRp0fXijZukpLYtISpx8imxedlYN9mRibv1eA="; + featuresInfo = { + # Needed always + basic = { + native = [ + cmake + pkg-config + orc + ]; + runtime = [ + 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" features)) [ icu ]; + pythonNative = with python.pkgs; [ + Mako + six + ]; + }; + volk = { + cmakeEnableFlag = "VOLK"; + runtime = [ + volk + ]; + }; + doxygen = { + native = [ doxygen ]; + cmakeEnableFlag = "DOXYGEN"; + }; + sphinx = { + pythonNative = with python.pkgs; [ sphinx ]; + cmakeEnableFlag = "SPHINX"; + }; + python-support = { + pythonRuntime = [ python.pkgs.six ]; + native = [ + swig + python + ]; + cmakeEnableFlag = "PYTHON"; + }; + testing-support = { + native = [ cppunit ]; + cmakeEnableFlag = "TESTING"; + }; + gnuradio-runtime = { + 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 + ]; + }; + gnuradio-companion = { + pythonRuntime = with python.pkgs; [ + pyyaml + Mako + numpy + pygobject3 + ]; + runtime = [ + gtk3 + pango + gobject-introspection + cairo + ]; + cmakeEnableFlag = "GRC"; + }; + gr-blocks = { + cmakeEnableFlag = "GR_BLOCKS"; + }; + gr-fec = { + cmakeEnableFlag = "GR_FEC"; + }; + gr-fft = { + runtime = [ fftwFloat ]; + cmakeEnableFlag = "GR_FFT"; + }; + gr-filter = { + runtime = [ fftwFloat ]; + cmakeEnableFlag = "GR_FILTER"; + }; + gr-analog = { + cmakeEnableFlag = "GR_ANALOG"; + }; + gr-digital = { + cmakeEnableFlag = "GR_DIGITAL"; + }; + gr-dtv = { + cmakeEnableFlag = "GR_DTV"; + }; + gr-audio = { + runtime = [] + ++ lib.optionals stdenv.isLinux [ alsaLib 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-utils = { + cmakeEnableFlag = "GR_UTILS"; + }; + gr-modtool = { + pythonRuntime = with python.pkgs; [ + click + click-plugins + ]; + cmakeEnableFlag = "GR_MODTOOL"; + }; + gr-video-sdl = { + runtime = [ SDL ]; + cmakeEnableFlag = "GR_VIDEO_SDL"; + }; + gr-vocoder = { + runtime = [ codec2 gsm ]; + cmakeEnableFlag = "GR_VOCODER"; + }; + gr-wavelet = { + cmakeEnableFlag = "GR_WAVELET"; + runtime = [ gsl ]; + }; + gr-zeromq = { + runtime = [ cppzmq zeromq ]; + cmakeEnableFlag = "GR_ZEROMQ"; + }; + }; + shared = (import ./shared.nix { + inherit + stdenv + lib + python + removeReferencesTo + featuresInfo + features + versionAttr + sourceSha256 + overrideSrc + fetchFromGitHub + fetchSubmodules + ; + qt = qt5; + gtk = gtk3; + }); + inherit (shared) hasFeature; # function +in + +stdenv.mkDerivation rec { + inherit pname; + inherit (shared) + version + src + nativeBuildInputs + buildInputs + disallowedReferences + stripDebugList + doCheck + dontWrapPythonPrograms + dontWrapQtApps + meta + ; + 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) { + inherit uhd; + } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { + inherit (libsForQt5) qwt; + }; + cmakeFlags = shared.cmakeFlags + # From some reason, if these are not set, libcodec2 and gsm are not + # detected properly. 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) [ + "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so" + "-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include" + "-DLIBCODEC2_HAS_FREEDV_API=ON" + "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" + "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" + ] + ++ lib.optionals (hasFeature "volk" features && volk != null) [ + "-DENABLE_INTERNAL_VOLK=OFF" + ] + ; + + 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) '' + ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake + '' + ; + patches = [ + # Don't install python referencing files if python support is disabled. + # See: https://github.com/gnuradio/gnuradio/pull/3839 + (fetchpatch { + url = "https://github.com/gnuradio/gnuradio/commit/4a4fd570b398b0b50fe875fcf0eb9c9db2ea5c6e.diff"; + sha256 = "xz2E0ji6zfdOAhjfPecAcaVOIls1XP8JngLkBbBBW5Q="; + }) + (fetchpatch { + url = "https://github.com/gnuradio/gnuradio/commit/dbc8ad7e7361fddc7b1dbc267c07a776a3f9664b.diff"; + sha256 = "tQcCpcUbJv3yqAX8rSHN/pAuBq4ueEvoVo7sNzZGvf4="; + }) + # Needed to use boost 1.7x, see: + # https://github.com/gnuradio/gnuradio/issues/3720 + # https://github.com/gnuradio/gnuradio/pull/3967 + (fetchpatch { + url = "https://github.com/gnuradio/gnuradio/commit/cbcb968358fad56f3646619b258f18b0e6693a07.diff"; + sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; + }) + ]; +} diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 304fccf91d0..bcb2560144a 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -5,8 +5,8 @@ # Remove gcc and python references , removeReferencesTo , pkg-config +, volk , cppunit -, swig , orc , boost , log4cpp @@ -22,6 +22,9 @@ , uhd , SDL , gsl +, libsodium +, libsndfile +, libunwind , cppzmq , zeromq # Needed only if qt-gui is disabled, from some reason @@ -40,16 +43,15 @@ , overrideSrc ? {} , pname ? "gnuradio" , versionAttr ? { - major = "3.8"; - minor = "2"; + major = "3.9"; + minor = "0"; patch = "0"; } -# Should be false on the release after 3.8.2.0 -, fetchSubmodules ? true +, fetchSubmodules ? false }: let - sourceSha256 = "1mnfwdy7w3160vi6110x2qkyq8l78qi8771zwak9n72bl7lhhpnf"; + sourceSha256 = "ZjQzioAuWrd8jsYOnLNH1mK4n9EbrjgvPX3mTzVFdLk="; featuresInfo = { # Needed always basic = { @@ -59,6 +61,7 @@ let orc ]; runtime = [ + volk boost log4cpp mpir @@ -71,23 +74,13 @@ let six ]; }; - # NOTE: Should be removed on the release after 3.8.2.0, see: - # https://github.com/gnuradio/gnuradio/commit/80c04479d - volk = { - cmakeEnableFlag = "VOLK"; - }; doxygen = { native = [ doxygen ]; cmakeEnableFlag = "DOXYGEN"; }; - sphinx = { - pythonNative = with python.pkgs; [ sphinx ]; - cmakeEnableFlag = "SPHINX"; - }; python-support = { pythonRuntime = [ python.pkgs.six ]; native = [ - swig python ]; cmakeEnableFlag = "PYTHON"; @@ -96,17 +89,23 @@ let native = [ cppunit ]; cmakeEnableFlag = "TESTING"; }; + post-install = { + cmakeEnableFlag = "POSTINSTALL"; + }; gnuradio-runtime = { cmakeEnableFlag = "GNURADIO_RUNTIME"; + pythonRuntime = [ + python.pkgs.pybind11 + ]; }; 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 + # https://github.com/gnuradio/gnuradio/blob/v3.9.0.0/gnuradio-runtime/lib/controlport/thrift/README + runtime = [ + libunwind ]; + cmakeEnableFlag = "GR_CTRLPORT"; }; gnuradio-companion = { pythonRuntime = with python.pkgs; [ @@ -115,11 +114,15 @@ let numpy pygobject3 ]; + native = [ + python.pkgs.pytest + ]; runtime = [ gtk3 pango gobject-introspection cairo + libsndfile ]; cmakeEnableFlag = "GRC"; }; @@ -180,22 +183,29 @@ let ]; 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"; - }; + # codec2 and gsm support is broken with gr3.9: https://github.com/gnuradio/gnuradio/issues/4278 + # gr-vocoder = { + # runtime = [ codec2 gsm ]; + # cmakeEnableFlag = "GR_VOCODER"; + # }; gr-wavelet = { cmakeEnableFlag = "GR_WAVELET"; - runtime = [ gsl ]; + runtime = [ gsl libsodium ]; }; gr-zeromq = { runtime = [ cppzmq zeromq ]; cmakeEnableFlag = "GR_ZEROMQ"; }; + gr-network = { + cmakeEnableFlag = "GR_NETWORK"; + }; }; shared = (import ./shared.nix { inherit @@ -222,9 +232,9 @@ stdenv.mkDerivation rec { inherit (shared) version src - hasFeature # function nativeBuildInputs buildInputs + cmakeFlags disallowedReferences stripDebugList doCheck @@ -240,46 +250,16 @@ stdenv.mkDerivation rec { } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { inherit (libsForQt5) qwt; }; - cmakeFlags = shared.cmakeFlags - # From some reason, if these are not set, libcodec2 and gsm are not - # detected properly. 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) [ - "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so" - "-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include" - "-DLIBCODEC2_HAS_FREEDV_API=ON" - "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" - "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" - ] - ++ lib.optionals (hasFeature "volk" features && volk != null) [ - "-DENABLE_INTERNAL_VOLK=OFF" - ] - ; postInstall = shared.postInstall - # This is the only python reference worth removing, if needed (3.7 doesn't - # set that reference). + # This is the only python reference worth removing, if needed. + # Even if python support is enabled, and we don't care about this + # reference, pybind's path is not properly set. See: + # https://github.com/gnuradio/gnuradio/issues/4380 + lib.optionalString (!hasFeature "python-support" features) '' ${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 '' ; - patches = [ - # Don't install python referencing files if python support is disabled. - # See: https://github.com/gnuradio/gnuradio/pull/3839 - (fetchpatch { - url = "https://github.com/gnuradio/gnuradio/commit/4a4fd570b398b0b50fe875fcf0eb9c9db2ea5c6e.diff"; - sha256 = "xz2E0ji6zfdOAhjfPecAcaVOIls1XP8JngLkBbBBW5Q="; - }) - (fetchpatch { - url = "https://github.com/gnuradio/gnuradio/commit/dbc8ad7e7361fddc7b1dbc267c07a776a3f9664b.diff"; - sha256 = "tQcCpcUbJv3yqAX8rSHN/pAuBq4ueEvoVo7sNzZGvf4="; - }) - # Needed to use boost 1.7x, see: - # https://github.com/gnuradio/gnuradio/issues/3720 - # https://github.com/gnuradio/gnuradio/pull/3967 - (fetchpatch { - url = "https://github.com/gnuradio/gnuradio/commit/cbcb968358fad56f3646619b258f18b0e6693a07.diff"; - sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; - }) - ]; } diff --git a/pkgs/applications/radio/gqrx/default.nix b/pkgs/applications/radio/gqrx/default.nix index 9514ce2e936..cccdff1f3cc 100644 --- a/pkgs/applications/radio/gqrx/default.nix +++ b/pkgs/applications/radio/gqrx/default.nix @@ -3,7 +3,7 @@ , cmake , pkg-config , qt5 -, gnuradioMinimal +, gnuradio3_8Minimal , log4cpp , mpir , fftwFloat @@ -17,7 +17,7 @@ assert pulseaudioSupport -> libpulseaudio != null; -gnuradioMinimal.pkgs.mkDerivation rec { +gnuradio3_8Minimal.pkgs.mkDerivation rec { pname = "gqrx"; version = "2.14.4"; @@ -39,10 +39,10 @@ gnuradioMinimal.pkgs.mkDerivation rec { fftwFloat alsaLib libjack2 - gnuradioMinimal.unwrapped.boost + gnuradio3_8Minimal.unwrapped.boost qt5.qtbase qt5.qtsvg - gnuradioMinimal.pkgs.osmosdr + gnuradio3_8Minimal.pkgs.osmosdr rtl-sdr hackrf ] ++ lib.optionals pulseaudioSupport [ libpulseaudio ]; diff --git a/pkgs/applications/radio/inspectrum/default.nix b/pkgs/applications/radio/inspectrum/default.nix index 3cc8c59cc02..9d61ab4b601 100644 --- a/pkgs/applications/radio/inspectrum/default.nix +++ b/pkgs/applications/radio/inspectrum/default.nix @@ -1,5 +1,5 @@ { lib -, gnuradioMinimal +, gnuradio3_8Minimal , fetchFromGitHub , pkg-config , cmake @@ -8,7 +8,7 @@ , liquid-dsp }: -gnuradioMinimal.pkgs.mkDerivation rec { +gnuradio3_8Minimal.pkgs.mkDerivation rec { pname = "inspectrum"; version = "0.2.3"; diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index db459eb3bb3..2dbd9f1aba9 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -3,7 +3,7 @@ , libpulseaudio , libconfig # Needs a gnuradio built with qt gui support -, gnuradio +, gnuradio3_8 # Not gnuradioPackages' , codec2 , log4cpp @@ -18,7 +18,7 @@ , speexdsp }: -gnuradio.pkgs.mkDerivation rec { +gnuradio3_8.pkgs.mkDerivation rec { pname = "qradiolink"; version = "0.8.5-2"; @@ -44,28 +44,28 @@ gnuradio.pkgs.mkDerivation rec { ''; buildInputs = [ - gnuradio.unwrapped.boost + gnuradio3_8.unwrapped.boost codec2 log4cpp gmp libpulseaudio libconfig gsm - gnuradio.pkgs.osmosdr + gnuradio3_8.pkgs.osmosdr libopus libjpeg speex speexdsp - gnuradio.qt.qtbase - gnuradio.qt.qtmultimedia + gnuradio3_8.qt.qtbase + gnuradio3_8.qt.qtmultimedia libftdi libsndfile - gnuradio.qwt + gnuradio3_8.qwt ]; nativeBuildInputs = [ protobuf - gnuradio.qt.qmake - gnuradio.qt.wrapQtAppsHook + gnuradio3_8.qt.qmake + gnuradio3_8.qt.wrapQtAppsHook ]; enableParallelBuilding = true; diff --git a/pkgs/development/gnuradio-modules/limesdr/default.nix b/pkgs/development/gnuradio-modules/limesdr/default.nix index 63136b33d65..c10ab9df391 100644 --- a/pkgs/development/gnuradio-modules/limesdr/default.nix +++ b/pkgs/development/gnuradio-modules/limesdr/default.nix @@ -19,6 +19,7 @@ let version = { "3.7" = "2.0.0"; "3.8" = "3.0.1"; + "3.9" = null; }.${gnuradio.versionAttr.major}; src = fetchFromGitHub { owner = "myriadrf"; @@ -27,6 +28,7 @@ let sha256 = { "3.7" = "0ldqvfwl0gil89l9s31fjf9d7ki0dk572i8vna336igfaz348ypq"; "3.8" = "ffs+8TU0yr6IW1xZJ/abQ1CQWGZM+zYqPRJxy3ZvM9U="; + "3.9" = null; }.${gnuradio.versionAttr.major}; }; in mkDerivation { diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix index 4159862bbed..0e1cf244c8f 100644 --- a/pkgs/development/gnuradio-modules/osmosdr/default.nix +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -24,6 +24,7 @@ let version = { "3.7" = "0.1.5"; "3.8" = "0.2.2"; + "3.9" = null; }.${gnuradio.versionAttr.major}; src = fetchgit { url = "git://git.osmocom.org/gr-osmosdr"; @@ -31,6 +32,7 @@ let sha256 = { "3.7" = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv"; "3.8" = "HT6xlN6cJAnvF+s1g2I1uENhBJJizdADlLXeSD0rEqs="; + "3.9" = null; }.${gnuradio.versionAttr.major}; }; in mkDerivation { diff --git a/pkgs/development/gnuradio-modules/rds/default.nix b/pkgs/development/gnuradio-modules/rds/default.nix index a2062783bd7..c068d6af810 100644 --- a/pkgs/development/gnuradio-modules/rds/default.nix +++ b/pkgs/development/gnuradio-modules/rds/default.nix @@ -17,6 +17,7 @@ let version = { "3.7" = "1.1.0"; "3.8" = "3.8.0"; + "3.9" = null; }.${gnuradio.versionAttr.major}; src = fetchFromGitHub { owner = "bastibl"; @@ -25,6 +26,7 @@ let sha256 = { "3.7" = "0jkzchvw0ivcxsjhi1h0mf7k13araxf5m4wi5v9xdgqxvipjzqfy"; "3.8" = "+yKLJu2bo7I2jkAiOdjvdhZwxFz9NFgTmzcLthH9Y5o="; + "3.9" = null; }.${gnuradio.versionAttr.major}; }; in mkDerivation { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fd680c47af1..d9cdd3b0a59 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22346,6 +22346,35 @@ in # So it will not reference python enableModTool = false; }; + features = { + gnuradio-companion = false; + python-support = false; + examples = false; + gr-qtgui = false; + gr-utils = false; + gr-modtool = false; + gr-blocktool = false; + sphinx = false; + doxygen = false; + }; + }; + }; + gnuradio3_8 = callPackage ../applications/radio/gnuradio/wrapper.nix { + unwrapped = callPackage ../applications/radio/gnuradio/3.8.nix { + inherit (darwin.apple_sdk.frameworks) CoreAudio; + python = python3; + boost = boost17x; + }; + }; + gnuradio3_8Packages = lib.recurseIntoAttrs gnuradio3_8.pkgs; + # A build without gui components and other utilites not needed if gnuradio is + # used as a c++ library. + gnuradio3_8Minimal = gnuradio3_8.override { + wrap = false; + unwrapped = gnuradio3_8.unwrapped.override { + volk = volk.override { + enableModTool = false; + }; features = { gnuradio-companion = false; python-support = false;