summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorRemy Goldschmidt <taktoa@gmail.com>2018-02-04 10:44:04 -0600
committerRemy Goldschmidt <taktoa@gmail.com>2018-02-04 10:45:52 -0600
commitdc5bdf22d91f39e296bfec2cbe82f23ff33afd53 (patch)
treeb7acf952c309857f6c66a29f0ac0ead9ef186c6e /pkgs/applications/misc
parent4db7c04160d784e7bbfe612d74cf5b98b4891393 (diff)
downloadnixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar.gz
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar.bz2
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar.lz
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar.xz
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.tar.zst
nixlib-dc5bdf22d91f39e296bfec2cbe82f23ff33afd53.zip
gnuradio: fix wrapper
gnuradio-with-packages was not running makeWrapper on any of the
symlinked executables because `find $out/bin -type f -executable`
does not resolve symlinks. I don't understand how the old code
ever worked on any system.
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/gnuradio/wrapper.nix19
1 files changed, 10 insertions, 9 deletions
diff --git a/pkgs/applications/misc/gnuradio/wrapper.nix b/pkgs/applications/misc/gnuradio/wrapper.nix
index db2b453913f4..ffed3da03187 100644
--- a/pkgs/applications/misc/gnuradio/wrapper.nix
+++ b/pkgs/applications/misc/gnuradio/wrapper.nix
@@ -1,7 +1,6 @@
-{ stdenv, gnuradio, makeWrapper, python
-, extraPackages ? [] }:
+{ stdenv, gnuradio, makeWrapper, python, extraPackages ? [] }:
 
-with stdenv.lib;
+with { inherit (stdenv.lib) appendToName makeSearchPath; };
 
 stdenv.mkDerivation {
   name = (appendToName "with-packages" gnuradio).name;
@@ -11,13 +10,15 @@ stdenv.mkDerivation {
     mkdir -p $out/bin
     ln -s "${gnuradio}"/bin/* $out/bin/
 
-    for file in $(find $out/bin -type f -executable); do
-        wrapProgram "$file" \
-            --prefix PYTHONPATH : ${stdenv.lib.concatStringsSep ":"
-                                     (map (path: "$(toPythonPath ${path})") extraPackages)} \
-            --prefix GRC_BLOCKS_PATH : ${makeSearchPath "share/gnuradio/grc/blocks" extraPackages}
+    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;
 }