glibcLocales: support building on musl (#141971)

This commit is contained in:
Yuka 2021-10-18 08:53:36 +02:00 committed by GitHub
parent cd90002904
commit ba06497904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -37,6 +37,8 @@
, profilingLibraries ? false
, withGd ? false
, meta
, extraBuildInputs ? []
, extraNativeBuildInputs ? []
, ...
} @ args:
@ -189,8 +191,8 @@ stdenv.mkDerivation ({
outputs = [ "out" "bin" "dev" "static" ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison python3Minimal ];
buildInputs = [ linuxHeaders ] ++ lib.optionals withGd [ gd libpng ];
nativeBuildInputs = [ bison python3Minimal ] ++ extraNativeBuildInputs;
buildInputs = [ linuxHeaders ] ++ lib.optionals withGd [ gd libpng ] ++ extraBuildInputs;
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
# prevent a retained dependency on the bootstrap tools in the stdenv-linux

View File

@ -6,7 +6,7 @@
https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
*/
{ lib, stdenv, buildPackages, callPackage, writeText
{ lib, stdenv, buildPackages, callPackage, writeText, glibc
, allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
}:
@ -17,6 +17,8 @@ callPackage ./common.nix { inherit stdenv; } {
outputs = [ "out" ];
extraNativeBuildInputs = [ glibc ];
# 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
@ -24,7 +26,7 @@ callPackage ./common.nix { inherit stdenv; } {
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
buildPhase =
''
mkdir -p $TMPDIR/"${buildPackages.stdenv.cc.libc.out}/lib/locale"
mkdir -p $TMPDIR/"${buildPackages.glibc.out}/lib/locale"
echo 'C.UTF-8/UTF-8 \' >> ../glibc-2*/localedata/SUPPORTED

View File

@ -16250,8 +16250,8 @@ with pkgs;
relibc = callPackage ../development/libraries/relibc { };
# Only supported on Linux, using glibc
glibcLocales = if stdenv.hostPlatform.libc == "glibc" then callPackage ../development/libraries/glibc/locales.nix { } else null;
# Only supported on Linux
glibcLocales = if stdenv.hostPlatform.isLinux then callPackage ../development/libraries/glibc/locales.nix { } else null;
glibcInfo = callPackage ../development/libraries/glibc/info.nix { };