1 |
commit: a8ee79a39dab7e2267308b7207803d9726e486f2 |
2 |
Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 2 02:02:59 2016 +0000 |
4 |
Commit: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 2 02:02:59 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8ee79a3 |
7 |
|
8 |
dev-libs/glib: also fix firefox crash in 2.46 (bug #577686) |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
dev-libs/glib/glib-2.46.2-r3.ebuild | 321 ++++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 321 insertions(+) |
14 |
|
15 |
diff --git a/dev-libs/glib/glib-2.46.2-r3.ebuild b/dev-libs/glib/glib-2.46.2-r3.ebuild |
16 |
new file mode 100644 |
17 |
index 0000000..2165c07 |
18 |
--- /dev/null |
19 |
+++ b/dev-libs/glib/glib-2.46.2-r3.ebuild |
20 |
@@ -0,0 +1,321 @@ |
21 |
+# Copyright 1999-2016 Gentoo Foundation |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+# $Id$ |
24 |
+ |
25 |
+# Until bug #537330 glib is a reverse dependency of pkgconfig and, then |
26 |
+# adding new dependencies end up making stage3 to grow. Every addition needs |
27 |
+# then to be think very closely. |
28 |
+ |
29 |
+EAPI="5" |
30 |
+PYTHON_COMPAT=( python2_7 ) |
31 |
+# Building with --disable-debug highly unrecommended. It will build glib in |
32 |
+# an unusable form as it disables some commonly used API. Please do not |
33 |
+# convert this to the use_enable form, as it results in a broken build. |
34 |
+GCONF_DEBUG="yes" |
35 |
+# Completely useless with or without USE static-libs, people need to use |
36 |
+# pkg-config |
37 |
+GNOME2_LA_PUNT="yes" |
38 |
+ |
39 |
+inherit autotools bash-completion-r1 gnome2 libtool eutils flag-o-matic multilib \ |
40 |
+ pax-utils python-r1 toolchain-funcs versionator virtualx linux-info multilib-minimal |
41 |
+ |
42 |
+DESCRIPTION="The GLib library of C routines" |
43 |
+HOMEPAGE="http://www.gtk.org/" |
44 |
+SRC_URI="${SRC_URI} |
45 |
+ https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf |
46 |
+ |
47 |
+LICENSE="LGPL-2+" |
48 |
+SLOT="2" |
49 |
+IUSE="dbus fam kernel_linux +mime selinux static-libs systemtap test utils xattr" |
50 |
+REQUIRED_USE=" |
51 |
+ utils? ( ${PYTHON_REQUIRED_USE} ) |
52 |
+ test? ( ${PYTHON_REQUIRED_USE} ) |
53 |
+" |
54 |
+ |
55 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux" |
56 |
+ |
57 |
+RDEPEND=" |
58 |
+ !<dev-util/gdbus-codegen-${PV} |
59 |
+ >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] |
60 |
+ >=virtual/libffi-3.0.13-r1[${MULTILIB_USEDEP}] |
61 |
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] |
62 |
+ selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] ) |
63 |
+ xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] ) |
64 |
+ fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] ) |
65 |
+ utils? ( |
66 |
+ ${PYTHON_DEPS} |
67 |
+ >=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}] |
68 |
+ || ( |
69 |
+ >=dev-libs/elfutils-0.142 |
70 |
+ >=dev-libs/libelf-0.8.12 |
71 |
+ >=sys-freebsd/freebsd-lib-9.2_rc1 |
72 |
+ ) |
73 |
+ ) |
74 |
+" |
75 |
+DEPEND="${RDEPEND} |
76 |
+ app-text/docbook-xml-dtd:4.1.2 |
77 |
+ >=dev-libs/libxslt-1.0 |
78 |
+ >=sys-devel/gettext-0.11 |
79 |
+ >=dev-util/gtk-doc-am-1.20 |
80 |
+ systemtap? ( >=dev-util/systemtap-1.3 ) |
81 |
+ test? ( |
82 |
+ sys-devel/gdb |
83 |
+ ${PYTHON_DEPS} |
84 |
+ >=dev-util/gdbus-codegen-${PV}[${PYTHON_USEDEP}] |
85 |
+ >=sys-apps/dbus-1.2.14 ) |
86 |
+ !<dev-util/gtk-doc-1.15-r2 |
87 |
+" |
88 |
+# gobject-introspection blocker to ensure people don't mix |
89 |
+# different g-i and glib major versions |
90 |
+ |
91 |
+PDEPEND="!<gnome-base/gvfs-1.6.4-r990 |
92 |
+ dbus? ( gnome-base/dconf ) |
93 |
+ mime? ( x11-misc/shared-mime-info ) |
94 |
+" |
95 |
+# shared-mime-info needed for gio/xdgmime, bug #409481 |
96 |
+# dconf is needed to be able to save settings, bug #498436 |
97 |
+# Earlier versions of gvfs do not work with glib |
98 |
+ |
99 |
+MULTILIB_CHOST_TOOLS=( |
100 |
+ /usr/bin/gio-querymodules |
101 |
+) |
102 |
+ |
103 |
+pkg_setup() { |
104 |
+ if use kernel_linux ; then |
105 |
+ CONFIG_CHECK="~INOTIFY_USER" |
106 |
+ if use test; then |
107 |
+ CONFIG_CHECK="~IPV6" |
108 |
+ WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them." |
109 |
+ fi |
110 |
+ linux-info_pkg_setup |
111 |
+ fi |
112 |
+} |
113 |
+ |
114 |
+src_prepare() { |
115 |
+ # GDBusProxy: Fix a memory leak during initialization (from 2.46 branch) |
116 |
+ epatch "${FILESDIR}"/${P}-memleak.patch |
117 |
+ |
118 |
+ # Prevent build failure in stage3 where pkgconfig is not available, bug #481056 |
119 |
+ mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die |
120 |
+ |
121 |
+ if use test; then |
122 |
+ # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163 |
123 |
+ if ! has_version dev-util/desktop-file-utils ; then |
124 |
+ ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system," |
125 |
+ ewarn "think on installing it to get these tests run." |
126 |
+ sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die |
127 |
+ sed -i -e "/g_test_add_func/d" gio/tests/desktop-app-info.c || die |
128 |
+ fi |
129 |
+ |
130 |
+ # gdesktopappinfo requires existing terminal (gnome-terminal or any |
131 |
+ # other), falling back to xterm if one doesn't exist |
132 |
+ if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then |
133 |
+ ewarn "Some tests will be skipped due to missing terminal program" |
134 |
+ sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die |
135 |
+ fi |
136 |
+ |
137 |
+ # Disable tests requiring dbus-python and pygobject; bugs #349236, #377549, #384853 |
138 |
+ if ! has_version dev-python/dbus-python || ! has_version 'dev-python/pygobject:3' ; then |
139 |
+ ewarn "Some tests will be skipped due to dev-python/dbus-python or dev-python/pygobject:3" |
140 |
+ ewarn "not being present on your system, think on installing them to get these tests run." |
141 |
+ sed -i -e "/connection\/filter/d" gio/tests/gdbus-connection.c || die |
142 |
+ sed -i -e "/connection\/large_message/d" gio/tests/gdbus-connection-slow.c || die |
143 |
+ sed -i -e "/gdbus\/proxy/d" gio/tests/gdbus-proxy.c || die |
144 |
+ sed -i -e "/gdbus\/proxy-well-known-name/d" gio/tests/gdbus-proxy-well-known-name.c || die |
145 |
+ sed -i -e "/gdbus\/introspection-parser/d" gio/tests/gdbus-introspection.c || die |
146 |
+ sed -i -e "/g_test_add_func/d" gio/tests/gdbus-threading.c || die |
147 |
+ sed -i -e "/gdbus\/method-calls-in-thread/d" gio/tests/gdbus-threading.c || die |
148 |
+ # needed to prevent gdbus-threading from asserting |
149 |
+ ln -sfn $(type -P true) gio/tests/gdbus-testserver.py |
150 |
+ fi |
151 |
+ |
152 |
+ # Some tests need ipv6, upstream bug #667468 |
153 |
+ # https://bugs.gentoo.org/show_bug.cgi?id=508752 |
154 |
+ if [[ ! -f /proc/net/if_net6 ]]; then |
155 |
+ sed -i -e "/gdbus\/peer-to-peer/d" gio/tests/gdbus-peer.c || die |
156 |
+ sed -i -e "/gdbus\/delayed-message-processing/d" gio/tests/gdbus-peer.c || die |
157 |
+ sed -i -e "/gdbus\/nonce-tcp/d" gio/tests/gdbus-peer.c || die |
158 |
+ fi |
159 |
+ |
160 |
+ # This test is prone to fail, bug #504024, upstream bug #723719 |
161 |
+ sed -i -e '/gdbus-close-pending/d' gio/tests/Makefile.am || die |
162 |
+ |
163 |
+ # https://bugzilla.gnome.org/show_bug.cgi?id=722604 |
164 |
+ sed -i -e "/timer\/stop/d" glib/tests/timer.c || die |
165 |
+ sed -i -e "/timer\/basic/d" glib/tests/timer.c || die |
166 |
+ else |
167 |
+ # Don't build tests, also prevents extra deps, bug #512022 |
168 |
+ sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die |
169 |
+ fi |
170 |
+ |
171 |
+ # gdbus-codegen is a separate package |
172 |
+ epatch "${FILESDIR}"/${PN}-2.40.0-external-gdbus-codegen.patch |
173 |
+ |
174 |
+ # crash in Firefox when choosing default application, fixed in 2.48.1; bug #577686 |
175 |
+ epatch "${FILESDIR}"/${PN}-2.48.0-GContextSpecificGroup.patch |
176 |
+ |
177 |
+ # leave python shebang alone |
178 |
+ sed -e '/${PYTHON}/d' \ |
179 |
+ -i glib/Makefile.{am,in} || die |
180 |
+ |
181 |
+ epatch_user |
182 |
+ |
183 |
+ # Also needed to prevent cross-compile failures, see bug #267603 |
184 |
+ eautoreconf |
185 |
+ |
186 |
+ gnome2_src_prepare |
187 |
+ |
188 |
+ epunt_cxx |
189 |
+} |
190 |
+ |
191 |
+multilib_src_configure() { |
192 |
+ # Avoid circular depend with dev-util/pkgconfig and |
193 |
+ # native builds (cross-compiles won't need pkg-config |
194 |
+ # in the target ROOT to work here) |
195 |
+ if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then |
196 |
+ if has_version sys-apps/dbus; then |
197 |
+ export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include" |
198 |
+ export DBUS1_LIBS="-ldbus-1" |
199 |
+ fi |
200 |
+ export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)" |
201 |
+ export LIBFFI_LIBS="-lffi" |
202 |
+ fi |
203 |
+ |
204 |
+ # These configure tests don't work when cross-compiling. |
205 |
+ if tc-is-cross-compiler ; then |
206 |
+ # https://bugzilla.gnome.org/show_bug.cgi?id=756473 |
207 |
+ case ${CHOST} in |
208 |
+ hppa*|metag*) export glib_cv_stack_grows=yes ;; |
209 |
+ *) export glib_cv_stack_grows=no ;; |
210 |
+ esac |
211 |
+ # https://bugzilla.gnome.org/show_bug.cgi?id=756474 |
212 |
+ export glib_cv_uscore=no |
213 |
+ # https://bugzilla.gnome.org/show_bug.cgi?id=756475 |
214 |
+ export ac_cv_func_posix_get{pwuid,grgid}_r=yes |
215 |
+ fi |
216 |
+ |
217 |
+ local myconf |
218 |
+ |
219 |
+ case "${CHOST}" in |
220 |
+ *-mingw*) myconf="${myconf} --with-threads=win32" ;; |
221 |
+ *) myconf="${myconf} --with-threads=posix" ;; |
222 |
+ esac |
223 |
+ |
224 |
+ # FIXME: Always use internal libpcre, bug #254659 |
225 |
+ # (maybe consider going back to system lib) |
226 |
+ # libelf used only by the gresource bin |
227 |
+ ECONF_SOURCE="${S}" gnome2_src_configure ${myconf} \ |
228 |
+ $(use_enable xattr) \ |
229 |
+ $(use_enable fam) \ |
230 |
+ $(use_enable selinux) \ |
231 |
+ $(use_enable static-libs static) \ |
232 |
+ $(use_enable systemtap dtrace) \ |
233 |
+ $(use_enable systemtap systemtap) \ |
234 |
+ $(multilib_native_use_enable utils libelf) \ |
235 |
+ --disable-compile-warnings \ |
236 |
+ --enable-man \ |
237 |
+ --with-pcre=internal \ |
238 |
+ --with-xml-catalog="${EPREFIX}/etc/xml/catalog" |
239 |
+ |
240 |
+ if multilib_is_native_abi; then |
241 |
+ local d |
242 |
+ for d in glib gio gobject; do |
243 |
+ ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die |
244 |
+ done |
245 |
+ fi |
246 |
+} |
247 |
+ |
248 |
+multilib_src_test() { |
249 |
+ export XDG_CONFIG_DIRS=/etc/xdg |
250 |
+ export XDG_DATA_DIRS=/usr/local/share:/usr/share |
251 |
+ export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp" |
252 |
+ export LC_TIME=C # bug #411967 |
253 |
+ python_export_best |
254 |
+ |
255 |
+ # Related test is a bit nitpicking |
256 |
+ mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR" |
257 |
+ chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR" |
258 |
+ |
259 |
+ # Hardened: gdb needs this, bug #338891 |
260 |
+ if host-is-pax ; then |
261 |
+ pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \ |
262 |
+ || die "Hardened adjustment failed" |
263 |
+ fi |
264 |
+ |
265 |
+ # Need X for dbus-launch session X11 initialization |
266 |
+ Xemake check |
267 |
+} |
268 |
+ |
269 |
+multilib_src_install() { |
270 |
+ gnome2_src_install completiondir="$(get_bashcompdir)" |
271 |
+ keepdir /usr/$(get_libdir)/gio/modules |
272 |
+} |
273 |
+ |
274 |
+multilib_src_install_all() { |
275 |
+ DOCS="AUTHORS ChangeLog* NEWS* README" |
276 |
+ einstalldocs |
277 |
+ |
278 |
+ if use utils ; then |
279 |
+ python_replicate_script "${ED}"/usr/bin/gtester-report |
280 |
+ else |
281 |
+ rm "${ED}usr/bin/gtester-report" |
282 |
+ rm "${ED}usr/share/man/man1/gtester-report.1" |
283 |
+ fi |
284 |
+ |
285 |
+ # Do not install charset.alias even if generated, leave it to libiconv |
286 |
+ rm -f "${ED}/usr/lib/charset.alias" |
287 |
+ |
288 |
+ # Don't install gdb python macros, bug 291328 |
289 |
+ rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/" |
290 |
+} |
291 |
+ |
292 |
+pkg_preinst() { |
293 |
+ gnome2_pkg_preinst |
294 |
+ |
295 |
+ # Make gschemas.compiled belong to glib alone |
296 |
+ local cache="usr/share/glib-2.0/schemas/gschemas.compiled" |
297 |
+ |
298 |
+ if [[ -e ${EROOT}${cache} ]]; then |
299 |
+ cp "${EROOT}"${cache} "${ED}"/${cache} || die |
300 |
+ else |
301 |
+ touch "${ED}"/${cache} || die |
302 |
+ fi |
303 |
+ |
304 |
+ multilib_pkg_preinst() { |
305 |
+ # Make giomodule.cache belong to glib alone |
306 |
+ local cache="usr/$(get_libdir)/gio/giomodule.cache" |
307 |
+ |
308 |
+ if [[ -e ${EROOT}${cache} ]]; then |
309 |
+ cp "${EROOT}"${cache} "${ED}"/${cache} || die |
310 |
+ else |
311 |
+ touch "${ED}"/${cache} || die |
312 |
+ fi |
313 |
+ } |
314 |
+ |
315 |
+ multilib_foreach_abi multilib_pkg_preinst |
316 |
+} |
317 |
+ |
318 |
+pkg_postinst() { |
319 |
+ # force (re)generation of gschemas.compiled |
320 |
+ GNOME2_ECLASS_GLIB_SCHEMAS="force" |
321 |
+ |
322 |
+ gnome2_pkg_postinst |
323 |
+ |
324 |
+ multilib_pkg_postinst() { |
325 |
+ gnome2_giomodule_cache_update \ |
326 |
+ || die "Update GIO modules cache failed (for ${ABI})" |
327 |
+ } |
328 |
+ multilib_foreach_abi multilib_pkg_postinst |
329 |
+} |
330 |
+ |
331 |
+pkg_postrm() { |
332 |
+ gnome2_pkg_postrm |
333 |
+ |
334 |
+ if [[ -z ${REPLACED_BY_VERSION} ]]; then |
335 |
+ multilib_pkg_postrm() { |
336 |
+ rm -f "${EROOT}"usr/$(get_libdir)/gio/giomodule.cache |
337 |
+ } |
338 |
+ multilib_foreach_abi multilib_pkg_postrm |
339 |
+ rm -f "${EROOT}"usr/share/glib-2.0/schemas/gschemas.compiled |
340 |
+ fi |
341 |
+} |