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

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

63 lines
1.8 KiB
Nix
Raw Normal View History

2018-04-25 17:01:40 +00:00
{ stdenv, lib, lndir, makeWrapper
, fetchFromGitHub, cmake
, libusb-compat-0_1, pkg-config
, usePython ? false
, python ? null
, ncurses, swig2
2018-04-25 17:01:40 +00:00
, extraPackages ? []
} :
let
2021-07-30 16:20:24 +00:00
version = "0.8.1";
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-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 = [
# see https://github.com/pothosware/SoapySDR/issues/352 for upstream issue
./fix-pkgconfig.patch
];
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
2020-04-28 03:29:39 +00:00
buildInputs = [ libusb-compat-0_1 ncurses ]
++ 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"
] ++ 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
wrapProgram "$file" --prefix SOAPY_SDR_PLUGIN_PATH : ${lib.escapeShellArg extraPackagesSearchPath}
2018-04-25 17:01:40 +00:00
done
'';
meta = with lib; {
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 ];
mainProgram = "SoapySDRUtil";
2021-09-30 22:29:01 +00:00
platforms = platforms.unix;
2018-04-25 17:01:40 +00:00
};
}