2018-02-04 16:44:04 +00:00
|
|
|
{ stdenv, gnuradio, makeWrapper, python, extraPackages ? [] }:
|
2015-07-15 11:24:03 +01:00
|
|
|
|
2018-02-04 16:44:04 +00:00
|
|
|
with { inherit (stdenv.lib) appendToName makeSearchPath; };
|
2015-07-15 11:24:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = (appendToName "with-packages" gnuradio).name;
|
|
|
|
buildInputs = [ makeWrapper python ];
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s "${gnuradio}"/bin/* $out/bin/
|
|
|
|
|
2018-02-04 16:44:04 +00:00
|
|
|
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
|
2015-07-15 11:24:03 +01:00
|
|
|
done
|
|
|
|
'';
|
2018-02-04 16:44:04 +00:00
|
|
|
|
2015-07-15 11:24:03 +01:00
|
|
|
inherit (gnuradio) meta;
|
|
|
|
}
|