octave.withPackages: fix null reference on darwin (#447122)

authored by 7c6f434c and committed by GitHub 303f46aa bf0c37a7

Changed files
+15 -3
pkgs
development
interpreters
+8 -3
pkgs/development/interpreters/octave/build-env.nix
··· 19 19 let 20 20 packages = computeRequiredOctavePackages extraLibs; 21 21 22 + # glibcLocalesUtf8 is null on darwin 23 + localeArchiveArgs = lib.optionalString (glibcLocalesUtf8 != null) '' 24 + --set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive" 25 + ''; 26 + 22 27 in 23 28 buildEnv { 24 29 name = "${octave.name}-env"; ··· 47 52 if [ -x $prg ]; then 48 53 makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" \ 49 54 --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" \ 50 - --set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive" 55 + ${localeArchiveArgs} 51 56 fi 52 57 done 53 58 cd $out ··· 87 92 '' 88 93 + postBuild; 89 94 90 - inherit (octave) meta; 95 + inherit (octave) meta version; 91 96 92 - passthru = octave.passthru // { 97 + passthru = (removeAttrs octave.passthru [ "tests" ]) // { 93 98 interpreter = "$out/bin/octave"; 94 99 inherit octave; 95 100 env = stdenv.mkDerivation {
+7
pkgs/development/interpreters/octave/default.nix
··· 7 7 ncurses, 8 8 perl, 9 9 flex, 10 + testers, 10 11 texinfo, 11 12 qhull, 12 13 libsndfile, ··· 226 227 withPackages = import ./with-packages.nix { inherit buildEnv octavePackages; }; 227 228 pkgs = octavePackages; 228 229 interpreter = "${finalAttrs.finalPackage}/bin/octave"; 230 + tests = { 231 + wrapper = testers.testVersion { 232 + package = finalAttrs.finalPackage.withPackages (ps: [ ps.doctest ]); 233 + command = "octave --version"; 234 + }; 235 + }; 229 236 }; 230 237 231 238 meta = {