Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/qemu/
Date: Mon, 28 Mar 2016 21:41:29
Message-Id: 1459201270.42da3c45bbe074f8d25decfcdd7cd8d0388c6f39.vapier@gentoo
1 commit: 42da3c45bbe074f8d25decfcdd7cd8d0388c6f39
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 21:38:33 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 21:41:10 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42da3c45
7
8 app-emulation/qemu: use l10n.eclass to respect LINGUAS #577814
9
10 app-emulation/qemu/qemu-2.5.0-r2.ebuild | 33 +++++++++++++++++++++++++++++----
11 app-emulation/qemu/qemu-9999.ebuild | 33 +++++++++++++++++++++++++++++----
12 2 files changed, 58 insertions(+), 8 deletions(-)
13
14 diff --git a/app-emulation/qemu/qemu-2.5.0-r2.ebuild b/app-emulation/qemu/qemu-2.5.0-r2.ebuild
15 index 5621047..072691e 100644
16 --- a/app-emulation/qemu/qemu-2.5.0-r2.ebuild
17 +++ b/app-emulation/qemu/qemu-2.5.0-r2.ebuild
18 @@ -7,8 +7,10 @@ EAPI=5
19 PYTHON_COMPAT=( python2_7 )
20 PYTHON_REQ_USE="ncurses,readline"
21
22 +PLOCALES="de_DE fr_FR hu it tr zh_CN"
23 +
24 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
25 - user udev fcaps readme.gentoo pax-utils
26 + user udev fcaps readme.gentoo pax-utils l10n
27
28 BACKPORTS=
29
30 @@ -295,6 +297,29 @@ check_targets() {
31 popd >/dev/null
32 }
33
34 +handle_locales() {
35 + # Make sure locale list is kept up-to-date.
36 + local detected sorted
37 + detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
38 + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
39 + if [[ ${sorted} != "${detected}" ]] ; then
40 + eerror "The ebuild needs to be kept in sync."
41 + eerror "PLOCALES: ${sorted}"
42 + eerror " po/*.po: ${detected}"
43 + die "sync PLOCALES"
44 + fi
45 +
46 + # Deal with selective install of locales.
47 + if use nls ; then
48 + # Delete locales the user does not want. #577814
49 + rm_loc() { rm po/$1.po || die; }
50 + l10n_for_each_disabled_locale_do rm_loc
51 + else
52 + # Cheap hack to disable gettext .mo generation.
53 + rm -f po/*.po
54 + fi
55 +}
56 +
57 src_prepare() {
58 check_targets IUSE_SOFTMMU_TARGETS softmmu
59 check_targets IUSE_USER_TARGETS linux-user
60 @@ -304,9 +329,6 @@ src_prepare() {
61 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
62 Makefile Makefile.target || die
63
64 - # Cheap hack to disable gettext .mo generation.
65 - use nls || rm -f po/*.po
66 -
67 epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch
68 [[ -n ${BACKPORTS} ]] && \
69 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
70 @@ -337,6 +359,9 @@ src_prepare() {
71 MAKEOPTS+=" V=1"
72
73 epatch_user
74 +
75 + # Run after we've applied all patches.
76 + handle_locales
77 }
78
79 ##
80
81 diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild
82 index 70f595e..acecad8 100644
83 --- a/app-emulation/qemu/qemu-9999.ebuild
84 +++ b/app-emulation/qemu/qemu-9999.ebuild
85 @@ -7,8 +7,10 @@ EAPI=5
86 PYTHON_COMPAT=( python2_7 )
87 PYTHON_REQ_USE="ncurses,readline"
88
89 +PLOCALES="de_DE fr_FR hu it tr zh_CN"
90 +
91 inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
92 - user udev fcaps readme.gentoo pax-utils
93 + user udev fcaps readme.gentoo pax-utils l10n
94
95 BACKPORTS=
96
97 @@ -295,6 +297,29 @@ check_targets() {
98 popd >/dev/null
99 }
100
101 +handle_locales() {
102 + # Make sure locale list is kept up-to-date.
103 + local detected sorted
104 + detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u))
105 + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u))
106 + if [[ ${sorted} != "${detected}" ]] ; then
107 + eerror "The ebuild needs to be kept in sync."
108 + eerror "PLOCALES: ${sorted}"
109 + eerror " po/*.po: ${detected}"
110 + die "sync PLOCALES"
111 + fi
112 +
113 + # Deal with selective install of locales.
114 + if use nls ; then
115 + # Delete locales the user does not want. #577814
116 + rm_loc() { rm po/$1.po || die; }
117 + l10n_for_each_disabled_locale_do rm_loc
118 + else
119 + # Cheap hack to disable gettext .mo generation.
120 + rm -f po/*.po
121 + fi
122 +}
123 +
124 src_prepare() {
125 check_targets IUSE_SOFTMMU_TARGETS softmmu
126 check_targets IUSE_USER_TARGETS linux-user
127 @@ -304,9 +329,6 @@ src_prepare() {
128 -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
129 Makefile Makefile.target || die
130
131 - # Cheap hack to disable gettext .mo generation.
132 - use nls || rm -f po/*.po
133 -
134 epatch "${FILESDIR}"/qemu-2.5.0-cflags.patch
135 [[ -n ${BACKPORTS} ]] && \
136 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
137 @@ -319,6 +341,9 @@ src_prepare() {
138 MAKEOPTS+=" V=1"
139
140 epatch_user
141 +
142 + # Run after we've applied all patches.
143 + handle_locales
144 }
145
146 ##