1 |
commit: bbf35ca26d61f179cd22066eb59c466171b36829 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 27 22:30:59 2017 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 27 22:31:25 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbf35ca2 |
7 |
|
8 |
sys-libs/glibc: Add flag to build locale data in src_install, bug 146882 |
9 |
|
10 |
Based on the patch there by SpanKY; to be included in 2.27 and later. |
11 |
|
12 |
Bug: https://bugs.gentoo.org/146882 |
13 |
Package-Manager: Portage-2.3.13, Repoman-2.3.4 |
14 |
|
15 |
sys-libs/glibc/glibc-9999.ebuild | 28 ++++++++++++++++++++-------- |
16 |
sys-libs/glibc/metadata.xml | 1 + |
17 |
2 files changed, 21 insertions(+), 8 deletions(-) |
18 |
|
19 |
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild |
20 |
index f8e270e663f..399cfc13dc6 100644 |
21 |
--- a/sys-libs/glibc/glibc-9999.ebuild |
22 |
+++ b/sys-libs/glibc/glibc-9999.ebuild |
23 |
@@ -33,7 +33,7 @@ PATCH_VER="3" |
24 |
SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2" |
25 |
SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-${GCC_BOOTSTRAP_VER}-multilib-bootstrap.tar.bz2 )" |
26 |
|
27 |
-IUSE="audit caps debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only" |
28 |
+IUSE="audit caps compile-locales debug gd hardened multilib nscd selinux systemtap profile suid vanilla crosscompile_opts_headers-only" |
29 |
|
30 |
# Min kernel version nptl requires |
31 |
: ${NPTL_KERN_VER:="2.6.32"} |
32 |
@@ -551,6 +551,19 @@ src_test() { |
33 |
foreach_abi do_src_test || die "tests failed" |
34 |
} |
35 |
|
36 |
+run_locale_gen() { |
37 |
+ # if the host locales.gen contains no entries, we'll install everything |
38 |
+ local root="$1" |
39 |
+ local locale_list="${root}/etc/locale.gen" |
40 |
+ if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then |
41 |
+ ewarn "Generating all locales; edit /etc/locale.gen to save time/space" |
42 |
+ locale_list="${root}/usr/share/i18n/SUPPORTED" |
43 |
+ fi |
44 |
+ |
45 |
+ locale-gen --jobs $(makeopts_jobs) --config "${locale_list}" \ |
46 |
+ --destdir "${root}" |
47 |
+} |
48 |
+ |
49 |
glibc_do_src_install() { |
50 |
local builddir=$(builddir nptl) |
51 |
cd "${builddir}" |
52 |
@@ -714,6 +727,11 @@ glibc_do_src_install() { |
53 |
# Prevent overwriting of the /etc/localtime symlink. We'll handle the |
54 |
# creation of the "factory" symlink in pkg_postinst(). |
55 |
rm -f "${ED}"/etc/localtime |
56 |
+ |
57 |
+ # Generate all locales if this is a native build as locale generation |
58 |
+ if use compile-locales && ! is_crosscompile ; then |
59 |
+ run_locale_gen "${ED}" |
60 |
+ fi |
61 |
} |
62 |
|
63 |
glibc_headers_install() { |
64 |
@@ -773,12 +791,6 @@ pkg_postinst() { |
65 |
# errors from this step #253697 |
66 |
/sbin/telinit U 2>/dev/null |
67 |
|
68 |
- # if the host locales.gen contains no entries, we'll install everything |
69 |
- local locale_list="${EROOT}etc/locale.gen" |
70 |
- if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then |
71 |
- ewarn "Generating all locales; edit /etc/locale.gen to save time/space" |
72 |
- locale_list="${EROOT}usr/share/i18n/SUPPORTED" |
73 |
- fi |
74 |
- locale-gen -j $(makeopts_jobs) --config "${locale_list}" |
75 |
+ use compile-locales || run_locale_gen "${EROOT}" |
76 |
fi |
77 |
} |
78 |
|
79 |
diff --git a/sys-libs/glibc/metadata.xml b/sys-libs/glibc/metadata.xml |
80 |
index e6ebe220ca6..b32c212616a 100644 |
81 |
--- a/sys-libs/glibc/metadata.xml |
82 |
+++ b/sys-libs/glibc/metadata.xml |
83 |
@@ -6,6 +6,7 @@ |
84 |
<name>Gentoo Toolchain Project</name> |
85 |
</maintainer> |
86 |
<use> |
87 |
+ <flag name="compile-locales">build *all* locales in src_install; this is generally meant for stage building only as it ignores /etc/locale.gen file and can be pretty slow</flag> |
88 |
<flag name="debug">When USE=hardened, allow fortify/stack violations to dump core (SIGABRT) and not kill self (SIGKILL)</flag> |
89 |
<flag name="gd">build memusage and memusagestat tools</flag> |
90 |
<flag name="nscd">Build, and enable support for, the Name Service Cache Daemon</flag> |