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

glibcLocales: use more than one core to build
This commit is contained in:
Maximilian Bosch 2023-06-17 14:55:40 +02:00 committed by GitHub
commit 1f72072bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,8 +10,9 @@
, allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
}:
callPackage ./common.nix { inherit stdenv; } {
(callPackage ./common.nix { inherit stdenv; } {
pname = "glibc-locales";
}).overrideAttrs(finalAttrs: previousAttrs: {
builder = ./locales-builder.sh;
@ -25,7 +26,7 @@ callPackage ./common.nix { inherit stdenv; } {
else "--big-endian")
];
buildPhase = ''
preBuild = (previousAttrs.preBuild or "") + ''
# Awful hack: `localedef' doesn't allow the path to `locale-archive'
# to be overriden, but you *can* specify a prefix, i.e. it will use
# <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use
@ -57,11 +58,15 @@ callPackage ./common.nix { inherit stdenv; } {
fi
echo SUPPORTED-LOCALES='${toString locales}' > ../glibc-2*/localedata/SUPPORTED
'' + ''
make localedata/install-locales \
localedir=$out/lib/locale \
'';
makeFlags = (previousAttrs.makeFlags or []) ++ [
"localedata/install-locales"
"localedir=${builtins.placeholder "out"}/lib/locale"
] ++ lib.optionals finalAttrs.finalPackage.enableParallelInstalling [
"PARALLELMFLAGS=-j$(NIX_BUILD_CORES)"
];
installPhase =
''
mkdir -p "$out/lib/locale" "$out/share/i18n"
@ -75,4 +80,4 @@ callPackage ./common.nix { inherit stdenv; } {
'';
meta.description = "Locale information for the GNU C Library";
}
})