about summary refs log tree commit diff
path: root/pkgs/applications/radio/gnuradio/osmosdr.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/radio/gnuradio/osmosdr.nix')
-rw-r--r--pkgs/applications/radio/gnuradio/osmosdr.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/applications/radio/gnuradio/osmosdr.nix b/pkgs/applications/radio/gnuradio/osmosdr.nix
new file mode 100644
index 000000000000..846afe0e95d4
--- /dev/null
+++ b/pkgs/applications/radio/gnuradio/osmosdr.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchgit, cmake, pkgconfig, makeWrapper
+, boost
+, pythonSupport ? true, python, swig
+, airspy
+, gnuradio
+, hackrf
+, libbladeRF
+, rtl-sdr
+, soapysdr-with-plugins
+, uhd
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-osmosdr-${version}";
+  version = "2018-08-15";
+
+  src = fetchgit {
+    url = "git://git.osmocom.org/gr-osmosdr";
+    rev = "4d83c6067f059b0c5015c3f59f8117bbd361e877";
+    sha256 = "1d5nb47506qry52bg4cn02d3l4lwxwz44g2fz1ph0q93c7892j60";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake makeWrapper boost
+    airspy gnuradio hackrf libbladeRF rtl-sdr uhd
+  ] ++ stdenv.lib.optionals stdenv.isLinux [ soapysdr-with-plugins ]
+    ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Gnuradio block for OsmoSDR and rtl-sdr";
+    homepage = https://sdr.osmocom.org/trac/wiki/GrOsmoSDR;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ bjornfor the-kenny ];
+  };
+}