2018-04-25 17:01:40 +00:00
|
|
|
{ stdenv, lib, lndir, makeWrapper
|
|
|
|
, fetchFromGitHub, cmake
|
2021-01-17 02:09:27 +00:00
|
|
|
, libusb-compat-0_1, pkg-config
|
2020-01-03 19:25:11 +00:00
|
|
|
, usePython ? false
|
|
|
|
, python, ncurses, swig2
|
2018-04-25 17:01:40 +00:00
|
|
|
, extraPackages ? []
|
|
|
|
} :
|
|
|
|
|
|
|
|
let
|
2018-12-29 18:25:28 +00:00
|
|
|
|
2021-06-30 14:15:50 +00:00
|
|
|
version = "0.8.0";
|
2018-12-29 18:25:28 +00:00
|
|
|
modulesVersion = with lib; versions.major version + "." + versions.minor version;
|
|
|
|
modulesPath = "lib/SoapySDR/modules" + modulesVersion;
|
|
|
|
extraPackagesSearchPath = lib.makeSearchPath modulesPath extraPackages;
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "soapysdr";
|
|
|
|
inherit version;
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pothosware";
|
|
|
|
repo = "SoapySDR";
|
|
|
|
rev = "soapy-sdr-${version}";
|
2021-06-30 14:15:50 +00:00
|
|
|
sha256 = "1dy25zxk7wmg7ik82dx7h3bbbynvalbz1dxsl7kgm3374yxhnixv";
|
2018-04-25 17:01:40 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
|
2020-04-28 03:29:39 +00:00
|
|
|
buildInputs = [ libusb-compat-0_1 ncurses ]
|
2020-01-03 19:25:11 +00:00
|
|
|
++ lib.optionals usePython [ python swig2 ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optional usePython python.pkgs.numpy;
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2020-01-03 19:25:11 +00:00
|
|
|
] ++ lib.optional usePython "-DUSE_PYTHON_CONFIG=ON";
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
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
|
2018-12-29 18:25:28 +00:00
|
|
|
wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${extraPackagesSearchPath}
|
2018-04-25 17:01:40 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/pothosware/SoapySDR";
|
2018-04-25 17:01:40 +00:00
|
|
|
description = "Vendor and platform neutral SDR support library";
|
|
|
|
license = licenses.boost;
|
|
|
|
maintainers = with maintainers; [ markuskowa ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|