2018-04-25 18:01:40 +01:00
|
|
|
{ stdenv, lib, lndir, makeWrapper
|
|
|
|
, fetchFromGitHub, cmake
|
|
|
|
, libusb, pkgconfig
|
|
|
|
, python, swig2, numpy, ncurses
|
|
|
|
, extraPackages ? []
|
|
|
|
} :
|
|
|
|
|
|
|
|
let
|
2018-10-26 09:08:37 +01:00
|
|
|
version = "0.7.0";
|
2018-04-25 18:01:40 +01:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "soapysdr-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pothosware";
|
|
|
|
repo = "SoapySDR";
|
|
|
|
rev = "soapy-sdr-${version}";
|
2018-10-26 09:08:37 +01:00
|
|
|
sha256 = "14fjwnfj7jz9ixvim2gy4f52y6s7d4xggzxn2ck7g4q35d879x13";
|
2018-04-25 18:01:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
2018-12-19 22:28:03 +00:00
|
|
|
buildInputs = [ libusb ncurses numpy swig2 python makeWrapper ];
|
2018-04-25 18:01:40 +01:00
|
|
|
|
|
|
|
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
|
2018-12-19 22:28:03 +00:00
|
|
|
for file in $out/bin/*; do
|
|
|
|
wrapProgram "$file" \
|
2018-04-25 18:01:40 +01:00
|
|
|
--prefix SOAPY_SDR_PLUGIN_PATH : ${lib.makeSearchPath "lib/SoapySDR/modules0.6" extraPackages}
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|