2018-04-25 19:01:40 +02:00
|
|
|
{ stdenv, lib, lndir, makeWrapper
|
|
|
|
, fetchFromGitHub, cmake
|
|
|
|
, libusb, pkgconfig
|
|
|
|
, python, swig2, numpy, ncurses
|
|
|
|
, extraPackages ? []
|
|
|
|
} :
|
|
|
|
|
|
|
|
let
|
2018-12-29 19:25:28 +01:00
|
|
|
|
2019-01-28 16:06:18 +01:00
|
|
|
version = "0.7.1";
|
2018-12-29 19:25:28 +01:00
|
|
|
modulesVersion = with lib; versions.major version + "." + versions.minor version;
|
|
|
|
modulesPath = "lib/SoapySDR/modules" + modulesVersion;
|
|
|
|
extraPackagesSearchPath = lib.makeSearchPath modulesPath extraPackages;
|
2018-04-25 19:01:40 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "soapysdr-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pothosware";
|
|
|
|
repo = "SoapySDR";
|
|
|
|
rev = "soapy-sdr-${version}";
|
2019-01-28 16:06:18 +01:00
|
|
|
sha256 = "1rbnd3w12kzsh94fiywyn4vch7h0kf75m88fi6nq992b3vnmiwvl";
|
2018-04-25 19:01:40 +02:00
|
|
|
};
|
|
|
|
|
2018-12-29 19:25:28 +01:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkgconfig ];
|
|
|
|
buildInputs = [ libusb ncurses numpy python swig2 ];
|
2018-04-25 19:01:40 +02: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 23:28:03 +01:00
|
|
|
for file in $out/bin/*; do
|
2018-12-29 19:25:28 +01:00
|
|
|
wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${extraPackagesSearchPath}
|
2018-04-25 19:01:40 +02:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|