2020-10-16 22:31:20 +02:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, fetchgit
|
|
|
|
, gnuradio
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, log4cpp
|
|
|
|
, mpir
|
|
|
|
, boost
|
|
|
|
, gmp
|
2021-10-21 14:45:55 +02:00
|
|
|
, thrift
|
2020-10-16 22:31:20 +02:00
|
|
|
, fftwFloat
|
|
|
|
, python
|
|
|
|
, swig
|
|
|
|
, uhd
|
|
|
|
, icu
|
|
|
|
, airspy
|
|
|
|
, hackrf
|
|
|
|
, libbladeRF
|
|
|
|
, rtl-sdr
|
|
|
|
, soapysdr-with-plugins
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = {
|
|
|
|
"3.7" = "0.1.5";
|
2022-01-15 23:02:50 +01:00
|
|
|
"3.8" = "0.2.3";
|
2020-10-16 22:31:20 +02:00
|
|
|
}.${gnuradio.versionAttr.major};
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.osmocom.org/gr-osmosdr";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = {
|
|
|
|
"3.7" = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv";
|
2022-01-15 23:02:50 +01:00
|
|
|
"3.8" = "sha256-ZfI8MshhZOdJ1U5FlnZKXsg2Rsvb6oKg943ZVYd/IWo=";
|
2020-10-16 22:31:20 +02:00
|
|
|
}.${gnuradio.versionAttr.major};
|
|
|
|
};
|
|
|
|
in mkDerivation {
|
|
|
|
pname = "gr-osmosdr";
|
|
|
|
inherit version src;
|
|
|
|
disabledForGRafter = "3.9";
|
|
|
|
|
2022-04-28 21:44:41 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-10-16 22:31:20 +02:00
|
|
|
buildInputs = [
|
|
|
|
log4cpp
|
|
|
|
mpir
|
|
|
|
boost
|
|
|
|
fftwFloat
|
|
|
|
gmp
|
|
|
|
icu
|
|
|
|
airspy
|
|
|
|
hackrf
|
|
|
|
libbladeRF
|
|
|
|
rtl-sdr
|
|
|
|
soapysdr-with-plugins
|
2021-10-21 22:59:37 +02:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [
|
2020-10-16 22:31:20 +02:00
|
|
|
uhd
|
2021-10-21 14:45:55 +02:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
|
|
|
|
thrift
|
|
|
|
python.pkgs.thrift
|
2020-10-16 22:31:20 +02:00
|
|
|
];
|
|
|
|
cmakeFlags = [
|
2021-10-21 22:59:37 +02:00
|
|
|
(if (gnuradio.hasFeature "python-support") then
|
2020-10-16 22:31:20 +02:00
|
|
|
"-DENABLE_PYTHON=ON"
|
|
|
|
else
|
|
|
|
"-DENABLE_PYTHON=OFF"
|
|
|
|
)
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
swig
|
2021-10-21 22:59:37 +02:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "python-support") [
|
2020-10-16 22:31:20 +02:00
|
|
|
(if (gnuradio.versionAttr.major == "3.7") then
|
|
|
|
python.pkgs.cheetah
|
|
|
|
else
|
|
|
|
python.pkgs.Mako
|
|
|
|
)
|
|
|
|
python
|
|
|
|
]
|
|
|
|
;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Gnuradio block for OsmoSDR and rtl-sdr";
|
|
|
|
homepage = "https://sdr.osmocom.org/trac/wiki/GrOsmoSDR";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|