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