1 |
commit: 45a9cd813a2244a676ab9a651a5274baac83a9d0 |
2 |
Author: Alfred Persson Forsberg <cat <AT> catcream <DOT> org> |
3 |
AuthorDate: Mon Aug 29 20:02:29 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 1 02:13:16 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45a9cd81 |
7 |
|
8 |
sys-devel/gettext: fix musl symbol |
9 |
|
10 |
This patch forces OMIT_SETLOCALE_LOCK to 0 so that |
11 |
gl_get_setlocale_null_lock gets defined. |
12 |
|
13 |
Deliberately gone for a conditional patch |
14 |
for now as we want to get this sorted |
15 |
properly but it involves discussion |
16 |
with upstream first on the best way forward. |
17 |
|
18 |
See: https://savannah.gnu.org/bugs/index.php?62659 |
19 |
Closes: https://bugs.gentoo.org/830590 |
20 |
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org> |
21 |
Closes: https://github.com/gentoo/gentoo/pull/27062 |
22 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
23 |
|
24 |
.../gettext-0.21-musl-omit_setlocale_lock.patch | 37 +++++ |
25 |
sys-devel/gettext/gettext-0.21-r4.ebuild | 160 +++++++++++++++++++++ |
26 |
2 files changed, 197 insertions(+) |
27 |
|
28 |
diff --git a/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch b/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..e063785376dc |
31 |
--- /dev/null |
32 |
+++ b/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch |
33 |
@@ -0,0 +1,37 @@ |
34 |
+OMIT_SETLOCALE_LOCK should be true when gl_get_setlocale_null_lock is provided by a dependency library, like GNU libintl. |
35 |
+On Gentoo musl we use musl's libintl and gl_get_setlocale_null_lock is not provided by it, therefore we set OMIT_SETLOCALE_LOCK to 0. |
36 |
+ |
37 |
+To properly fix this we should do AC_SEARCH_LIBS([gl_get_setlocale_null_lock], [intl], ...) in automake, but instead we do this |
38 |
+hack to not get complacent. This should be fixed upstream. |
39 |
+ |
40 |
+https://savannah.gnu.org/bugs/index.php?62659#comment7 |
41 |
+https://bugs.gentoo.org/830590 |
42 |
+diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am |
43 |
+index 59b016e..d92978d 100644 |
44 |
+--- a/gettext-tools/libgettextpo/Makefile.am |
45 |
++++ b/gettext-tools/libgettextpo/Makefile.am |
46 |
+@@ -40,7 +40,7 @@ AM_CPPFLAGS = \ |
47 |
+ -I../src -I$(top_srcdir)/src \ |
48 |
+ -I../intl -I$(top_srcdir)/../gettext-runtime/intl |
49 |
+ |
50 |
+-DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@ |
51 |
++DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=0 @DEFS@ |
52 |
+ |
53 |
+ # libgettextpo contains the public API for PO files. |
54 |
+ libgettextpo_la_SOURCES = \ |
55 |
+diff --git a/gettext-tools/libgettextpo/Makefile.in b/gettext-tools/libgettextpo/Makefile.in |
56 |
+index f76efa5..aca3a81 100644 |
57 |
+--- a/gettext-tools/libgettextpo/Makefile.in |
58 |
++++ b/gettext-tools/libgettextpo/Makefile.in |
59 |
+@@ -804,7 +804,7 @@ CXXDEPMODE = @CXXDEPMODE@ |
60 |
+ CXXFLAGS = @CXXFLAGS@ |
61 |
+ CXX_CHOICE = @CXX_CHOICE@ |
62 |
+ CYGPATH_W = @CYGPATH_W@ |
63 |
+-DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@ |
64 |
++DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=0 @DEFS@ |
65 |
+ DEPDIR = @DEPDIR@ |
66 |
+ DLLTOOL = @DLLTOOL@ |
67 |
+ DSYMUTIL = @DSYMUTIL@ |
68 |
+-- |
69 |
+2.35.1 |
70 |
+ |
71 |
|
72 |
diff --git a/sys-devel/gettext/gettext-0.21-r4.ebuild b/sys-devel/gettext/gettext-0.21-r4.ebuild |
73 |
new file mode 100644 |
74 |
index 000000000000..b8bcb0f6414f |
75 |
--- /dev/null |
76 |
+++ b/sys-devel/gettext/gettext-0.21-r4.ebuild |
77 |
@@ -0,0 +1,160 @@ |
78 |
+# Copyright 1999-2022 Gentoo Authors |
79 |
+# Distributed under the terms of the GNU General Public License v2 |
80 |
+ |
81 |
+# Note: Keep version bumps in sync with dev-libs/libintl. |
82 |
+ |
83 |
+EAPI=7 |
84 |
+ |
85 |
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gettext.asc |
86 |
+inherit mono-env libtool java-pkg-opt-2 multilib-minimal verify-sig |
87 |
+ |
88 |
+DESCRIPTION="GNU locale utilities" |
89 |
+HOMEPAGE="https://www.gnu.org/software/gettext/" |
90 |
+if [[ ${PV} == *_rc* ]] ; then |
91 |
+ SRC_URI="https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz" |
92 |
+ SRC_URI+=" verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz.sig )" |
93 |
+ S="${WORKDIR}/${P/_/-}" |
94 |
+else |
95 |
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" |
96 |
+ SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )" |
97 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" |
98 |
+fi |
99 |
+# Only libasprintf is under the LGPL (and libintl is in a sep package), |
100 |
+# so put that license behind USE=cxx. |
101 |
+LICENSE="GPL-3+ cxx? ( LGPL-2.1+ )" |
102 |
+SLOT="0" |
103 |
+IUSE="acl cvs +cxx doc emacs git java ncurses nls openmp static-libs" |
104 |
+ |
105 |
+# only runtime goes multilib |
106 |
+# Note: The version of libxml2 corresponds to the version bundled via gnulib. |
107 |
+# If the build detects too old of a system version, it will end up falling back |
108 |
+# to the bundled copy. #596918 |
109 |
+# Note: expat lacks a subslot because it is dynamically loaded at runtime. We |
110 |
+# would depend on older subslots if they were available (based on the ABIs that |
111 |
+# are explicitly handled), but expat doesn't currently use subslots. |
112 |
+DEPEND=">=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] |
113 |
+ >=virtual/libintl-0-r2[${MULTILIB_USEDEP}] |
114 |
+ >=dev-libs/libxml2-2.9.3:= |
115 |
+ dev-libs/expat |
116 |
+ acl? ( virtual/acl ) |
117 |
+ ncurses? ( sys-libs/ncurses:0= ) |
118 |
+ java? ( virtual/jdk:1.8 )" |
119 |
+RDEPEND="${DEPEND} |
120 |
+ !git? ( cvs? ( dev-vcs/cvs ) ) |
121 |
+ git? ( dev-vcs/git ) |
122 |
+ java? ( virtual/jre:1.8 )" |
123 |
+BDEPEND=" |
124 |
+ !git? ( cvs? ( dev-vcs/cvs ) ) |
125 |
+ git? ( dev-vcs/git ) |
126 |
+ verify-sig? ( sec-keys/openpgp-keys-gettext )" |
127 |
+PDEPEND="emacs? ( app-emacs/po-mode )" |
128 |
+ |
129 |
+MULTILIB_WRAPPED_HEADERS=( |
130 |
+ # only installed for native ABI |
131 |
+ /usr/include/gettext-po.h |
132 |
+ |
133 |
+ /usr/include/autosprintf.h |
134 |
+ /usr/include/textstyle.h |
135 |
+ /usr/include/textstyle/stdbool.h |
136 |
+ /usr/include/textstyle/version.h |
137 |
+ /usr/include/textstyle/woe32dll.h |
138 |
+) |
139 |
+ |
140 |
+PATCHES=( |
141 |
+ "${FILESDIR}"/${PN}-0.19.7-disable-libintl.patch #564168 |
142 |
+ "${FILESDIR}"/${PN}-0.20-parallel_install.patch #685530 |
143 |
+ "${FILESDIR}"/${PN}-0.21_rc1-avoid_eautomake.patch |
144 |
+ "${FILESDIR}"/${PN}-0.21-CVE-2020-12825.patch |
145 |
+) |
146 |
+ |
147 |
+QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so" |
148 |
+ |
149 |
+pkg_setup() { |
150 |
+ mono-env_pkg_setup |
151 |
+ java-pkg-opt-2_pkg_setup |
152 |
+} |
153 |
+ |
154 |
+src_prepare() { |
155 |
+ java-pkg-opt-2_src_prepare |
156 |
+ default |
157 |
+ elibtoolize |
158 |
+ use elibc_musl && eapply "${FILESDIR}"/${PN}-0.21-musl-omit_setlocale_lock.patch |
159 |
+} |
160 |
+ |
161 |
+multilib_src_configure() { |
162 |
+ local myconf=( |
163 |
+ # switches common to runtime and top-level |
164 |
+ --cache-file="${BUILD_DIR}"/config.cache |
165 |
+ #--docdir="\$(datarootdir)/doc/${PF}" |
166 |
+ |
167 |
+ # Emacs support is now in a separate package |
168 |
+ --without-emacs |
169 |
+ --without-lispdir |
170 |
+ # glib depends on us so avoid circular deps |
171 |
+ --with-included-glib |
172 |
+ # libcroco depends on glib which ... ^^^ |
173 |
+ --with-included-libcroco |
174 |
+ # this will _disable_ libunistring (since it is not bundled), |
175 |
+ # see bug #326477 |
176 |
+ --with-included-libunistring |
177 |
+ # Never build libintl since it's in dev-libs/libintl now. |
178 |
+ --without-included-gettext |
179 |
+ # Never build bundled copy of libxml2. |
180 |
+ --without-included-libxml |
181 |
+ |
182 |
+ $(use_enable acl) |
183 |
+ $(use_enable cxx c++) |
184 |
+ $(use_enable cxx libasprintf) |
185 |
+ $(use_with git) |
186 |
+ $(usex git --without-cvs $(use_with cvs)) |
187 |
+ $(multilib_native_use_enable java) |
188 |
+ $(use_enable ncurses curses) |
189 |
+ $(use_enable nls) |
190 |
+ $(use_enable openmp) |
191 |
+ $(use_enable static-libs static) |
192 |
+ ) |
193 |
+ |
194 |
+ local ECONF_SOURCE="${S}" |
195 |
+ if ! multilib_is_native_abi ; then |
196 |
+ # for non-native ABIs, we build runtime only |
197 |
+ ECONF_SOURCE+=/gettext-runtime |
198 |
+ fi |
199 |
+ |
200 |
+ econf "${myconf[@]}" |
201 |
+} |
202 |
+ |
203 |
+multilib_src_install() { |
204 |
+ emake DESTDIR="${D}" install |
205 |
+ |
206 |
+ if multilib_is_native_abi ; then |
207 |
+ dosym msgfmt /usr/bin/gmsgfmt #43435 |
208 |
+ dobin gettext-tools/misc/gettextize |
209 |
+ fi |
210 |
+} |
211 |
+ |
212 |
+multilib_src_install_all() { |
213 |
+ find "${ED}" -type f -name "*.la" -delete || die |
214 |
+ |
215 |
+ if use java ; then |
216 |
+ java-pkg_dojar "${ED}"/usr/share/${PN}/*.jar |
217 |
+ rm "${ED}"/usr/share/${PN}/*.jar || die |
218 |
+ rm "${ED}"/usr/share/${PN}/*.class || die |
219 |
+ if use doc ; then |
220 |
+ java-pkg_dojavadoc "${ED}"/usr/share/doc/${PF}/html/javadoc2 |
221 |
+ fi |
222 |
+ fi |
223 |
+ |
224 |
+ dodoc AUTHORS ChangeLog NEWS README THANKS |
225 |
+ |
226 |
+ if use doc ; then |
227 |
+ docinto html |
228 |
+ dodoc "${ED}"/usr/share/doc/${PF}/*.html |
229 |
+ else |
230 |
+ rm -rf "${ED}"/usr/share/doc/${PF}/{csharpdoc,examples,javadoc2,javadoc1} |
231 |
+ fi |
232 |
+ rm "${ED}"/usr/share/doc/${PF}/*.html || die |
233 |
+} |
234 |
+ |
235 |
+pkg_preinst() { |
236 |
+ java-pkg-opt-2_pkg_preinst |
237 |
+} |