5 # Remove gcc and python references
32 # Needed only if qt-gui is disabled, from some reason
37 , gobject-introspection
41 # Features available to override, the list of them is in featuresInfo. They
42 # are all turned on by default.
44 # If one wishes to use a different src or name for a very custom build
47 , version ? "3.10.11.0"
51 sourceSha256 = "sha256-QOZXUj+ZmfpazsrHEs8Gx3WSmoHG/zO43NEpyhIjpN8=";
66 # when gr-qtgui is disabled, icu needs to be included, otherwise
67 # building with boost 1.7x fails
68 ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ];
69 pythonNative = with python.pkgs; [
76 cmakeEnableFlag = "DOXYGEN";
79 cmakeEnableFlag = "MANPAGES";
82 pythonRuntime = [ python.pkgs.six ];
86 cmakeEnableFlag = "PYTHON";
90 cmakeEnableFlag = "TESTING";
93 cmakeEnableFlag = "POSTINSTALL";
96 cmakeEnableFlag = "GNURADIO_RUNTIME";
108 # For gr-perf-monitorx
109 python.pkgs.matplotlib
112 cmakeEnableFlag = "GR_CTRLPORT";
114 gnuradio-companion = {
115 pythonRuntime = with python.pkgs; [
127 gobject-introspection
131 cmakeEnableFlag = "GRC";
135 python.pkgs.jsonschema
137 cmakeEnableFlag = "JSONYAML_BLOCKS";
140 cmakeEnableFlag = "GR_BLOCKS";
142 # Required to compile wavfile blocks.
147 cmakeEnableFlag = "GR_FEC";
150 runtime = [ fftwFloat ];
151 cmakeEnableFlag = "GR_FFT";
154 runtime = [ fftwFloat ];
155 cmakeEnableFlag = "GR_FILTER";
156 pythonRuntime = with python.pkgs; [
163 cmakeEnableFlag = "GR_ANALOG";
166 cmakeEnableFlag = "GR_DIGITAL";
169 cmakeEnableFlag = "GR_DTV";
173 ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libjack2 ]
175 cmakeEnableFlag = "GR_AUDIO";
178 cmakeEnableFlag = "GR_CHANNELS";
181 cmakeEnableFlag = "GR_PDU";
188 cmakeEnableFlag = "GR_IIO";
193 common-precompiled-headers = {
194 cmakeEnableFlag = "COMMON_PCH";
197 runtime = [ qt5.qtbase libsForQt5.qwt ];
198 pythonRuntime = [ python.pkgs.pyqt5 ];
199 cmakeEnableFlag = "GR_QTGUI";
202 cmakeEnableFlag = "GR_TRELLIS";
208 cmakeEnableFlag = "GR_UHD";
214 cmakeEnableFlag = "UHD_RFNOC";
217 cmakeEnableFlag = "GR_UTILS";
218 pythonRuntime = with python.pkgs; [
224 pythonRuntime = with python.pkgs; [
230 cmakeEnableFlag = "GR_MODTOOL";
233 cmakeEnableFlag = "GR_BLOCKTOOL";
237 cmakeEnableFlag = "GR_VIDEO_SDL";
240 runtime = [ codec2 gsm ];
241 cmakeEnableFlag = "GR_VOCODER";
244 cmakeEnableFlag = "GR_WAVELET";
245 runtime = [ gsl libsodium ];
248 runtime = [ cppzmq ];
249 cmakeEnableFlag = "GR_ZEROMQ";
251 # Will compile without this, but it is required by tests, and by some
257 cmakeEnableFlag = "GR_NETWORK";
260 cmakeEnableFlag = "GR_SOAPY";
266 shared = (import ./shared.nix {
282 inherit (shared.passthru) hasFeature; # function
285 stdenv.mkDerivation (finalAttrs: (shared // {
286 inherit pname version;
287 # Will still evaluate correctly if not used here. It only helps nix-update
288 # find the right file in which version is defined.
289 inherit (shared) src;
291 # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227
292 ./modtool-newmod-permissions.patch
293 # https://github.com/gnuradio/gnuradio/issues/7458
295 name = "gnuradio-numpy_2-compatibility.patch";
296 url = "https://github.com/gnuradio/gnuradio/commit/8fbc5eb4b7214a4cb029ccae97205a85d49bdd48.patch";
297 hash = "sha256-xYvjlyZ/Bcn23gT3EOee/GhkXzdpA+q33LgURVWOUQI=";
300 passthru = shared.passthru // {
301 # Deps that are potentially overridden and are used inside GR plugins - the same version must
306 # Used by many gnuradio modules, the same attribute is present in
307 # previous gnuradio versions where there it's log4cpp.
309 } // lib.optionalAttrs (hasFeature "gr-uhd") {
311 } // lib.optionalAttrs (hasFeature "gr-pdu") {
312 inherit libiio libad9361;
313 } // lib.optionalAttrs (hasFeature "gr-qtgui") {
314 inherit (libsForQt5) qwt;
317 postInstall = shared.postInstall
318 # This is the only python reference worth removing, if needed.
319 + lib.optionalString (!hasFeature "python-support") ''
320 remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
321 remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
322 remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake