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 # Remove gcc and python references 6 , removeReferencesTo 7 , pkg-config 8 , cppunit 9 , swig 10 , orc ··· 43 minor = "14"; 44 patch = "0"; 45 } 46 - , fetchSubmodules ? true 47 }: 48 49 let 50 - sourceSha256 = "1nh4f9dmygprlbqybd3j1byg9fsr6065n140mvc4b0v8qqygmhrc"; 51 featuresInfo = { 52 # Needed always 53 basic = { ··· 61 }; 62 volk = { 63 cmakeEnableFlag = "VOLK"; 64 }; 65 doxygen = { 66 native = [ doxygen ]; ··· 213 qt = qt4; 214 gtk = gtk2; 215 }); 216 inherit (shared) 217 version 218 src 219 - hasFeature # function 220 nativeBuildInputs 221 buildInputs 222 disallowedReferences ··· 228 229 passthru = shared.passthru // { 230 # Deps that are potentially overriden and are used inside GR plugins - the same version must 231 - inherit boost; 232 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 233 inherit uhd; 234 }; ··· 242 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 243 "-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm" 244 ] 245 ; 246 stripDebugList = shared.stripDebugList 247 # gr-fcd feature was dropped in 3.8 ··· 255 '' 256 + lib.optionalString (hasFeature "gnuradio-companion" features) '' 257 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 '' 268 ; 269 patches = [ ··· 278 sha256 = "2Pitgu8accs16B5X5+/q51hr+IY9DMsA15f56gAtBs8="; 279 }) 280 ]; 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 }
··· 5 # Remove gcc and python references 6 , removeReferencesTo 7 , pkg-config 8 + , volk 9 , cppunit 10 , swig 11 , orc ··· 44 minor = "14"; 45 patch = "0"; 46 } 47 + # We use our build of volk and not the one bundled with the release 48 + , fetchSubmodules ? false 49 }: 50 51 let 52 + sourceSha256 = "BiUDibXV/5cEYmAAaIxT4WTxF/ni4MJumF5oJ/vuOyc="; 53 featuresInfo = { 54 # Needed always 55 basic = { ··· 63 }; 64 volk = { 65 cmakeEnableFlag = "VOLK"; 66 + runtime = [ 67 + volk 68 + ]; 69 }; 70 doxygen = { 71 native = [ doxygen ]; ··· 218 qt = qt4; 219 gtk = gtk2; 220 }); 221 + inherit (shared) hasFeature; # function 222 + in 223 + 224 + stdenv.mkDerivation rec { 225 + inherit pname; 226 inherit (shared) 227 version 228 src 229 nativeBuildInputs 230 buildInputs 231 disallowedReferences ··· 237 238 passthru = shared.passthru // { 239 # Deps that are potentially overriden and are used inside GR plugins - the same version must 240 + inherit boost volk; 241 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 242 inherit uhd; 243 }; ··· 251 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 252 "-DLIBGSM_INCLUDE_DIR=${gsm}/include/gsm" 253 ] 254 + ++ lib.optionals (hasFeature "volk" features && volk != null) [ 255 + "-DENABLE_INTERNAL_VOLK=OFF" 256 + ] 257 ; 258 stripDebugList = shared.stripDebugList 259 # gr-fcd feature was dropped in 3.8 ··· 267 '' 268 + lib.optionalString (hasFeature "gnuradio-companion" features) '' 269 sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt 270 '' 271 ; 272 patches = [ ··· 281 sha256 = "2Pitgu8accs16B5X5+/q51hr+IY9DMsA15f56gAtBs8="; 282 }) 283 ]; 284 }
+9 -35
pkgs/applications/radio/gnuradio/default.nix
··· 214 qt = qt5; 215 gtk = gtk3; 216 }); 217 inherit (shared) 218 version 219 src ··· 229 ; 230 passthru = shared.passthru // { 231 # Deps that are potentially overriden and are used inside GR plugins - the same version must 232 - inherit boost; 233 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 234 inherit uhd; 235 } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { ··· 246 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 247 "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" 248 ] 249 ; 250 251 postInstall = shared.postInstall ··· 255 ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake 256 '' 257 ; 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 patches = [ 272 # Don't install python referencing files if python support is disabled. 273 # See: https://github.com/gnuradio/gnuradio/pull/3839 ··· 287 sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; 288 }) 289 ]; 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 }
··· 214 qt = qt5; 215 gtk = gtk3; 216 }); 217 + inherit (shared) hasFeature; # function 218 + in 219 + 220 + stdenv.mkDerivation rec { 221 + inherit pname; 222 inherit (shared) 223 version 224 src ··· 234 ; 235 passthru = shared.passthru // { 236 # Deps that are potentially overriden and are used inside GR plugins - the same version must 237 + inherit boost volk; 238 } // lib.optionalAttrs (hasFeature "gr-uhd" features) { 239 inherit uhd; 240 } // lib.optionalAttrs (hasFeature "gr-qtgui" features) { ··· 251 "-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so" 252 "-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm" 253 ] 254 + ++ lib.optionals (hasFeature "volk" features && volk != null) [ 255 + "-DENABLE_INTERNAL_VOLK=OFF" 256 + ] 257 ; 258 259 postInstall = shared.postInstall ··· 263 ${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake 264 '' 265 ; 266 patches = [ 267 # Don't install python referencing files if python support is disabled. 268 # See: https://github.com/gnuradio/gnuradio/pull/3839 ··· 282 sha256 = "1ajf4797f869lqv436xw61s29qdbn7f01i0970kfxv3yahd34p9v"; 283 }) 284 ]; 285 }
-3
pkgs/applications/radio/gnuradio/shared.nix
··· 85 ; 86 postInstall = "" 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 + lib.optionalString (hasFeature "gnuradio-runtime" features) '' 92 ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so) 93 ''
··· 85 ; 86 postInstall = "" 87 # Gcc references 88 + lib.optionalString (hasFeature "gnuradio-runtime" features) '' 89 ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so) 90 ''
+4 -2
pkgs/development/gnuradio-modules/mkDerivation.nix
··· 17 args_ = { 18 enableParallelBuilding = args.enableParallelBuilding or true; 19 nativeBuildInputs = (args.nativeBuildInputs or []); 20 - # We add gnuradio itself by default 21 - buildInputs = (args.buildInputs or []) ++ [ unwrapped ]; 22 }; 23 in mkDerivation (args // args_)
··· 17 args_ = { 18 enableParallelBuilding = args.enableParallelBuilding or true; 19 nativeBuildInputs = (args.nativeBuildInputs or []); 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 ]; 24 }; 25 in mkDerivation (args // args_)
+7
pkgs/top-level/all-packages.nix
··· 22342 gnuradioMinimal = gnuradio.override { 22343 wrap = false; 22344 unwrapped = gnuradio.unwrapped.override { 22345 features = { 22346 gnuradio-companion = false; 22347 python-support = false; ··· 22368 gnuradio3_7Minimal = gnuradio3_7.override { 22369 wrap = false; 22370 unwrapped = gnuradio3_7.unwrapped.override { 22371 features = { 22372 gnuradio-companion = false; 22373 python-support = false;
··· 22342 gnuradioMinimal = gnuradio.override { 22343 wrap = false; 22344 unwrapped = gnuradio.unwrapped.override { 22345 + volk = volk.override { 22346 + # So it will not reference python 22347 + enableModTool = false; 22348 + }; 22349 features = { 22350 gnuradio-companion = false; 22351 python-support = false; ··· 22372 gnuradio3_7Minimal = gnuradio3_7.override { 22373 wrap = false; 22374 unwrapped = gnuradio3_7.unwrapped.override { 22375 + volk = volk.override { 22376 + enableModTool = false; 22377 + }; 22378 features = { 22379 gnuradio-companion = false; 22380 python-support = false;
+2 -1
pkgs/top-level/gnuradio-packages.nix
··· 16 17 callPackage = self.newScope { 18 inherit (gnuradio) 19 - # Packages that are potentially overriden and commonly 20 boost 21 uhd 22 ; 23 inherit mkDerivationWith mkDerivation; 24 };
··· 16 17 callPackage = self.newScope { 18 inherit (gnuradio) 19 + # Packages that are potentially overriden and used as deps here. 20 boost 21 uhd 22 + volk 23 ; 24 inherit mkDerivationWith mkDerivation; 25 };