2021-01-15 05:42:41 +00:00
|
|
|
{ lib, stdenv
|
2020-04-03 16:41:41 +01:00
|
|
|
, fetchFromGitHub
|
2020-10-05 10:04:49 +01:00
|
|
|
, fetchpatch
|
2020-04-03 16:41:41 +01:00
|
|
|
, cmake
|
2020-10-05 10:04:49 +01:00
|
|
|
# Remove gcc and python references
|
|
|
|
, removeReferencesTo
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2021-02-15 20:14:54 +00:00
|
|
|
, volk
|
2020-04-03 16:41:41 +01:00
|
|
|
, cppunit
|
2020-10-05 10:04:49 +01:00
|
|
|
, orc
|
|
|
|
, boost
|
|
|
|
, log4cpp
|
|
|
|
, mpir
|
|
|
|
, doxygen
|
2020-04-03 16:41:41 +01:00
|
|
|
, python
|
2020-10-05 10:04:49 +01:00
|
|
|
, codec2
|
|
|
|
, gsm
|
|
|
|
, fftwFloat
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib
|
2020-10-05 10:04:49 +01:00
|
|
|
, libjack2
|
|
|
|
, CoreAudio
|
2013-05-02 11:44:36 +01:00
|
|
|
, uhd
|
|
|
|
, SDL
|
2020-10-05 10:04:49 +01:00
|
|
|
, gsl
|
2021-06-28 11:45:48 +01:00
|
|
|
, soapysdr
|
2021-02-15 20:14:54 +00:00
|
|
|
, libsodium
|
|
|
|
, libsndfile
|
|
|
|
, libunwind
|
2021-10-21 13:45:55 +01:00
|
|
|
, thrift
|
2020-10-05 10:04:49 +01:00
|
|
|
, cppzmq
|
|
|
|
, zeromq
|
2021-02-24 21:03:45 +00:00
|
|
|
# Needed only if qt-gui is disabled, from some reason
|
|
|
|
, icu
|
2020-10-05 10:04:49 +01:00
|
|
|
# GUI related
|
|
|
|
, gtk3
|
|
|
|
, pango
|
|
|
|
, gobject-introspection
|
|
|
|
, cairo
|
|
|
|
, qt5
|
|
|
|
, libsForQt5
|
|
|
|
# Features available to override, the list of them is in featuresInfo. They
|
|
|
|
# are all turned on by default.
|
|
|
|
, features ? {}
|
|
|
|
# If one wishes to use a different src or name for a very custom build
|
|
|
|
, overrideSrc ? {}
|
|
|
|
, pname ? "gnuradio"
|
|
|
|
, versionAttr ? {
|
2021-02-15 20:14:54 +00:00
|
|
|
major = "3.9";
|
2022-01-09 21:53:33 +00:00
|
|
|
minor = "5";
|
2020-10-05 10:04:49 +01:00
|
|
|
patch = "0";
|
|
|
|
}
|
2014-01-02 16:53:57 +00:00
|
|
|
}:
|
2013-05-02 11:44:36 +01:00
|
|
|
|
2020-10-05 10:04:49 +01:00
|
|
|
let
|
2022-01-09 21:53:33 +00:00
|
|
|
sourceSha256 = "sha256-TWCXLoS+ImKNd2zkxMks4FXsQMvGKgcW5/MW8S1Y1TY=";
|
2020-10-05 10:04:49 +01:00
|
|
|
featuresInfo = {
|
|
|
|
# Needed always
|
|
|
|
basic = {
|
|
|
|
native = [
|
|
|
|
cmake
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2020-10-05 10:04:49 +01:00
|
|
|
orc
|
|
|
|
];
|
|
|
|
runtime = [
|
2021-02-15 20:14:54 +00:00
|
|
|
volk
|
2020-10-05 10:04:49 +01:00
|
|
|
boost
|
|
|
|
log4cpp
|
|
|
|
mpir
|
2021-02-24 21:03:45 +00:00
|
|
|
]
|
|
|
|
# when gr-qtgui is disabled, icu needs to be included, otherwise
|
|
|
|
# building with boost 1.7x fails
|
2021-10-21 21:59:37 +01:00
|
|
|
++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ];
|
2020-10-05 10:04:49 +01:00
|
|
|
pythonNative = with python.pkgs; [
|
|
|
|
Mako
|
|
|
|
six
|
|
|
|
];
|
|
|
|
};
|
|
|
|
doxygen = {
|
|
|
|
native = [ doxygen ];
|
|
|
|
cmakeEnableFlag = "DOXYGEN";
|
|
|
|
};
|
2021-12-03 08:39:42 +00:00
|
|
|
man-pages = {
|
|
|
|
cmakeEnableFlag = "MANPAGES";
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
python-support = {
|
|
|
|
pythonRuntime = [ python.pkgs.six ];
|
|
|
|
native = [
|
|
|
|
python
|
|
|
|
];
|
|
|
|
cmakeEnableFlag = "PYTHON";
|
|
|
|
};
|
|
|
|
testing-support = {
|
|
|
|
native = [ cppunit ];
|
|
|
|
cmakeEnableFlag = "TESTING";
|
|
|
|
};
|
2021-02-15 20:14:54 +00:00
|
|
|
post-install = {
|
|
|
|
cmakeEnableFlag = "POSTINSTALL";
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
gnuradio-runtime = {
|
|
|
|
cmakeEnableFlag = "GNURADIO_RUNTIME";
|
2021-02-15 20:14:54 +00:00
|
|
|
pythonRuntime = [
|
|
|
|
python.pkgs.pybind11
|
|
|
|
];
|
2020-10-05 10:04:49 +01:00
|
|
|
};
|
|
|
|
gr-ctrlport = {
|
2021-02-15 20:14:54 +00:00
|
|
|
runtime = [
|
|
|
|
libunwind
|
2021-10-21 13:45:55 +01:00
|
|
|
thrift
|
2020-10-05 10:04:49 +01:00
|
|
|
];
|
2021-10-21 09:31:30 +01:00
|
|
|
pythonRuntime = with python.pkgs; [
|
2021-10-21 13:45:55 +01:00
|
|
|
python.pkgs.thrift
|
2021-10-21 09:31:30 +01:00
|
|
|
# For gr-perf-monitorx
|
|
|
|
matplotlib
|
|
|
|
networkx
|
|
|
|
];
|
2021-02-15 20:14:54 +00:00
|
|
|
cmakeEnableFlag = "GR_CTRLPORT";
|
2020-10-05 10:04:49 +01:00
|
|
|
};
|
|
|
|
gnuradio-companion = {
|
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
pyyaml
|
|
|
|
Mako
|
|
|
|
numpy
|
|
|
|
pygobject3
|
|
|
|
];
|
2021-02-15 20:14:54 +00:00
|
|
|
native = [
|
|
|
|
python.pkgs.pytest
|
|
|
|
];
|
2020-10-05 10:04:49 +01:00
|
|
|
runtime = [
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
gobject-introspection
|
|
|
|
cairo
|
2021-02-15 20:14:54 +00:00
|
|
|
libsndfile
|
2020-10-05 10:04:49 +01:00
|
|
|
];
|
|
|
|
cmakeEnableFlag = "GRC";
|
|
|
|
};
|
|
|
|
gr-blocks = {
|
|
|
|
cmakeEnableFlag = "GR_BLOCKS";
|
|
|
|
};
|
|
|
|
gr-fec = {
|
|
|
|
cmakeEnableFlag = "GR_FEC";
|
|
|
|
};
|
|
|
|
gr-fft = {
|
|
|
|
runtime = [ fftwFloat ];
|
|
|
|
cmakeEnableFlag = "GR_FFT";
|
|
|
|
};
|
|
|
|
gr-filter = {
|
|
|
|
runtime = [ fftwFloat ];
|
|
|
|
cmakeEnableFlag = "GR_FILTER";
|
2021-10-21 09:31:30 +01:00
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
scipy
|
|
|
|
pyqtgraph
|
|
|
|
];
|
2020-10-05 10:04:49 +01:00
|
|
|
};
|
|
|
|
gr-analog = {
|
|
|
|
cmakeEnableFlag = "GR_ANALOG";
|
|
|
|
};
|
|
|
|
gr-digital = {
|
|
|
|
cmakeEnableFlag = "GR_DIGITAL";
|
|
|
|
};
|
|
|
|
gr-dtv = {
|
|
|
|
cmakeEnableFlag = "GR_DTV";
|
|
|
|
};
|
|
|
|
gr-audio = {
|
|
|
|
runtime = []
|
2021-06-10 03:57:09 +01:00
|
|
|
++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ]
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreAudio ]
|
2020-10-05 10:04:49 +01:00
|
|
|
;
|
|
|
|
cmakeEnableFlag = "GR_AUDIO";
|
|
|
|
};
|
|
|
|
gr-channels = {
|
|
|
|
cmakeEnableFlag = "GR_CHANNELS";
|
|
|
|
};
|
|
|
|
gr-qtgui = {
|
|
|
|
runtime = [ qt5.qtbase libsForQt5.qwt ];
|
|
|
|
pythonRuntime = [ python.pkgs.pyqt5 ];
|
|
|
|
cmakeEnableFlag = "GR_QTGUI";
|
|
|
|
};
|
|
|
|
gr-trellis = {
|
|
|
|
cmakeEnableFlag = "GR_TRELLIS";
|
|
|
|
};
|
|
|
|
gr-uhd = {
|
2021-02-24 21:03:45 +00:00
|
|
|
runtime = [
|
|
|
|
uhd
|
|
|
|
];
|
2020-10-05 10:04:49 +01:00
|
|
|
cmakeEnableFlag = "GR_UHD";
|
|
|
|
};
|
2021-10-21 09:23:44 +01:00
|
|
|
gr-uhd-rfnoc = {
|
|
|
|
runtime = [
|
|
|
|
uhd
|
|
|
|
];
|
|
|
|
cmakeEnableFlag = "UHD_RFNOC";
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
gr-utils = {
|
|
|
|
cmakeEnableFlag = "GR_UTILS";
|
2021-10-21 09:31:30 +01:00
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
# For gr_plot
|
|
|
|
matplotlib
|
|
|
|
];
|
2020-10-05 10:04:49 +01:00
|
|
|
};
|
|
|
|
gr-modtool = {
|
|
|
|
pythonRuntime = with python.pkgs; [
|
2021-10-21 09:31:30 +01:00
|
|
|
setuptools
|
2020-10-05 10:04:49 +01:00
|
|
|
click
|
|
|
|
click-plugins
|
|
|
|
];
|
|
|
|
cmakeEnableFlag = "GR_MODTOOL";
|
|
|
|
};
|
2021-02-15 20:14:54 +00:00
|
|
|
gr-blocktool = {
|
|
|
|
cmakeEnableFlag = "GR_BLOCKTOOL";
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
gr-video-sdl = {
|
|
|
|
runtime = [ SDL ];
|
|
|
|
cmakeEnableFlag = "GR_VIDEO_SDL";
|
|
|
|
};
|
2021-04-03 13:47:43 +01:00
|
|
|
gr-vocoder = {
|
|
|
|
runtime = [ codec2 gsm ];
|
|
|
|
cmakeEnableFlag = "GR_VOCODER";
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
gr-wavelet = {
|
|
|
|
cmakeEnableFlag = "GR_WAVELET";
|
2021-02-15 20:14:54 +00:00
|
|
|
runtime = [ gsl libsodium ];
|
2020-10-05 10:04:49 +01:00
|
|
|
};
|
|
|
|
gr-zeromq = {
|
|
|
|
runtime = [ cppzmq zeromq ];
|
|
|
|
cmakeEnableFlag = "GR_ZEROMQ";
|
|
|
|
};
|
2021-02-15 20:14:54 +00:00
|
|
|
gr-network = {
|
|
|
|
cmakeEnableFlag = "GR_NETWORK";
|
|
|
|
};
|
2021-06-28 11:45:48 +01:00
|
|
|
gr-soapy = {
|
|
|
|
cmakeEnableFlag = "GR_SOAPY";
|
|
|
|
runtime = [
|
|
|
|
soapysdr
|
|
|
|
];
|
|
|
|
};
|
2013-05-02 11:44:36 +01:00
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
shared = (import ./shared.nix {
|
|
|
|
inherit
|
|
|
|
stdenv
|
2021-01-15 05:42:41 +00:00
|
|
|
lib
|
2020-10-05 10:04:49 +01:00
|
|
|
python
|
|
|
|
removeReferencesTo
|
|
|
|
featuresInfo
|
|
|
|
features
|
|
|
|
versionAttr
|
|
|
|
sourceSha256
|
|
|
|
overrideSrc
|
|
|
|
fetchFromGitHub
|
|
|
|
;
|
|
|
|
qt = qt5;
|
|
|
|
gtk = gtk3;
|
|
|
|
});
|
2021-03-13 11:50:15 +00:00
|
|
|
inherit (shared) hasFeature; # function
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname;
|
2020-10-05 10:04:49 +01:00
|
|
|
inherit (shared)
|
|
|
|
version
|
|
|
|
src
|
|
|
|
nativeBuildInputs
|
|
|
|
buildInputs
|
2021-06-28 11:45:48 +01:00
|
|
|
cmakeFlags
|
2020-10-05 10:04:49 +01:00
|
|
|
disallowedReferences
|
|
|
|
stripDebugList
|
|
|
|
doCheck
|
|
|
|
dontWrapPythonPrograms
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps
|
2020-10-05 10:04:49 +01:00
|
|
|
meta
|
|
|
|
;
|
2021-10-21 13:45:38 +01:00
|
|
|
patches = [
|
|
|
|
# Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227
|
|
|
|
./modtool-newmod-permissions.patch
|
|
|
|
];
|
2020-10-16 21:31:20 +01:00
|
|
|
passthru = shared.passthru // {
|
|
|
|
# Deps that are potentially overriden and are used inside GR plugins - the same version must
|
2021-03-13 11:50:15 +00:00
|
|
|
inherit boost volk;
|
2021-10-21 21:59:37 +01:00
|
|
|
} // lib.optionalAttrs (hasFeature "gr-uhd") {
|
2020-10-16 21:31:20 +01:00
|
|
|
inherit uhd;
|
2021-10-21 21:59:37 +01:00
|
|
|
} // lib.optionalAttrs (hasFeature "gr-qtgui") {
|
2020-10-16 21:31:20 +01:00
|
|
|
inherit (libsForQt5) qwt;
|
|
|
|
};
|
2013-05-02 11:44:36 +01:00
|
|
|
|
2020-10-05 10:04:49 +01:00
|
|
|
postInstall = shared.postInstall
|
2021-02-15 20:14:54 +00:00
|
|
|
# This is the only python reference worth removing, if needed.
|
2021-10-21 21:59:37 +01:00
|
|
|
+ lib.optionalString (!hasFeature "python-support") ''
|
2020-10-05 10:04:49 +01:00
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
|
2021-02-15 20:14:54 +00:00
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so)
|
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
|
2020-10-05 10:04:49 +01:00
|
|
|
''
|
|
|
|
;
|
2013-05-02 11:44:36 +01:00
|
|
|
}
|