commit
5da8f2bb32
2 changed files with 17 additions and 10 deletions
|
@ -10,12 +10,12 @@ with lib;
|
|||
i18n = {
|
||||
glibcLocales = mkOption {
|
||||
type = types.path;
|
||||
default = pkgs.buildPackages.glibcLocales.override {
|
||||
default = pkgs.glibcLocales.override {
|
||||
allLocales = any (x: x == "all") config.i18n.supportedLocales;
|
||||
locales = config.i18n.supportedLocales;
|
||||
};
|
||||
defaultText = literalExpression ''
|
||||
pkgs.buildPackages.glibcLocales.override {
|
||||
pkgs.glibcLocales.override {
|
||||
allLocales = any (x: x == "all") config.i18n.supportedLocales;
|
||||
locales = config.i18n.supportedLocales;
|
||||
}
|
||||
|
|
|
@ -19,19 +19,26 @@ callPackage ./common.nix { inherit stdenv; } {
|
|||
|
||||
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
|
||||
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
|
||||
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
|
||||
buildPhase =
|
||||
''
|
||||
LOCALEDEF_FLAGS = [
|
||||
(if stdenv.hostPlatform.isLittleEndian
|
||||
then "--little-endian"
|
||||
else "--big-endian")
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
# 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
|
||||
# $TMPDIR as a prefix, meaning that the locale-archive is placed in
|
||||
# $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
|
||||
LOCALEDEF_FLAGS+=" --prefix=$TMPDIR"
|
||||
|
||||
mkdir -p $TMPDIR/"${buildPackages.glibc.out}/lib/locale"
|
||||
|
||||
echo 'C.UTF-8/UTF-8 \' >> ../glibc-2*/localedata/SUPPORTED
|
||||
|
||||
# Hack to allow building of the locales (needed since glibc-2.12)
|
||||
sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile
|
||||
sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef $(LOCALEDEF_FLAGS),' ../glibc-2*/localedata/Makefile
|
||||
''
|
||||
+ lib.optionalString (!allLocales) ''
|
||||
# Check that all locales to be built are supported
|
||||
|
|
Loading…
Reference in a new issue