about summary refs log tree commit diff
path: root/pkgs/applications/radio/gnuradio/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/radio/gnuradio/wrapper.nix')
-rw-r--r--pkgs/applications/radio/gnuradio/wrapper.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix
new file mode 100644
index 0000000000000..ffed3da03187e
--- /dev/null
+++ b/pkgs/applications/radio/gnuradio/wrapper.nix
@@ -0,0 +1,24 @@
+{ stdenv, gnuradio, makeWrapper, python, extraPackages ? [] }:
+
+with { inherit (stdenv.lib) appendToName makeSearchPath; };
+
+stdenv.mkDerivation {
+  name = (appendToName "with-packages" gnuradio).name;
+  buildInputs = [ makeWrapper python ];
+
+  buildCommand = ''
+    mkdir -p $out/bin
+    ln -s "${gnuradio}"/bin/* $out/bin/
+
+    for file in $(find -L $out/bin -type f); do
+        if test -x "$(readlink -f "$file")"; then
+            wrapProgram "$file" \
+                --prefix PYTHONPATH : ${stdenv.lib.concatStringsSep ":"
+                                         (map (path: "$(toPythonPath ${path})") extraPackages)} \
+                --prefix GRC_BLOCKS_PATH : ${makeSearchPath "share/gnuradio/grc/blocks" extraPackages}
+        fi
+    done
+  '';
+
+  inherit (gnuradio) meta;
+}