2023-09-07 12:12:15 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, libusb-compat-0_1
|
|
|
|
, ncurses
|
2020-01-03 19:25:11 +00:00
|
|
|
, usePython ? false
|
2022-01-11 23:40:02 +00:00
|
|
|
, python ? null
|
2023-09-07 12:12:15 +00:00
|
|
|
, swig2
|
|
|
|
, extraPackages ? [ ]
|
2023-04-22 19:43:58 +00:00
|
|
|
, buildPackages
|
2023-09-07 12:12:15 +00:00
|
|
|
, testers
|
2023-02-07 04:16:20 +00:00
|
|
|
}:
|
2018-04-25 17:01:40 +00:00
|
|
|
|
2023-09-07 12:12:15 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "soapysdr";
|
2023-09-07 12:12:15 +00:00
|
|
|
version = "0.8.1";
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pothosware";
|
|
|
|
repo = "SoapySDR";
|
2023-09-07 12:12:15 +00:00
|
|
|
rev = "soapy-sdr-${finalAttrs.version}";
|
2021-07-30 16:20:24 +00:00
|
|
|
sha256 = "19f2x0pkxvf9figa0pl6xqlcz8fblvqb19mcnj632p0l8vk6qdv2";
|
2018-04-25 17:01:40 +00:00
|
|
|
};
|
|
|
|
|
2022-07-24 18:55:23 +00:00
|
|
|
patches = [
|
2023-09-07 12:12:15 +00:00
|
|
|
# Fix for https://github.com/pothosware/SoapySDR/issues/352
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/pothosware/SoapySDR/commit/10c05b3e52caaa421147d6b4623eccd3fc3be3f4.patch";
|
|
|
|
hash = "sha256-D7so6NSZiU6SXbzns04Q4RjSZW0FJ+MYobvvVpVMjws=";
|
|
|
|
})
|
2022-07-24 18:55:23 +00:00
|
|
|
];
|
|
|
|
|
2023-09-07 12:12:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
libusb-compat-0_1
|
|
|
|
ncurses
|
|
|
|
] ++ lib.optionals usePython [
|
|
|
|
python
|
|
|
|
swig2
|
|
|
|
];
|
2020-01-03 19:25:11 +00:00
|
|
|
|
2023-09-07 12:12:15 +00:00
|
|
|
propagatedBuildInputs = lib.optionals usePython [
|
|
|
|
python.pkgs.numpy
|
|
|
|
];
|
2018-04-25 17:01:40 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2023-09-07 12:12:15 +00:00
|
|
|
] ++ lib.optionals usePython [
|
|
|
|
"-DUSE_PYTHON_CONFIG=ON"
|
|
|
|
];
|
2022-05-18 19:31:38 +00:00
|
|
|
|
2023-09-07 12:12:15 +00:00
|
|
|
postFixup = lib.optionalString (extraPackages != [ ]) (
|
2018-04-25 17:01:40 +00:00
|
|
|
# Join all plugins via symlinking
|
2023-09-07 12:12:15 +00:00
|
|
|
lib.pipe extraPackages [
|
|
|
|
(map (pkg: ''
|
|
|
|
${buildPackages.xorg.lndir}/bin/lndir -silent ${pkg} $out
|
|
|
|
''))
|
|
|
|
lib.concatStrings
|
|
|
|
] + ''
|
|
|
|
# Needed for at least the remote plugin server
|
|
|
|
for file in $out/bin/*; do
|
|
|
|
wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${lib.escapeShellArg (
|
|
|
|
lib.makeSearchPath finalAttrs.passthru.searchPath extraPackages
|
|
|
|
)}
|
|
|
|
done
|
|
|
|
''
|
|
|
|
);
|
2018-04-25 17:01:40 +00:00
|
|
|
|
2023-09-07 12:12:15 +00:00
|
|
|
passthru = {
|
|
|
|
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
searchPath = "lib/SoapySDR/modules${lib.versions.majorMinor finalAttrs.version}";
|
|
|
|
};
|
2023-02-07 04:16:20 +00:00
|
|
|
|
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 ];
|
2022-05-05 00:46:39 +00:00
|
|
|
mainProgram = "SoapySDRUtil";
|
2023-02-07 04:16:20 +00:00
|
|
|
pkgConfigModules = [ "SoapySDR" ];
|
2021-09-30 22:29:01 +00:00
|
|
|
platforms = platforms.unix;
|
2018-04-25 17:01:40 +00:00
|
|
|
};
|
2023-02-07 04:16:20 +00:00
|
|
|
})
|