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