Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibcLocales: use more than one core to build #238027

Merged
merged 2 commits into from Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/development/libraries/glibc/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ stdenv.mkDerivation ({
++ lib.optional withGd "--with-gd"
++ lib.optional (!withLibcrypt) "--disable-crypt";

makeFlags = [
makeFlags = (args.makeFlags or []) ++ [
"OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
];

Expand Down Expand Up @@ -196,7 +196,7 @@ stdenv.mkDerivation ({
passthru = { inherit version; minorRelease = version; };
}

// (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" ]) //
// (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" "makeFlags" ]) //

{
src = fetchurl {
Expand Down
17 changes: 11 additions & 6 deletions pkgs/development/libraries/glibc/locales.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -75,4 +80,4 @@ callPackage ./common.nix { inherit stdenv; } {
'';

meta.description = "Locale information for the GNU C Library";
}
})