From 872e92bb87bd708f7909cb4f27a092054d595120 Mon Sep 17 00:00:00 2001 From: Charles Duffy Date: Sat, 27 Apr 2019 17:53:05 -0500 Subject: [PATCH] Introduce a Nix derivation This permits any user running NixOS to run `nix-build` to install all dependencies and build the local tree. --- default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..de32e33 --- /dev/null +++ b/default.nix @@ -0,0 +1,25 @@ +let + pkgs = import {}; +in with pkgs; with pkgs.stdenv; mkDerivation { + name = "gr-air-modes"; + src = ./.; + buildInputs = [ + boost + cmake + gcc + gnumake + gnuradio + pkgconfig + qwt + swig + (python27.withPackages(ps: [ps.pyqt4 ps.numpy ps.pyzmq])) + ]; + nativeBuildInputs = [ makeWrapper ]; + configurePhase = '' + cmake -DCMAKE_INSTALL_PREFIX=$out + ''; + postFixup = '' + wrapProgram $out/bin/modes_gui --prefix PYTHONPATH : "$out/lib/python2.7/site-packages:$PYTHONPATH" + wrapProgram $out/bin/modes_rx --prefix PYTHONPATH : "$out/lib/python2.7/site-packages:$PYTHONPATH" + ''; +}