about summary refs log tree commit diff
path: root/pkgs/applications/radio/soapysdr
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2019-02-09 19:36:46 +0100
committerElis Hirwing <elis@hirwing.se>2019-02-09 21:39:27 +0100
commit735a9ae56e380c520c0e8ef6ec6a8cfdf909f011 (patch)
tree5e2224865a4f5fca8bd4d34cc784d32870b38ec3 /pkgs/applications/radio/soapysdr
parent3bfd4c43bc79b9edf90c3898188c48296265db29 (diff)
soapysdr: Move from misc to radio
Diffstat (limited to 'pkgs/applications/radio/soapysdr')
-rw-r--r--pkgs/applications/radio/soapysdr/default.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/applications/radio/soapysdr/default.nix b/pkgs/applications/radio/soapysdr/default.nix
new file mode 100644
index 0000000000000..6754e8f2a55cb
--- /dev/null
+++ b/pkgs/applications/radio/soapysdr/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, lib, lndir, makeWrapper
+, fetchFromGitHub, cmake
+, libusb, pkgconfig
+, python, swig2, numpy, ncurses
+, extraPackages ? []
+} :
+
+let
+
+  version = "0.7.1";
+  modulesVersion = with lib; versions.major version + "." + versions.minor version;
+  modulesPath = "lib/SoapySDR/modules" + modulesVersion;
+  extraPackagesSearchPath = lib.makeSearchPath modulesPath extraPackages;
+
+in stdenv.mkDerivation {
+  name = "soapysdr-${version}";
+
+  src = fetchFromGitHub {
+    owner = "pothosware";
+    repo = "SoapySDR";
+    rev = "soapy-sdr-${version}";
+    sha256 = "1rbnd3w12kzsh94fiywyn4vch7h0kf75m88fi6nq992b3vnmiwvl";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper pkgconfig ];
+  buildInputs = [ libusb ncurses numpy python swig2 ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DUSE_PYTHON_CONFIG=ON"
+  ];
+
+  postFixup = lib.optionalString (lib.length extraPackages != 0) ''
+    # Join all plugins via symlinking
+    for i in ${toString extraPackages}; do
+      ${lndir}/bin/lndir -silent $i $out
+    done
+    # Needed for at least the remote plugin server
+    for file in $out/bin/*; do
+        wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${extraPackagesSearchPath}
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/pothosware/SoapySDR;
+    description = "Vendor and platform neutral SDR support library";
+    license = licenses.boost;
+    maintainers = with maintainers; [ markuskowa ];
+    platforms = platforms.linux;
+  };
+}