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