Merge pull request #238027 from amjoseph-nixpkgs/pr/glibc/parallel

glibcLocales: use more than one core to build

authored by Maximilian Bosch and committed by GitHub 1f72072b 67a40870

+11 -6
+11 -6
pkgs/development/libraries/glibc/locales.nix
··· 10 10 , allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ] 11 11 }: 12 12 13 - callPackage ./common.nix { inherit stdenv; } { 13 + (callPackage ./common.nix { inherit stdenv; } { 14 14 pname = "glibc-locales"; 15 + }).overrideAttrs(finalAttrs: previousAttrs: { 15 16 16 17 builder = ./locales-builder.sh; 17 18 ··· 25 26 else "--big-endian") 26 27 ]; 27 28 28 - buildPhase = '' 29 + preBuild = (previousAttrs.preBuild or "") + '' 29 30 # Awful hack: `localedef' doesn't allow the path to `locale-archive' 30 31 # to be overriden, but you *can* specify a prefix, i.e. it will use 31 32 # <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use ··· 57 58 fi 58 59 59 60 echo SUPPORTED-LOCALES='${toString locales}' > ../glibc-2*/localedata/SUPPORTED 60 - '' + '' 61 - make localedata/install-locales \ 62 - localedir=$out/lib/locale \ 63 61 ''; 64 62 63 + makeFlags = (previousAttrs.makeFlags or []) ++ [ 64 + "localedata/install-locales" 65 + "localedir=${builtins.placeholder "out"}/lib/locale" 66 + ] ++ lib.optionals finalAttrs.finalPackage.enableParallelInstalling [ 67 + "PARALLELMFLAGS=-j$(NIX_BUILD_CORES)" 68 + ]; 69 + 65 70 installPhase = 66 71 '' 67 72 mkdir -p "$out/lib/locale" "$out/share/i18n" ··· 75 80 ''; 76 81 77 82 meta.description = "Locale information for the GNU C Library"; 78 - } 83 + })