nixpkgs/pkgs/applications/misc/gnuradio/wrapper.nix
Remy Goldschmidt dc5bdf22d9
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.
2018-02-04 10:45:52 -06:00

24 lines
787 B
Nix

{ 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;
}