gnuradio3_{7,8}: Use external volk

Now that volk is packaged, we can use our build and save some closure
space for those that have more then 1 version of gnuradio installed.
Also, simplify a bit how attributes are inherited in the expression.

+38 -74
+16 -33
pkgs/applications/radio/gnuradio/3.7.nix
··· 5 5 # Remove gcc and python references 6 6 , removeReferencesTo 7 7 , pkg-config 8 + , volk 8 9 , cppunit 9 10 , swig 10 11 , orc ··· 43 44 minor = "14"; 44 45 patch = "0"; 45 46 } 46 - , fetchSubmodules ? true 47 + # We use our build of volk and not the one bundled with the release 48 + , fetchSubmodules ? false 47 49 }: 48 50 49 51 let 50 - sourceSha256 = "1nh4f9dmygprlbqybd3j1byg9fsr6065n140mvc4b0v8qqygmhrc"; 52 + sourceSha256 = "BiUDibXV/5cEYmAAaIxT4WTxF/ni4MJumF5oJ/vuOyc="; 51 53 featuresInfo = { 52 54 # Needed always 53 55 basic = { ··· 61 63 }; 62 64 volk = { 63 65 cmakeEnableFlag = "VOLK"; 66 + runtime = [ 67 + volk 68 + ]; 64 69 }; 65 70 doxygen = { 66 71 native = [ doxygen ]; ··· 213 218 qt = qt4; 214 219 gtk = gtk2; 215 220 }); 221 + inherit (shared) hasFeature; # function 222 + in 223 + 224 + stdenv.mkDerivation rec { 225 + inherit pname; 216 226 inherit (shared) 217 227 version 218 228 src 219 - hasFeature # function 220 229 nativeBuildInputs 221 230 buildInputs 222 231 disallowedReferences ··· 228 237 229 238 passthru = shared.passthru // { 230 239 # Deps that are potentially overriden and are used inside GR plugins - the same version must 231 - inherit boost; 240 + inherit boost volk; 232 241 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 233 242 inherit uhd; 234 243 }; ··· 242 251 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 243 252 "-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm" 244 253 ] 254 + ++ lib.optionals (hasFeature "volk" features && volk != null) [ 255 + "-DENABLE_INTERNAL_VOLK=OFF" 256 + ] 245 257 ; 246 258 stripDebugList = shared.stripDebugList 247 259 # gr-fcd feature was dropped in 3.8 ··· 255 267 '' 256 268 + lib.optionalString (hasFeature "gnuradio-companion" features) '' 257 269 sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt 258 - '' 259 - # If python-support is disabled, don't install volk's (git submodule) 260 - # volk_modtool - it references python. 261 - # 262 - # NOTE: The same is done for 3.8, but we don't put this string in 263 - # ./shared.nix since on the next release of 3.8 it won't be needed there, 264 - # but it will be needed for 3.7, probably for ever. 265 - + lib.optionalString (!hasFeature "python-support" features) '' 266 - sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt 267 270 '' 268 271 ; 269 272 patches = [ ··· 278 281 sha256 = "2Pitgu8accs16B5X5+/q51hr+IY9DMsA15f56gAtBs8="; 279 282 }) 280 283 ]; 281 - in 282 - 283 - stdenv.mkDerivation rec { 284 - inherit 285 - pname 286 - version 287 - src 288 - nativeBuildInputs 289 - buildInputs 290 - cmakeFlags 291 - preConfigure 292 - # disallowedReferences 293 - stripDebugList 294 - patches 295 - postInstall 296 - passthru 297 - doCheck 298 - dontWrapPythonPrograms 299 - meta 300 - ; 301 284 }
+9 -35
pkgs/applications/radio/gnuradio/default.nix
··· 214 214 qt = qt5; 215 215 gtk = gtk3; 216 216 }); 217 + inherit (shared) hasFeature; # function 218 + in 219 + 220 + stdenv.mkDerivation rec { 221 + inherit pname; 217 222 inherit (shared) 218 223 version 219 224 src ··· 229 234 ; 230 235 passthru = shared.passthru // { 231 236 # Deps that are potentially overriden and are used inside GR plugins - the same version must 232 - inherit boost; 237 + inherit boost volk; 233 238 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 234 239 inherit uhd; 235 240 } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { ··· 246 251 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 247 252 "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" 248 253 ] 254 + ++ lib.optionals (hasFeature "volk" features && volk != null) [ 255 + "-DENABLE_INTERNAL_VOLK=OFF" 256 + ] 249 257 ; 250 258 251 259 postInstall = shared.postInstall ··· 255 263 ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake 256 264 '' 257 265 ; 258 - preConfigure = "" 259 - # If python-support is disabled, don't install volk's (git submodule) 260 - # volk_modtool - it references python. 261 - # 262 - # NOTE: on the next release, volk will always be required to be installed 263 - # externally (submodule removed upstream). Hence this hook will fail and 264 - # we'll need to package volk while able to tell it to install or not 265 - # install python referencing files. When we'll be there, this will help: 266 - # https://github.com/gnuradio/volk/pull/404 267 - + lib.optionalString (!hasFeature "python-support" features) '' 268 - sed -i -e "/python\/volk_modtool/d" volk/CMakeLists.txt 269 - '' 270 - ; 271 266 patches = [ 272 267 # Don't install python referencing files if python support is disabled. 273 268 # See: https://github.com/gnuradio/gnuradio/pull/3839 ··· 287 282 sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; 288 283 }) 289 284 ]; 290 - in 291 - 292 - stdenv.mkDerivation rec { 293 - inherit 294 - pname 295 - version 296 - src 297 - nativeBuildInputs 298 - buildInputs 299 - cmakeFlags 300 - preConfigure 301 - # disallowedReferences 302 - stripDebugList 303 - patches 304 - postInstall 305 - passthru 306 - doCheck 307 - dontWrapPythonPrograms 308 - dontWrapQtApps 309 - meta 310 - ; 311 285 }
-3
pkgs/applications/radio/gnuradio/shared.nix
··· 85 85 ; 86 86 postInstall = "" 87 87 # Gcc references 88 - + lib.optionalString (hasFeature "volk" features) '' 89 - ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so) 90 - '' 91 88 + lib.optionalString (hasFeature "gnuradio-runtime" features) '' 92 89 ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so) 93 90 ''
+4 -2
pkgs/development/gnuradio-modules/mkDerivation.nix
··· 17 17 args_ = { 18 18 enableParallelBuilding = args.enableParallelBuilding or true; 19 19 nativeBuildInputs = (args.nativeBuildInputs or []); 20 - # We add gnuradio itself by default 21 - buildInputs = (args.buildInputs or []) ++ [ unwrapped ]; 20 + # We add gnuradio and volk itself by default - most gnuradio based packages 21 + # will not consider it a depenency worth mentioning and it will almost 22 + # always be needed 23 + buildInputs = (args.buildInputs or []) ++ [ unwrapped unwrapped.volk ]; 22 24 }; 23 25 in mkDerivation (args // args_)
+7
pkgs/top-level/all-packages.nix
··· 22342 22342 gnuradioMinimal = gnuradio.override { 22343 22343 wrap = false; 22344 22344 unwrapped = gnuradio.unwrapped.override { 22345 + volk = volk.override { 22346 + # So it will not reference python 22347 + enableModTool = false; 22348 + }; 22345 22349 features = { 22346 22350 gnuradio-companion = false; 22347 22351 python-support = false; ··· 22368 22372 gnuradio3_7Minimal = gnuradio3_7.override { 22369 22373 wrap = false; 22370 22374 unwrapped = gnuradio3_7.unwrapped.override { 22375 + volk = volk.override { 22376 + enableModTool = false; 22377 + }; 22371 22378 features = { 22372 22379 gnuradio-companion = false; 22373 22380 python-support = false;
+2 -1
pkgs/top-level/gnuradio-packages.nix
··· 16 16 17 17 callPackage = self.newScope { 18 18 inherit (gnuradio) 19 - # Packages that are potentially overriden and commonly 19 + # Packages that are potentially overriden and used as deps here. 20 20 boost 21 21 uhd 22 + volk 22 23 ; 23 24 inherit mkDerivationWith mkDerivation; 24 25 };