about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/glibc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-08-08 16:04:42 +0000
committerAlyssa Ross <hi@alyssa.is>2023-08-13 06:35:37 +0000
commit12aaa58dac35800b5b7d77f81cf2a87c21ee55da (patch)
treebe0add9e5c22a85d20b5d78206aa74f956eb2a1b /nixpkgs/pkgs/development/libraries/glibc
parent45892a5591202f75a1c2f1ca7c62a92c7566e3c5 (diff)
parent5a8e9243812ba528000995b294292d3b5e120947 (diff)
downloadnixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.gz
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.bz2
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.lz
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.xz
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.tar.zst
nixlib-12aaa58dac35800b5b7d77f81cf2a87c21ee55da.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/go/module.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/libraries/mesa/default.nix
	nixpkgs/pkgs/servers/dict/dictd-db.nix

Link: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/391
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glibc')
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/common.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/info.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/locales.nix17
4 files changed, 24 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glibc/common.nix b/nixpkgs/pkgs/development/libraries/glibc/common.nix
index 00b78f57db61..f98c0eb1c348 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/common.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/common.nix
@@ -161,14 +161,22 @@ stdenv.mkDerivation ({
     ++ lib.optional withGd "--with-gd"
     ++ lib.optional (!withLibcrypt) "--disable-crypt";
 
-  makeFlags = [
+  makeFlags = (args.makeFlags or []) ++ [
     "OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
   ];
 
+  postInstall = (args.postInstall or "") + ''
+    moveToOutput bin/getent $getent
+  '';
+
   installFlags = [ "sysconfdir=$(out)/etc" ];
 
   # out as the first output is an exception exclusive to glibc
-  outputs = [ "out" "bin" "dev" "static" ];
+
+  # getent is its own output, not kept in bin, since many things
+  # depend on getent but not on the locale generation tools in the bin
+  # output. This saves a couple of megabytes of closure size in many cases.
+  outputs = [ "out" "bin" "dev" "static" "getent" ];
 
   strictDeps = true;
   depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -188,7 +196,7 @@ stdenv.mkDerivation ({
   passthru = { inherit version; minorRelease = version; };
 }
 
-// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) //
+// (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" "makeFlags" ]) //
 
 {
   src = fetchurl {
diff --git a/nixpkgs/pkgs/development/libraries/glibc/default.nix b/nixpkgs/pkgs/development/libraries/glibc/default.nix
index 1c0c1b09e154..0f6cad157bb7 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/default.nix
@@ -94,7 +94,7 @@ in
         "user-defined-trusted-dirs=${stdenv.cc.cc.libgcc}/lib"
       ];
 
-    postInstall = (if stdenv.hostPlatform == stdenv.buildPlatform then ''
+    postInstall = previousAttrs.postInstall + (if stdenv.hostPlatform == stdenv.buildPlatform then ''
       echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED
       make -j''${NIX_BUILD_CORES:-1} localedata/install-locales
     '' else lib.optionalString stdenv.buildPlatform.isLinux ''
diff --git a/nixpkgs/pkgs/development/libraries/glibc/info.nix b/nixpkgs/pkgs/development/libraries/glibc/info.nix
index 04b0dc00a894..d643d8a6ba09 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/info.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/info.nix
@@ -9,7 +9,7 @@ callPackage ./common.nix {} {
 
   extraNativeBuildInputs = [ texinfo perl ];
 
-  buildPhase = "make info";
+  makeFlags = [ "info" ];
 
   # I don't know why the info is not generated in 'build'
   # Somehow building the info still does not work, because the final
diff --git a/nixpkgs/pkgs/development/libraries/glibc/locales.nix b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
index ed6f0a5b32ca..86d6d1438b2d 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/locales.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
@@ -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 \
     '';
 
+  enableParallelBuilding = true;
+
+  makeFlags = (previousAttrs.makeFlags or []) ++ [
+    "localedata/install-locales"
+    "localedir=${builtins.placeholder "out"}/lib/locale"
+  ];
+
   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";
-}
+})