nixpkgs/pkgs/applications/misc/gnuradio/wrapper.nix
Moritz Ulrich 022527a5e1 Gnuradio: Add gnuradio-wrapper and gnuradio-full.
gnuradio-wrapper is a simple derivation wrapping $(gnuradio)/bin/* to
make other blocks (from `extraPackages') available.

gnuradio-full uses gnuradio-wrapper to build gnuradio with blocks from
gnuradio-osmosdr (therefore allowing the use of rtl-sdr, hackrf, the
ccc-camp2015 badge, and similar).
2015-07-15 15:39:10 +02:00

24 lines
654 B
Nix

{ stdenv, gnuradio, makeWrapper, python
, extraPackages ? [] }:
with stdenv.lib;
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 "$out"/bin/*; do
wrapProgram "$file" \
--prefix PYTHONPATH : ${stdenv.lib.concatStringsSep ":"
(map (path: "$(toPythonPath ${path})") extraPackages)} \
--prefix GRC_BLOCKS_PATH : ${makeSearchPath "share/gnuradio/grc/blocks" extraPackages}
done
'';
inherit (gnuradio) meta;
}