nixpkgs/pkgs/applications/radio/soapysdr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2.1 KiB
Nix
Raw Normal View History

2024-08-23 20:32:30 +01:00
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
cmake,
pkg-config,
makeWrapper,
libusb-compat-0_1,
ncurses,
usePython ? false,
python ? null,
2024-08-27 05:24:38 +01:00
swig,
2024-08-23 20:32:30 +01:00
extraPackages ? [ ],
buildPackages,
testers,
}:
2018-04-25 18:01:40 +01:00
stdenv.mkDerivation (finalAttrs: {
2019-08-13 22:52:01 +01:00
pname = "soapysdr";
version = "0.8.1";
2018-04-25 18:01:40 +01:00
src = fetchFromGitHub {
owner = "pothosware";
repo = "SoapySDR";
rev = "soapy-sdr-${finalAttrs.version}";
2021-07-30 17:20:24 +01:00
sha256 = "19f2x0pkxvf9figa0pl6xqlcz8fblvqb19mcnj632p0l8vk6qdv2";
2018-04-25 18:01:40 +01:00
};
2022-07-24 19:55:23 +01:00
patches = [
# 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 19:55:23 +01:00
];
nativeBuildInputs = [
cmake
pkg-config
makeWrapper
];
2024-08-23 20:32:30 +01:00
buildInputs =
[
libusb-compat-0_1
ncurses
]
++ lib.optionals usePython [
python
2024-08-27 05:24:38 +01:00
swig
2024-08-23 20:32:30 +01:00
];
2018-04-25 18:01:40 +01:00
2024-08-23 20:32:30 +01:00
propagatedBuildInputs = lib.optionals usePython [ python.pkgs.numpy ];
2018-04-25 18:01:40 +01:00
2024-08-23 20:32:30 +01:00
cmakeFlags = lib.optionals usePython [ "-DUSE_PYTHON_CONFIG=ON" ];
2022-05-18 20:31:38 +01:00
postFixup = lib.optionalString (extraPackages != [ ]) (
2018-04-25 18:01:40 +01:00
# Join all plugins via symlinking
lib.pipe extraPackages [
(map (pkg: ''
${buildPackages.xorg.lndir}/bin/lndir -silent ${pkg} $out
''))
lib.concatStrings
2024-08-23 20:32:30 +01:00
]
+ ''
# Needed for at least the remote plugin server
for file in $out/bin/*; do
2024-08-23 20:32:30 +01:00
wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${lib.escapeShellArg (lib.makeSearchPath finalAttrs.passthru.searchPath extraPackages)}
done
''
);
2018-04-25 18:01:40 +01:00
passthru = {
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
searchPath = "lib/SoapySDR/modules${lib.versions.majorMinor finalAttrs.version}";
};
meta = with lib; {
homepage = "https://github.com/pothosware/SoapySDR";
2018-04-25 18:01:40 +01:00
description = "Vendor and platform neutral SDR support library";
license = licenses.boost;
maintainers = with maintainers; [ markuskowa ];
mainProgram = "SoapySDRUtil";
pkgConfigModules = [ "SoapySDR" ];
2021-09-30 23:29:01 +01:00
platforms = platforms.unix;
2018-04-25 18:01:40 +01:00
};
})