2021-03-15 08:37:03 +00:00
|
|
|
{ lib
|
2022-10-30 15:09:59 +00:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
2021-03-15 08:37:03 +00:00
|
|
|
, mkDerivation
|
|
|
|
, fetchgit
|
|
|
|
, gnuradio
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
2023-04-29 16:46:19 +00:00
|
|
|
, logLib
|
|
|
|
, libsndfile
|
2021-03-15 08:37:03 +00:00
|
|
|
, mpir
|
|
|
|
, boost
|
|
|
|
, gmp
|
2021-10-28 06:52:43 +00:00
|
|
|
, thrift
|
2021-03-15 08:37:03 +00:00
|
|
|
, fftwFloat
|
|
|
|
, python
|
|
|
|
, swig
|
|
|
|
, uhd
|
|
|
|
, icu
|
|
|
|
, airspy
|
|
|
|
, hackrf
|
|
|
|
, libbladeRF
|
|
|
|
, rtl-sdr
|
|
|
|
, soapysdr-with-plugins
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = {
|
|
|
|
"3.7" = "0.1.5";
|
2022-01-19 23:45:15 +00:00
|
|
|
"3.8" = "0.2.3";
|
2023-04-29 16:46:19 +00:00
|
|
|
"3.9" = "0.2.4";
|
|
|
|
"3.10" = "0.2.4";
|
2021-03-15 08:37:03 +00:00
|
|
|
}.${gnuradio.versionAttr.major};
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.osmocom.org/gr-osmosdr";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = {
|
|
|
|
"3.7" = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv";
|
2022-01-19 23:45:15 +00:00
|
|
|
"3.8" = "sha256-ZfI8MshhZOdJ1U5FlnZKXsg2Rsvb6oKg943ZVYd/IWo=";
|
2023-04-29 16:46:19 +00:00
|
|
|
"3.9" = "sha256-d0hbiJ44lEu8V4XX7JpZVSTQwwykwKPUfiqetRBI6uI=";
|
|
|
|
"3.10" = "sha256-d0hbiJ44lEu8V4XX7JpZVSTQwwykwKPUfiqetRBI6uI=";
|
2021-03-15 08:37:03 +00:00
|
|
|
}.${gnuradio.versionAttr.major};
|
|
|
|
};
|
|
|
|
in mkDerivation {
|
|
|
|
pname = "gr-osmosdr";
|
|
|
|
inherit version src;
|
2023-04-29 16:46:19 +00:00
|
|
|
disabledForGRafter = "3.11";
|
2021-03-15 08:37:03 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
buildInputs = [
|
2023-04-29 16:46:19 +00:00
|
|
|
logLib
|
2021-03-15 08:37:03 +00:00
|
|
|
mpir
|
|
|
|
boost
|
|
|
|
fftwFloat
|
|
|
|
gmp
|
|
|
|
icu
|
|
|
|
airspy
|
|
|
|
hackrf
|
|
|
|
libbladeRF
|
|
|
|
rtl-sdr
|
|
|
|
soapysdr-with-plugins
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-blocks") [
|
|
|
|
libsndfile
|
2021-10-28 06:52:43 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [
|
2021-03-15 08:37:03 +00:00
|
|
|
uhd
|
2021-10-28 06:52:43 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
|
|
|
|
thrift
|
|
|
|
python.pkgs.thrift
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "python-support") [
|
|
|
|
python.pkgs.numpy
|
|
|
|
python.pkgs.pybind11
|
2022-10-30 15:09:59 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.IOKit
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
2021-03-15 08:37:03 +00:00
|
|
|
];
|
|
|
|
cmakeFlags = [
|
2021-10-28 06:52:43 +00:00
|
|
|
(if (gnuradio.hasFeature "python-support") then
|
2021-03-15 08:37:03 +00:00
|
|
|
"-DENABLE_PYTHON=ON"
|
|
|
|
else
|
|
|
|
"-DENABLE_PYTHON=OFF"
|
|
|
|
)
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
swig
|
2021-10-28 06:52:43 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "python-support") [
|
2021-03-15 08:37:03 +00:00
|
|
|
(if (gnuradio.versionAttr.major == "3.7") then
|
|
|
|
python.pkgs.cheetah
|
|
|
|
else
|
2023-03-15 16:39:30 +00:00
|
|
|
python.pkgs.mako
|
2021-03-15 08:37:03 +00:00
|
|
|
)
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|