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
|
2020-04-03 16:41:41 +01:00
|
|
|
, cppunit
|
2020-10-05 10:04:49 +01:00
|
|
|
, swig
|
|
|
|
, 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
|
|
|
|
, alsaLib
|
|
|
|
, libjack2
|
|
|
|
, CoreAudio
|
2013-05-02 11:44:36 +01:00
|
|
|
, uhd
|
|
|
|
, SDL
|
2020-10-05 10:04:49 +01:00
|
|
|
, gsl
|
|
|
|
, 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 ? {
|
|
|
|
major = "3.8";
|
|
|
|
minor = "2";
|
|
|
|
patch = "0";
|
|
|
|
}
|
|
|
|
# Should be false on the release after 3.8.2.0
|
|
|
|
, fetchSubmodules ? true
|
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
|
|
|
|
sourceSha256 = "1mnfwdy7w3160vi6110x2qkyq8l78qi8771zwak9n72bl7lhhpnf";
|
|
|
|
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 = [
|
|
|
|
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
|
|
|
|
++ lib.optionals (!(hasFeature "gr-qtgui" features)) [ icu ];
|
2020-10-05 10:04:49 +01:00
|
|
|
pythonNative = with python.pkgs; [
|
|
|
|
Mako
|
|
|
|
six
|
|
|
|
];
|
|
|
|
};
|
|
|
|
# NOTE: Should be removed on the release after 3.8.2.0, see:
|
|
|
|
# https://github.com/gnuradio/gnuradio/commit/80c04479d
|
|
|
|
volk = {
|
|
|
|
cmakeEnableFlag = "VOLK";
|
|
|
|
};
|
|
|
|
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 = {
|
|
|
|
# Thrift support is not really working well, and even the patch they
|
|
|
|
# recommend applying on 0.9.2 won't apply. See:
|
|
|
|
# https://github.com/gnuradio/gnuradio/blob/v3.8.2.0/gnuradio-runtime/lib/controlport/thrift/README
|
|
|
|
cmakeEnableFlag = "GR_CTRLPORT";
|
|
|
|
native = [
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
};
|
|
|
|
gnuradio-companion = {
|
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
pyyaml
|
|
|
|
Mako
|
|
|
|
numpy
|
|
|
|
pygobject3
|
|
|
|
];
|
|
|
|
runtime = [
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
gobject-introspection
|
|
|
|
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-audio = {
|
|
|
|
runtime = []
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ alsaLib libjack2 ]
|
|
|
|
++ 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";
|
|
|
|
};
|
|
|
|
gr-utils = {
|
|
|
|
cmakeEnableFlag = "GR_UTILS";
|
|
|
|
};
|
|
|
|
gr-modtool = {
|
|
|
|
pythonRuntime = with python.pkgs; [
|
|
|
|
click
|
|
|
|
click-plugins
|
|
|
|
];
|
|
|
|
cmakeEnableFlag = "GR_MODTOOL";
|
|
|
|
};
|
|
|
|
gr-video-sdl = {
|
|
|
|
runtime = [ SDL ];
|
|
|
|
cmakeEnableFlag = "GR_VIDEO_SDL";
|
|
|
|
};
|
|
|
|
gr-vocoder = {
|
|
|
|
runtime = [ codec2 gsm ];
|
|
|
|
cmakeEnableFlag = "GR_VOCODER";
|
|
|
|
};
|
|
|
|
gr-wavelet = {
|
|
|
|
cmakeEnableFlag = "GR_WAVELET";
|
|
|
|
runtime = [ gsl ];
|
|
|
|
};
|
|
|
|
gr-zeromq = {
|
|
|
|
runtime = [ cppzmq zeromq ];
|
|
|
|
cmakeEnableFlag = "GR_ZEROMQ";
|
|
|
|
};
|
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
|
|
|
|
fetchSubmodules
|
|
|
|
;
|
|
|
|
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
|
|
|
|
hasFeature # function
|
|
|
|
nativeBuildInputs
|
|
|
|
buildInputs
|
|
|
|
disallowedReferences
|
|
|
|
stripDebugList
|
|
|
|
doCheck
|
|
|
|
dontWrapPythonPrograms
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps
|
2020-10-05 10:04:49 +01:00
|
|
|
meta
|
|
|
|
;
|
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;
|
2020-10-16 21:31:20 +01:00
|
|
|
} // lib.optionalAttrs (hasFeature "gr-uhd" features) {
|
|
|
|
inherit uhd;
|
|
|
|
} // lib.optionalAttrs (hasFeature "gr-qtgui" features) {
|
|
|
|
inherit (libsForQt5) qwt;
|
|
|
|
};
|
2020-10-05 10:04:49 +01:00
|
|
|
cmakeFlags = shared.cmakeFlags
|
|
|
|
# From some reason, if these are not set, libcodec2 and gsm are not
|
|
|
|
# detected properly. NOTE: qradiolink needs libcodec2 to be detected in
|
|
|
|
# order to build, see https://github.com/qradiolink/qradiolink/issues/67
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optionals (hasFeature "gr-vocoder" features) [
|
2020-10-05 10:04:49 +01:00
|
|
|
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
|
|
|
|
"-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include"
|
|
|
|
"-DLIBCODEC2_HAS_FREEDV_API=ON"
|
|
|
|
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
|
|
|
|
"-DLIBGSM_INCLUDE_DIRS=${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 10:04:49 +01:00
|
|
|
;
|
2013-05-02 11:44:36 +01:00
|
|
|
|
2020-10-05 10:04:49 +01:00
|
|
|
postInstall = shared.postInstall
|
|
|
|
# This is the only python reference worth removing, if needed (3.7 doesn't
|
|
|
|
# set that reference).
|
2021-01-15 05:42:41 +00:00
|
|
|
+ lib.optionalString (!hasFeature "python-support" features) ''
|
2020-10-05 10:04:49 +01:00
|
|
|
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
|
|
|
|
''
|
|
|
|
;
|
|
|
|
patches = [
|
|
|
|
# Don't install python referencing files if python support is disabled.
|
|
|
|
# See: https://github.com/gnuradio/gnuradio/pull/3839
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnuradio/gnuradio/commit/4a4fd570b398b0b50fe875fcf0eb9c9db2ea5c6e.diff";
|
|
|
|
sha256 = "xz2E0ji6zfdOAhjfPecAcaVOIls1XP8JngLkBbBBW5Q=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnuradio/gnuradio/commit/dbc8ad7e7361fddc7b1dbc267c07a776a3f9664b.diff";
|
|
|
|
sha256 = "tQcCpcUbJv3yqAX8rSHN/pAuBq4ueEvoVo7sNzZGvf4=";
|
|
|
|
})
|
2021-02-24 21:03:45 +00:00
|
|
|
# Needed to use boost 1.7x, see:
|
|
|
|
# https://github.com/gnuradio/gnuradio/issues/3720
|
|
|
|
# https://github.com/gnuradio/gnuradio/pull/3967
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gnuradio/gnuradio/commit/cbcb968358fad56f3646619b258f18b0e6693a07.diff";
|
|
|
|
sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v";
|
|
|
|
})
|
2020-10-05 10:04:49 +01:00
|
|
|
];
|
2013-05-02 11:44:36 +01:00
|
|
|
}
|