summary refs log tree commit diff
path: root/pkgs/applications/radio/gnuradio
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/radio/gnuradio')
-rw-r--r--pkgs/applications/radio/gnuradio/3.7.nix17
-rw-r--r--pkgs/applications/radio/gnuradio/ais.nix2
-rw-r--r--pkgs/applications/radio/gnuradio/default.nix13
-rw-r--r--pkgs/applications/radio/gnuradio/gsm.nix2
-rw-r--r--pkgs/applications/radio/gnuradio/limesdr.nix4
-rw-r--r--pkgs/applications/radio/gnuradio/nacl.nix2
-rw-r--r--pkgs/applications/radio/gnuradio/osmosdr.nix4
-rw-r--r--pkgs/applications/radio/gnuradio/rds.nix2
-rw-r--r--pkgs/applications/radio/gnuradio/shared.nix6
-rw-r--r--pkgs/applications/radio/gnuradio/wrapper.nix29
10 files changed, 41 insertions, 40 deletions
diff --git a/pkgs/applications/radio/gnuradio/3.7.nix b/pkgs/applications/radio/gnuradio/3.7.nix
index 54fb0d7d66c..76cfa5f414b 100644
--- a/pkgs/applications/radio/gnuradio/3.7.nix
+++ b/pkgs/applications/radio/gnuradio/3.7.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -138,8 +138,8 @@ let
     };
     gr-audio = {
       runtime = []
-        ++ stdenv.lib.optionals stdenv.isLinux [ alsaLib libjack2 ]
-        ++ stdenv.lib.optionals stdenv.isDarwin [ CoreAudio ]
+        ++ lib.optionals stdenv.isLinux [ alsaLib libjack2 ]
+        ++ lib.optionals stdenv.isDarwin [ CoreAudio ]
       ;
       cmakeEnableFlag = "GR_AUDIO";
     };
@@ -198,6 +198,7 @@ let
   };
   shared = (import ./shared.nix {
     inherit
+      lib
       stdenv
       python
       removeReferencesTo
@@ -229,7 +230,7 @@ let
     # From some reason, if these are not set, libcodec2 and gsm are
     # not detected properly (slightly different then what's in
     # ./default.nix).
-    ++ stdenv.lib.optionals (hasFeature "gr-vocoder" features) [
+    ++ lib.optionals (hasFeature "gr-vocoder" features) [
       "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
       "-DLIBCODEC2_INCLUDE_DIR=${codec2}/include"
       "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
@@ -238,16 +239,16 @@ let
   ;
   stripDebugList = shared.stripDebugList
     # gr-fcd feature was dropped in 3.8
-    ++ stdenv.lib.optionals (hasFeature "gr-fcd" features) [ "share/gnuradio/examples/fcd" ]
+    ++ lib.optionals (hasFeature "gr-fcd" features) [ "share/gnuradio/examples/fcd" ]
   ;
   preConfigure = ''
   ''
     # wxgui and pygtk are not looked up properly, so we force them to be
     # detected as found, if they are requested by the `features` attrset.
-    + stdenv.lib.optionalString (hasFeature "gr-wxgui" features) ''
+    + lib.optionalString (hasFeature "gr-wxgui" features) ''
       sed -i 's/.*wx\.version.*/set(WX_FOUND TRUE)/g' gr-wxgui/CMakeLists.txt
     ''
-    + stdenv.lib.optionalString (hasFeature "gnuradio-companion" features) ''
+    + 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)
@@ -256,7 +257,7 @@ let
     # 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.
-    + stdenv.lib.optionalString (!hasFeature "python-support" features) ''
+    + lib.optionalString (!hasFeature "python-support" features) ''
       sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt
     ''
   ;
diff --git a/pkgs/applications/radio/gnuradio/ais.nix b/pkgs/applications/radio/gnuradio/ais.nix
index 9c993de65d0..94556561439 100644
--- a/pkgs/applications/radio/gnuradio/ais.nix
+++ b/pkgs/applications/radio/gnuradio/ais.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake makeWrapper pkg-config ];
   buildInputs = [ boost gnuradio cppunit gr-osmosdr log4cpp ]
-             ++ stdenv.lib.optionals pythonSupport [ python swig ];
+             ++ lib.optionals pythonSupport [ python swig ];
 
   postInstall = ''
     for prog in "$out"/bin/*; do
diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix
index 811eb37f4f3..0bc8675690f 100644
--- a/pkgs/applications/radio/gnuradio/default.nix
+++ b/pkgs/applications/radio/gnuradio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -143,8 +143,8 @@ let
     };
     gr-audio = {
       runtime = []
-        ++ stdenv.lib.optionals stdenv.isLinux [ alsaLib libjack2 ]
-        ++ stdenv.lib.optionals stdenv.isDarwin [ CoreAudio ]
+        ++ lib.optionals stdenv.isLinux [ alsaLib libjack2 ]
+        ++ lib.optionals stdenv.isDarwin [ CoreAudio ]
       ;
       cmakeEnableFlag = "GR_AUDIO";
     };
@@ -193,6 +193,7 @@ let
   shared = (import ./shared.nix {
     inherit
       stdenv
+      lib
       python
       removeReferencesTo
       featuresInfo
@@ -223,7 +224,7 @@ let
     # 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
-    ++ stdenv.lib.optionals (hasFeature "gr-vocoder" features) [
+    ++ lib.optionals (hasFeature "gr-vocoder" features) [
       "-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
       "-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include"
       "-DLIBCODEC2_HAS_FREEDV_API=ON"
@@ -235,7 +236,7 @@ let
   postInstall = shared.postInstall
     # This is the only python reference worth removing, if needed (3.7 doesn't
     # set that reference).
-    + stdenv.lib.optionalString (!hasFeature "python-support" features) ''
+    + lib.optionalString (!hasFeature "python-support" features) ''
       ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
     ''
   ;
@@ -249,7 +250,7 @@ let
     # 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
-    + stdenv.lib.optionalString (!hasFeature "python-support" features) ''
+    + lib.optionalString (!hasFeature "python-support" features) ''
       sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt
     ''
   ;
diff --git a/pkgs/applications/radio/gnuradio/gsm.nix b/pkgs/applications/radio/gnuradio/gsm.nix
index 39834540ff8..28c5045081b 100644
--- a/pkgs/applications/radio/gnuradio/gsm.nix
+++ b/pkgs/applications/radio/gnuradio/gsm.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [
     boost gnuradio makeWrapper cppunit libosmocore gr-osmosdr log4cpp
-  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+  ] ++ lib.optionals pythonSupport [ python swig ];
 
   postInstall = ''
     for prog in "$out"/bin/*; do
diff --git a/pkgs/applications/radio/gnuradio/limesdr.nix b/pkgs/applications/radio/gnuradio/limesdr.nix
index 1033b25cb3d..a01fab4975a 100644
--- a/pkgs/applications/radio/gnuradio/limesdr.nix
+++ b/pkgs/applications/radio/gnuradio/limesdr.nix
@@ -21,11 +21,11 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [
     cmake
     pkgconfig
-  ] ++ stdenv.lib.optionals pythonSupport [ swig ];
+  ] ++ lib.optionals pythonSupport [ swig ];
 
   buildInputs = [
     boost gnuradio limesuite log4cpp
-  ] ++ stdenv.lib.optionals pythonSupport [ python ];
+  ] ++ lib.optionals pythonSupport [ python ];
 
 
   meta = with lib; {
diff --git a/pkgs/applications/radio/gnuradio/nacl.nix b/pkgs/applications/radio/gnuradio/nacl.nix
index e87d2a71b1c..f6c21e79454 100644
--- a/pkgs/applications/radio/gnuradio/nacl.nix
+++ b/pkgs/applications/radio/gnuradio/nacl.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [
     boost gnuradio uhd makeWrapper libsodium cppunit log4cpp
-  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+  ] ++ lib.optionals pythonSupport [ python swig ];
 
   postInstall = ''
     for prog in "$out"/bin/*; do
diff --git a/pkgs/applications/radio/gnuradio/osmosdr.nix b/pkgs/applications/radio/gnuradio/osmosdr.nix
index 90adcf5ffae..436c4309a5b 100644
--- a/pkgs/applications/radio/gnuradio/osmosdr.nix
+++ b/pkgs/applications/radio/gnuradio/osmosdr.nix
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake makeWrapper pkg-config ];
   buildInputs = [
     boost log4cpp airspy gnuradio hackrf libbladeRF rtl-sdr uhd
-  ] ++ stdenv.lib.optionals stdenv.isLinux [ soapysdr-with-plugins ]
-    ++ stdenv.lib.optionals pythonSupport [ python swig python.pkgs.cheetah ];
+  ] ++ lib.optionals stdenv.isLinux [ soapysdr-with-plugins ]
+    ++ lib.optionals pythonSupport [ python swig python.pkgs.cheetah ];
 
   postInstall = ''
     for prog in "$out"/bin/*; do
diff --git a/pkgs/applications/radio/gnuradio/rds.nix b/pkgs/applications/radio/gnuradio/rds.nix
index 3c90a8ad985..4f15f2a961e 100644
--- a/pkgs/applications/radio/gnuradio/rds.nix
+++ b/pkgs/applications/radio/gnuradio/rds.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [
     boost gnuradio makeWrapper log4cpp
-  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+  ] ++ lib.optionals pythonSupport [ python swig ];
 
   postInstall = ''
     for prog in "$out"/bin/*; do
diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix
index 66ce0a5f513..e30831f87ee 100644
--- a/pkgs/applications/radio/gnuradio/shared.nix
+++ b/pkgs/applications/radio/gnuradio/shared.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , python
 , qt
 , gtk
@@ -14,9 +14,7 @@
 , fetchSubmodules
 }:
 
-let
-  lib = stdenv.lib;
-in rec {
+rec {
   version = builtins.concatStringsSep "." (
     lib.attrVals [ "major" "minor" "patch" ] versionAttr
   );
diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix
index 6b854918f57..aaf74abc2c5 100644
--- a/pkgs/applications/radio/gnuradio/wrapper.nix
+++ b/pkgs/applications/radio/gnuradio/wrapper.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , unwrapped
 , makeWrapper
 # For lndir
@@ -28,7 +29,7 @@ let
   pythonPkgs = extraPythonPackages
     # Add the extraPackages as python modules as well
     ++ (builtins.map unwrapped.python.pkgs.toPythonModule extraPackages)
-    ++ stdenv.lib.flatten (stdenv.lib.mapAttrsToList (
+    ++ lib.flatten (lib.mapAttrsToList (
       feat: info: (
         if unwrapped.hasFeature feat unwrapped.features then
           (if builtins.hasAttr "pythonRuntime" info then info.pythonRuntime else [])
@@ -36,18 +37,18 @@ let
           []
       )
       ) unwrapped.featuresInfo)
-    ++ stdenv.lib.optionals (unwrapped.hasFeature "python-support" unwrapped.features) [
+    ++ lib.optionals (unwrapped.hasFeature "python-support" unwrapped.features) [
       # Add unwrapped itself as a python module
       (unwrapped.python.pkgs.toPythonModule unwrapped)
     ]
   ;
   python3Env = unwrapped.python.withPackages(ps: pythonPkgs);
 
-  name = (stdenv.lib.appendToName "wrapped" unwrapped).name;
+  name = (lib.appendToName "wrapped" unwrapped).name;
   makeWrapperArgs = builtins.concatStringsSep " " ([
   ]
     # Emulating wrapGAppsHook & wrapQtAppsHook working together
-    ++ stdenv.lib.optionals (
+    ++ lib.optionals (
       (unwrapped.hasFeature "gnuradio-companion" unwrapped.features)
       || (unwrapped.hasFeature "gr-qtgui" unwrapped.features)
       ) [
@@ -57,14 +58,14 @@ let
       "--prefix" "XDG_DATA_DIRS" ":" "${hicolor-icon-theme}/share"
       # Needs to run `gsettings` on startup, see:
       # https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1764890.html
-      "--prefix" "PATH" ":" "${stdenv.lib.getBin glib}/bin"
+      "--prefix" "PATH" ":" "${lib.getBin glib}/bin"
     ]
-    ++ stdenv.lib.optionals (unwrapped.hasFeature "gnuradio-companion" unwrapped.features) [
+    ++ lib.optionals (unwrapped.hasFeature "gnuradio-companion" unwrapped.features) [
       "--set" "GDK_PIXBUF_MODULE_FILE" "${librsvg}/${gdk-pixbuf.moduleDir}.cache"
-      "--prefix" "GIO_EXTRA_MODULES" ":" "${stdenv.lib.getLib dconf}/lib/gio/modules"
+      "--prefix" "GIO_EXTRA_MODULES" ":" "${lib.getLib dconf}/lib/gio/modules"
       "--prefix" "XDG_DATA_DIRS" ":" "${unwrapped.gtk}/share"
       "--prefix" "XDG_DATA_DIRS" ":" "${unwrapped.gtk}/share/gsettings-schemas/${unwrapped.gtk.name}"
-      "--prefix" "GI_TYPELIB_PATH" ":" "${stdenv.lib.makeSearchPath "lib/girepository-1.0" [
+      "--prefix" "GI_TYPELIB_PATH" ":" "${lib.makeSearchPath "lib/girepository-1.0" [
         unwrapped.gtk
         gsettings-desktop-schemas
         atk
@@ -79,17 +80,17 @@ let
         at-spi2-core
       ]}"
     ]
-    ++ stdenv.lib.optionals (extraPackages != []) [
-      "--prefix" "GRC_BLOCKS_PATH" ":" "${stdenv.lib.makeSearchPath "share/gnuradio/grc/blocks" extraPackages}"
+    ++ lib.optionals (extraPackages != []) [
+      "--prefix" "GRC_BLOCKS_PATH" ":" "${lib.makeSearchPath "share/gnuradio/grc/blocks" extraPackages}"
     ]
-    ++ stdenv.lib.optionals (unwrapped.hasFeature "gr-qtgui" unwrapped.features)
+    ++ lib.optionals (unwrapped.hasFeature "gr-qtgui" unwrapped.features)
       # 3.7 builds with qt4
       (if unwrapped.versionAttr.major == "3.8" then
         [
           "--prefix" "QT_PLUGIN_PATH" ":"
-          "${stdenv.lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtPluginPrefix}"
+          "${lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtPluginPrefix}"
           "--prefix" "QML2_IMPORT_PATH" ":"
-          "${stdenv.lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtQmlPrefix}"
+          "${lib.getBin unwrapped.qt.qtbase}/${unwrapped.qt.qtbase.qtQmlPrefix}"
         ]
       else
         # TODO: Add here qt4 related environment for 3.7?