2021-01-15 05:42:41 +00:00
|
|
|
{ lib, stdenv
|
2020-10-05 09:04:49 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
# Remove gcc and python references
|
|
|
|
, removeReferencesTo
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2021-03-13 11:50:15 +00:00
|
|
|
, volk
|
2020-10-05 09:04:49 +00:00
|
|
|
, cppunit
|
|
|
|
, swig
|
|
|
|
, orc
|
|
|
|
, boost
|
|
|
|
, log4cpp
|
|
|
|
, mpir
|
|
|
|
, doxygen
|
|
|
|
, python
|
|
|
|
, codec2
|
|
|
|
, gsm
|
|
|
|
, fftwFloat
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2020-10-05 09:04:49 +00:00
|
|
|
, libjack2
|
|
|
|
, CoreAudio
|
|
|
|
, uhd
|
|
|
|
, comedilib
|
|
|
|
, libusb1
|
|
|
|
, SDL
|
|
|
|
, gsl
|
|
|
|
, cppzmq
|
|
|
|
, zeromq
|
|
|
|
# GUI related
|
|
|
|
, gtk2
|
|
|
|
, pango
|
|
|
|
, cairo
|
|
|
|
, qt4
|
|
|
|
, qwt6_qt4
|
|
|
|
# Features available to override, the list of them is in featuresInfo. They
|
2020-11-08 23:17:12 +00:00
|
|
|
# are all turned on by default
|
|
|
|
, features ? {}
|
2020-10-05 09:04:49 +00:00
|
|
|
# If one wishes to use a different src or name for a very custom build
|
|
|
|
, overrideSrc ? {}
|
|
|
|
, pname ? "gnuradio"
|
|
|
|
, versionAttr ? {
|
|
|
|
major = "3.7";
|
|
|
|
minor = "14";
|
|
|
|
patch = "0";
|
|
|
|
}
|
2021-03-13 11:50:15 +00:00
|
|
|
# We use our build of volk and not the one bundled with the release
|
|
|
|
, fetchSubmodules ? false
|
2020-10-05 09:04:49 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-03-13 11:50:15 +00:00
|
|
|
sourceSha256 = "BiUDibXV/5cEYmAAaIxT4WTxF/ni4MJumF5oJ/vuOyc=";
|
2020-10-05 09:04:49 +00:00
|
|
|
featuresInfo = {
|
|
|
|
# Needed always
|
|
|
|
basic = {
|
|
|
|
native = [
|
|
|
|
cmake
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2020-10-05 09:04:49 +00:00
|
|
|
orc
|
|
|
|
];
|
|
|
|
runtime = [ boost log4cpp mpir ];
|
|
|
|
pythonNative = with python.pkgs; [ Mako six ];
|
|
|
|
};
|
|
|
|
volk = {
|
|
|
|
cmakeEnableFlag = "VOLK";
|
2021-03-13 11:50:15 +00:00
|
|
|
runtime = [
|
|
|
|
volk
|
|
|
|
];
|
2020-10-05 09:04:49 +00:00
|
|
|
};
|
|
|
|
doxygen = {
|
|
|
|
native = [ doxygen ];
|
|
|
|
cmakeEnableFlag = "DOXYGEN";
|
|
|
|
};
|
|
|
|
sphinx = {
|
|
|
|
pythonNative = with python.pkgs; [ sphinx ];
|
|
|
|
cmakeEnableFlag = "SPHINX";
|
|
|
|
};
|
|
|
|
python-support = {
|
|
|
|
pythonRuntime = [ python.pkgs.six ];
|
|
|
|
native = [
|
|
|
|
swig
|
|
|
|
python
|
|
|
|
];
|
|
|
|
cmakeEnableFlag = "PYTHON";
|
|
|
|
};
|
|
|
|
testing-support = {
|
|
|
|
native = [ cppunit ];
|
|
|
|
cmakeEnableFlag = "TESTING";
|
|
|
|
};
|
|
|
|
gnuradio-runtime = {
|
|
|
|
cmakeEnableFlag = "GNURADIO_RUNTIME";
|
|
|
|
};
|
|
|
|
gr-ctrlport = {
|
|
|
|
cmakeEnableFlag = "GR_CTRLPORT";
|
|
|
|
native = [
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
};
|
|
|
|
gnuradio-companion = {
|
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
pyyaml
|
|
|
|
cheetah
|
|
|
|
lxml
|
|
|
|
pygtk
|
|
|
|
numpy
|
|
|
|
# propagated by pygtk, but since wrapping is done externally, it help
|
|
|
|
# the wrapper if it's here
|
|
|
|
pycairo
|
|
|
|
pygobject2
|
|
|
|
];
|
|
|
|
runtime = [
|
|
|
|
gtk2
|
|
|
|
pango
|
|
|
|
cairo
|
|
|
|
];
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
gr-analog = {
|
|
|
|
cmakeEnableFlag = "GR_ANALOG";
|
|
|
|
};
|
|
|
|
gr-digital = {
|
|
|
|
cmakeEnableFlag = "GR_DIGITAL";
|
|
|
|
};
|
|
|
|
gr-dtv = {
|
|
|
|
cmakeEnableFlag = "GR_DTV";
|
|
|
|
};
|
|
|
|
gr-atsc = {
|
|
|
|
cmakeEnableFlag = "GR_ATSC";
|
|
|
|
};
|
|
|
|
gr-audio = {
|
|
|
|
runtime = []
|
2021-06-10 02:57:09 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ]
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreAudio ]
|
2020-10-05 09:04:49 +00:00
|
|
|
;
|
|
|
|
cmakeEnableFlag = "GR_AUDIO";
|
|
|
|
};
|
|
|
|
gr-comedi = {
|
|
|
|
runtime = [ comedilib ];
|
|
|
|
cmakeEnableFlag = "GR_COMEDI";
|
|
|
|
};
|
|
|
|
gr-channels = {
|
|
|
|
cmakeEnableFlag = "GR_CHANNELS";
|
|
|
|
};
|
|
|
|
gr-noaa = {
|
|
|
|
cmakeEnableFlag = "GR_NOAA";
|
|
|
|
};
|
|
|
|
gr-pager = {
|
|
|
|
cmakeEnableFlag = "GR_PAGER";
|
|
|
|
};
|
|
|
|
gr-qtgui = {
|
|
|
|
runtime = [ qt4 qwt6_qt4 ];
|
|
|
|
pythonRuntime = [ python.pkgs.pyqt4 ];
|
|
|
|
cmakeEnableFlag = "GR_QTGUI";
|
|
|
|
};
|
|
|
|
gr-trellis = {
|
|
|
|
cmakeEnableFlag = "GR_TRELLIS";
|
|
|
|
};
|
|
|
|
gr-uhd = {
|
|
|
|
runtime = [ uhd ];
|
|
|
|
cmakeEnableFlag = "GR_UHD";
|
|
|
|
};
|
|
|
|
gr-utils = {
|
|
|
|
cmakeEnableFlag = "GR_UTILS";
|
|
|
|
};
|
|
|
|
gr-video-sdl = {
|
|
|
|
runtime = [ SDL ];
|
|
|
|
cmakeEnableFlag = "GR_VIDEO_SDL";
|
|
|
|
};
|
|
|
|
gr-vocoder = {
|
|
|
|
runtime = [ codec2 gsm ];
|
|
|
|
cmakeEnableFlag = "GR_VOCODER";
|
|
|
|
};
|
|
|
|
gr-fcd = {
|
|
|
|
runtime = [ libusb1 ];
|
|
|
|
cmakeEnableFlag = "GR_FCD";
|
|
|
|
};
|
|
|
|
gr-wavelet = {
|
|
|
|
cmakeEnableFlag = "GR_WAVELET";
|
|
|
|
runtime = [ gsl ];
|
|
|
|
};
|
|
|
|
gr-zeromq = {
|
|
|
|
runtime = [ cppzmq zeromq ];
|
|
|
|
cmakeEnableFlag = "GR_ZEROMQ";
|
|
|
|
};
|
|
|
|
gr-wxgui = {
|
|
|
|
pythonRuntime = with python.pkgs; [ numpy wxPython ];
|
|
|
|
cmakeEnableFlag = "GR_WXGUI";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
shared = (import ./shared.nix {
|
|
|
|
inherit
|
2021-01-15 05:42:41 +00:00
|
|
|
lib
|
2020-10-05 09:04:49 +00:00
|
|
|
stdenv
|
|
|
|
python
|
|
|
|
removeReferencesTo
|
|
|
|
featuresInfo
|
|
|
|
features
|
|
|
|
versionAttr
|
|
|
|
sourceSha256
|
|
|
|
overrideSrc
|
|
|
|
fetchFromGitHub
|
|
|
|
fetchSubmodules
|
|
|
|
;
|
|
|
|
qt = qt4;
|
|
|
|
gtk = gtk2;
|
|
|
|
});
|
2021-03-13 11:50:15 +00:00
|
|
|
inherit (shared) hasFeature; # function
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname;
|
2020-10-05 09:04:49 +00:00
|
|
|
inherit (shared)
|
|
|
|
version
|
|
|
|
src
|
|
|
|
nativeBuildInputs
|
|
|
|
buildInputs
|
|
|
|
disallowedReferences
|
|
|
|
postInstall
|
|
|
|
doCheck
|
|
|
|
dontWrapPythonPrograms
|
|
|
|
meta
|
|
|
|
;
|
2020-10-16 20:31:20 +00: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;
|
2020-10-16 20:31:20 +00:00
|
|
|
} // lib.optionalAttrs (hasFeature "gr-uhd" features) {
|
|
|
|
inherit uhd;
|
|
|
|
};
|
2020-10-05 09:04:49 +00:00
|
|
|
cmakeFlags = shared.cmakeFlags
|
|
|
|
# From some reason, if these are not set, libcodec2 and gsm are
|
|
|
|
# not detected properly (slightly different then what's in
|
|
|
|
# ./default.nix).
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals (hasFeature "gr-vocoder" features) [
|
2020-10-05 09:04:49 +00:00
|
|
|
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
|
|
|
|
"-DLIBCODEC2_INCLUDE_DIR=${codec2}/include"
|
|
|
|
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
|
|
|
|
"-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm"
|
|
|
|
]
|
2021-03-13 11:50:15 +00:00
|
|
|
++ lib.optionals (hasFeature "volk" features && volk != null) [
|
|
|
|
"-DENABLE_INTERNAL_VOLK=OFF"
|
|
|
|
]
|
2020-10-05 09:04:49 +00:00
|
|
|
;
|
|
|
|
stripDebugList = shared.stripDebugList
|
|
|
|
# gr-fcd feature was dropped in 3.8
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals (hasFeature "gr-fcd" features) [ "share/gnuradio/examples/fcd" ]
|
2020-10-05 09:04:49 +00:00
|
|
|
;
|
2021-01-24 09:19:10 +00:00
|
|
|
preConfigure = ""
|
2020-10-05 09:04:49 +00:00
|
|
|
# wxgui and pygtk are not looked up properly, so we force them to be
|
|
|
|
# detected as found, if they are requested by the `features` attrset.
|
2021-01-15 05:42:41 +00:00
|
|
|
+ lib.optionalString (hasFeature "gr-wxgui" features) ''
|
2020-10-05 09:04:49 +00:00
|
|
|
sed -i 's/.*wx\.version.*/set(WX_FOUND TRUE)/g' gr-wxgui/CMakeLists.txt
|
|
|
|
''
|
2021-01-15 05:42:41 +00:00
|
|
|
+ lib.optionalString (hasFeature "gnuradio-companion" features) ''
|
2020-10-05 09:04:49 +00:00
|
|
|
sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt
|
|
|
|
''
|
|
|
|
;
|
|
|
|
patches = [
|
|
|
|
# Don't install python referencing files if python support is disabled.
|
|
|
|
# See: https://github.com/gnuradio/gnuradio/pull/3856
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnuradio/gnuradio/commit/acef55433d15c231661fa44751f9a2d90a4baa4b.diff";
|
|
|
|
sha256 = "2CEX44Ll8frfLXTIWjdDhKl7aXcjiAWsezVdwrynelE=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnuradio/gnuradio/commit/a2681edcfaabcb1ecf878ae861161b6a6bf8459d.diff";
|
|
|
|
sha256 = "2Pitgu8accs16B5X5+/q51hr+IY9DMsA15f56gAtBs8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|