nixpkgs/pkgs/development/libraries/glibc-2.10/locales.nix
Lluís Batlle i Rossell 2b580b9846 Updating the perl-5.10 expression to support the bootstrapping stdenv better
- I still have not understood why it worked without this fix before, and I think
this has been triggered by the gcc-4.4, but I have not investigated this much. I
went with the trivial fix.

Adding a glibc-2.10.1 expression, because the glibc-2.11 still does not have
a ports release, so it cannot be used in arm. I'm using it only in native
compilation by now.

Making the default glibc to be 2.10 instead of 2.11 in armv5tel-linux.


svn path=/nixpkgs/branches/stdenv-updates/; revision=18688
2009-11-28 12:57:42 +00:00

43 lines
1.5 KiB
Nix

/* This function builds just the `lib/locale/locale-archive' file from
Glibc and nothing else. If `allLocales' is true, all supported
locales are included; otherwise, just the locales listed in
`locales'. See localedata/SUPPORTED in the Glibc source tree for
the list of all supported locales:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
*/
{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
let build = import ./common.nix;
in
build {
name = "glibc-locales";
inherit fetchurl stdenv;
installLocales = true;
builder = ./localesbuilder.sh;
# 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 =
''
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
make localedata/install-locales \
LOCALEDEF="localedef --prefix=$TMPDIR" \
localedir=$out/lib/locale \
${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""}
'';
installPhase =
''
ensureDir "$out/lib/locale"
cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale"
'';
meta.description = "Locale information for the GNU C Library";
}