From 5e24fccba45a7c72aff47cdbe305182352623124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 22 Jan 2019 21:14:05 +0000 Subject: [PATCH 1/2] glibc: remove installLocales argument Since we now install a sane default this should be no longer necessary. If it is still needed, it should be easy enough to do this in an overlay. --- pkgs/development/libraries/glibc/common.nix | 3 +-- pkgs/development/libraries/glibc/default.nix | 3 +-- pkgs/development/libraries/glibc/locales.nix | 2 -- pkgs/top-level/all-packages.nix | 6 +----- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 50d8c6e268c2..2e06af2c5948 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -28,7 +28,6 @@ { name , withLinuxHeaders ? false , profilingLibraries ? false -, installLocales ? false , withGd ? false , meta , ... @@ -44,7 +43,7 @@ assert withLinuxHeaders -> linuxHeaders != null; assert withGd -> gd != null && libpng != null; stdenv.mkDerivation ({ - inherit version installLocales; + inherit version; linuxHeaders = if withLinuxHeaders then linuxHeaders else null; inherit (stdenv) is64bit; diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 27a1267f0cfe..5d04337f732a 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -1,6 +1,5 @@ { stdenv, callPackage , withLinuxHeaders ? true -, installLocales ? true , profilingLibraries ? false , withGd ? false }: @@ -8,7 +7,7 @@ callPackage ./common.nix { inherit stdenv; } { name = "glibc" + stdenv.lib.optionalString withGd "-gd"; - inherit withLinuxHeaders profilingLibraries installLocales withGd; + inherit withLinuxHeaders profilingLibraries withGd; # Note: # Things you write here override, and do not add to, diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index 7090c5ceceec..2b20c17d4500 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -13,8 +13,6 @@ callPackage ./common.nix { inherit stdenv; } { name = "glibc-locales"; - installLocales = true; - builder = ./locales-builder.sh; outputs = [ "out" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3cc3a4626c91..7c92c3b11553 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9955,9 +9955,7 @@ in inherit (darwin.apple_sdk.frameworks) Cocoa Kernel; }; - glibc = callPackage ../development/libraries/glibc { - installLocales = config.glibc.locales or false; - }; + glibc = callPackage ../development/libraries/glibc { }; # Provided by libc on Operating Systems that use the Extensible Linker Format. elf-header = @@ -9968,13 +9966,11 @@ in elf-header-real = callPackage ../development/libraries/elf-header { }; glibc_memusage = callPackage ../development/libraries/glibc { - installLocales = false; withGd = true; }; # Being redundant to avoid cycles on boot. TODO: find a better way glibcCross = callPackage ../development/libraries/glibc { - installLocales = config.glibc.locales or false; stdenv = crossLibcStdenv; }; From d966f31f23b5cb37c0e6bd8553f8503c0465f205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 22 Jan 2019 22:08:44 +0000 Subject: [PATCH 2/2] glibc: add support for C.utf-8 --- pkgs/development/libraries/glibc/common.nix | 5 +++++ pkgs/development/libraries/glibc/default.nix | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 2e06af2c5948..7e99a0c18d7d 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -87,6 +87,11 @@ stdenv.mkDerivation ({ less linux-*?/arch/x86/kernel/syscall_table_32.S */ ./allow-kernel-2.6.32.patch + /* Provide utf-8 locales by default, so we can use it in stdenv without depending on our large locale-archive. */ + (fetchurl { + url = "https://salsa.debian.org/glibc-team/glibc/raw/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff"; + sha256 = "0irj60hs2i91ilwg5w7sqrxb695c93xg0ik7yhhq9irprd7fidn4"; + }) ] ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch; diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 5d04337f732a..e46985d3fca8 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -56,9 +56,8 @@ callPackage ./common.nix { inherit stdenv; } { ''; postInstall = '' - if test -n "$installLocales"; then - make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales - fi + echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED + make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache