Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-libs/glib/files/, dev-libs/glib/
Date: Wed, 02 Jan 2019 18:53:58
Message-Id: 1546455194.a98149fdf5ad6150cbf3c7d74c1c06892cfe8f72.blueness@gentoo
1 commit: a98149fdf5ad6150cbf3c7d74c1c06892cfe8f72
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 2 18:14:28 2019 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 2 18:53:14 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=a98149fd
7
8 dev-libs/glib: restore since the in tree version seg faults
9
10 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
11
12 dev-libs/glib/Manifest | 4 +
13 .../glib/files/2.56.2-gobject_init_on_demand.patch | 91 ++++++
14 ...56.2-network-monitor-race-test-iterations.patch | 36 +++
15 .../glib/files/2.56.2-quark_init_on_demand.patch | 50 ++++
16 .../files/glib-2.54.3-external-gdbus-codegen.patch | 86 ++++++
17 .../files/glib-2.58.2-external-gdbus-codegen.patch | 124 ++++++++
18 .../glib/files/glib-2.58.2-gvariant-test-fix.patch | 96 +++++++
19 dev-libs/glib/glib-2.56.2.ebuild | 302 +++++++++++++++++++
20 dev-libs/glib/glib-2.56.4.ebuild | 305 ++++++++++++++++++++
21 dev-libs/glib/glib-2.58.2.ebuild | 318 +++++++++++++++++++++
22 dev-libs/glib/metadata.xml | 31 ++
23 11 files changed, 1443 insertions(+)
24
25 diff --git a/dev-libs/glib/Manifest b/dev-libs/glib/Manifest
26 new file mode 100644
27 index 0000000..da75232
28 --- /dev/null
29 +++ b/dev-libs/glib/Manifest
30 @@ -0,0 +1,4 @@
31 +DIST glib-2.56.2.tar.xz 8041756 BLAKE2B 1af5bb37378856e959602bcb9299266bba46b990839c923f6b9881624aed306af0779005281b3e3a46b5994c54812edc86aade9cb782c596fd63b6fd91baba51 SHA512 8201ea82d3613d2e879284abe01520b766da30957c5a1a22f3e6019b0cce6bf95d25beae78867b6a133401c4165153c0c92974dd459ab12f9e0e9dd0c95df5d4
32 +DIST glib-2.56.4.tar.xz 7029768 BLAKE2B 21cf840128e468151eeac55f0323f8f643973422b70bb65655e24c0a6b2f7ee72d5ae879bfae73df84fa2281fc425cc98328597910ba8fd99d7a52024e1b3ab6 SHA512 280a46c2af13283a08c15ff0b4f5492659c2884521930600ad45310ed181c44a878ad8f9b36bae68ed6e7d92db6f1630f7bf015148c513dc317d25807f13abb0
33 +DIST glib-2.58.2.tar.xz 4862612 BLAKE2B e94d3dfc5d4b6d100c2425fda34c90fdf643fdb71b8bd65df691e34d11bfaf79fdc4c844eb215df24b0f680991fb0d0c08c3bb3dea61f5157ccd8bec200e2059 SHA512 4017ae308f2ef6313abbff2eb9b21ec6f8fa38935007491ca0cb4d1ffac6fedab6f50e911ac088995d6212323ba1767399f18529a2620d60378ecade193b4b1a
34 +DIST pkg-config-0.28.tar.gz 1931203 BLAKE2B bafdd4e838623965c6bd454421ddd9051fc43fc29948e1615b49fef463c3c3a18807aabe6416f96cfdf58d6b1c9e114d77f97bd985facee7c14284a8a64a768b SHA512 6eafa5ca77c5d44cd15f48457a5e96fcea2555b66d8e35ada5ab59864a0aa03d441e15f54ab9c6343693867b3b490f392c75b7d9312f024c9b7ec6a0194d8320
35
36 diff --git a/dev-libs/glib/files/2.56.2-gobject_init_on_demand.patch b/dev-libs/glib/files/2.56.2-gobject_init_on_demand.patch
37 new file mode 100644
38 index 0000000..d8be8e2
39 --- /dev/null
40 +++ b/dev-libs/glib/files/2.56.2-gobject_init_on_demand.patch
41 @@ -0,0 +1,91 @@
42 +--- a/gobject/gtype.c
43 ++++ b/gobject/gtype.c
44 +@@ -200,6 +200,9 @@
45 + static gboolean type_node_is_a_L (TypeNode *node,
46 + TypeNode *iface_node);
47 +
48 ++#if !defined(__GLIBC__)
49 ++static void gobject_init (void);
50 ++#endif
51 +
52 + /* --- enumeration --- */
53 +
54 +@@ -2623,6 +2626,10 @@
55 + {
56 + TypeNode *node;
57 +
58 ++ #if !defined(__GLIBC__)
59 ++ gobject_init();
60 ++ #endif
61 ++
62 + g_assert_type_system_initialized ();
63 + g_return_val_if_fail (type_id > 0, 0);
64 + g_return_val_if_fail (type_name != NULL, 0);
65 +@@ -2740,6 +2747,10 @@
66 + TypeNode *pnode, *node;
67 + GType type = 0;
68 +
69 ++ #if !defined(__GLIBC__)
70 ++ gobject_init();
71 ++ #endif
72 ++
73 + g_assert_type_system_initialized ();
74 + g_return_val_if_fail (parent_type > 0, 0);
75 + g_return_val_if_fail (type_name != NULL, 0);
76 +@@ -2795,6 +2806,10 @@
77 + TypeNode *pnode, *node;
78 + GType type;
79 +
80 ++ #if !defined(__GLIBC__)
81 ++ gobject_init();
82 ++ #endif
83 ++
84 + g_assert_type_system_initialized ();
85 + g_return_val_if_fail (parent_type > 0, 0);
86 + g_return_val_if_fail (type_name != NULL, 0);
87 +@@ -3309,7 +3324,11 @@
88 + g_type_name (GType type)
89 + {
90 + TypeNode *node;
91 +-
92 ++
93 ++ #if !defined(__GLIBC__)
94 ++ gobject_init();
95 ++ #endif
96 ++
97 + g_assert_type_system_initialized ();
98 +
99 + node = lookup_type_node_I (type);
100 +@@ -4335,6 +4354,9 @@
101 + void
102 + g_type_init_with_debug_flags (GTypeDebugFlags debug_flags)
103 + {
104 ++#if !defined(__GLIBC__)
105 ++ gobject_init();
106 ++#endif
107 + g_assert_type_system_initialized ();
108 +
109 + if (debug_flags)
110 +@@ -4353,6 +4375,9 @@
111 + void
112 + g_type_init (void)
113 + {
114 ++#if !defined(__GLIBC__)
115 ++ gobject_init();
116 ++#endif
117 + g_assert_type_system_initialized ();
118 + }
119 +
120 +@@ -4364,6 +4389,12 @@
121 + TypeNode *node;
122 + GType type;
123 +
124 ++#if !defined(__GLIBC__)
125 ++ static int gobject_initialized = 0;
126 ++ if (gobject_initialized)
127 ++ return;
128 ++ gobject_initialized = 1;
129 ++#endif
130 + /* Ensure GLib is initialized first, see
131 + * https://bugzilla.gnome.org/show_bug.cgi?id=756139
132 + */
133
134 diff --git a/dev-libs/glib/files/2.56.2-network-monitor-race-test-iterations.patch b/dev-libs/glib/files/2.56.2-network-monitor-race-test-iterations.patch
135 new file mode 100644
136 index 0000000..1ddec6d
137 --- /dev/null
138 +++ b/dev-libs/glib/files/2.56.2-network-monitor-race-test-iterations.patch
139 @@ -0,0 +1,36 @@
140 +From a90c578952219e740f24d9f2560f54f19ae7e906 Mon Sep 17 00:00:00 2001
141 +From: Philip Withnall <withnall@××××××××.com>
142 +Date: Wed, 11 Apr 2018 15:45:10 +0100
143 +Subject: [PATCH] tests: Lower number of iterations in network-monitor-race
144 +
145 +While 333 runs is very likely to reproduce the bug, Milan has previously
146 +reproduced it with as few as 9 runs. Since this test will be run by the
147 +CI machinery quite often, a lower number of runs each CI run will still
148 +probably catch any regressions over time.
149 +
150 +This reduces the total test runtime from 33s to 2s.
151 +
152 +https://bugzilla.gnome.org/show_bug.cgi?id=793727
153 +
154 +Signed-off-by: Philip Withnall <withnall@××××××××.com>
155 +Reviewed-by: nobody
156 +---
157 + gio/tests/network-monitor-race.c | 2 +-
158 + 1 file changed, 1 insertion(+), 1 deletion(-)
159 +
160 +diff --git a/gio/tests/network-monitor-race.c b/gio/tests/network-monitor-race.c
161 +index 4b92c87a5..cadd62cee 100644
162 +--- a/gio/tests/network-monitor-race.c
163 ++++ b/gio/tests/network-monitor-race.c
164 +@@ -18,7 +18,7 @@
165 + #include <glib/glib.h>
166 + #include <gio/gio.h>
167 +
168 +-#define MAX_RUNS 333
169 ++#define MAX_RUNS 20
170 +
171 + static gboolean
172 + quit_loop (gpointer user_data)
173 +--
174 +2.17.0
175 +
176
177 diff --git a/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch b/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch
178 new file mode 100644
179 index 0000000..d93f85c
180 --- /dev/null
181 +++ b/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch
182 @@ -0,0 +1,50 @@
183 +--- a/glib/gquark.c
184 ++++ b/glib/gquark.c
185 +@@ -57,6 +57,9 @@
186 + void
187 + g_quark_init (void)
188 + {
189 ++ if (quark_ht)
190 ++ return;
191 ++
192 + g_assert (quark_seq_id == 0);
193 + quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
194 + quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
195 +@@ -138,6 +141,9 @@
196 + return 0;
197 +
198 + G_LOCK (quark_global);
199 ++#if !defined(__GLIBC__)
200 ++ g_quark_init ();
201 ++#endif
202 + quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
203 + G_UNLOCK (quark_global);
204 +
205 +@@ -200,6 +206,9 @@
206 + return 0;
207 +
208 + G_LOCK (quark_global);
209 ++#if !defined(__GLIBC__)
210 ++ g_quark_init ();
211 ++#endif
212 + quark = quark_from_string (string, duplicate);
213 + G_UNLOCK (quark_global);
214 +
215 +@@ -278,6 +287,7 @@
216 + GQuark quark;
217 + gchar **quarks_new;
218 +
219 ++ g_quark_init ();
220 + if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
221 + {
222 + quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);
223 +@@ -310,6 +320,9 @@
224 + return NULL;
225 +
226 + G_LOCK (quark_global);
227 ++#if !defined(__GLIBC__)
228 ++ g_quark_init ();
229 ++#endif
230 + quark = quark_from_string (string, duplicate);
231 + result = quarks[quark];
232 + G_UNLOCK (quark_global);
233
234 diff --git a/dev-libs/glib/files/glib-2.54.3-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.54.3-external-gdbus-codegen.patch
235 new file mode 100644
236 index 0000000..a27966e
237 --- /dev/null
238 +++ b/dev-libs/glib/files/glib-2.54.3-external-gdbus-codegen.patch
239 @@ -0,0 +1,86 @@
240 +From 2e47d49bc91d83cd0abea4c1944bfca4336040fa Mon Sep 17 00:00:00 2001
241 +From: Sobhan Mohammadpour <sobhan@g.o>
242 +Date: Fri, 23 Feb 2018 15:27:33 +0330
243 +Subject: [PATCH] glib-2.54.3-external-gdbus-codegen-for-autotools
244 +
245 +---
246 + configure.ac | 1 -
247 + docs/reference/gio/Makefile.am | 1 -
248 + gio/Makefile.am | 2 +-
249 + gio/tests/Makefile.am | 6 ++----
250 + gio/tests/gdbus-object-manager-example/Makefile.am | 6 ++----
251 + 5 files changed, 5 insertions(+), 11 deletions(-)
252 +
253 +diff --git a/configure.ac b/configure.ac
254 +index 0457c90..07166c9 100644
255 +--- a/configure.ac
256 ++++ b/configure.ac
257 +@@ -3469,7 +3469,6 @@ gobject/glib-mkenums
258 + gobject/tests/Makefile
259 + gthread/Makefile
260 + gio/Makefile
261 +-gio/gdbus-2.0/codegen/Makefile
262 + gio/gdbus-2.0/codegen/config.py
263 + gio/gnetworking.h
264 + gio/xdgmime/Makefile
265 +diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
266 +index 5741a3e..d38e768 100644
267 +--- a/docs/reference/gio/Makefile.am
268 ++++ b/docs/reference/gio/Makefile.am
269 +@@ -177,7 +177,6 @@ man_MANS += \
270 + gsettings.1 \
271 + gresource.1 \
272 + gdbus.1 \
273 +- gdbus-codegen.1 \
274 + gio.1 \
275 + $(NULL)
276 +
277 +diff --git a/gio/Makefile.am b/gio/Makefile.am
278 +index b2db995..53d7162 100644
279 +--- a/gio/Makefile.am
280 ++++ b/gio/Makefile.am
281 +@@ -1,6 +1,6 @@
282 + include $(top_srcdir)/glib.mk
283 +
284 +-SUBDIRS = gdbus-2.0/codegen
285 ++SUBDIRS =
286 +
287 + if OS_UNIX
288 + if !OS_COCOA
289 +diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
290 +index acc1da4..7c51eab 100644
291 +--- a/gio/tests/Makefile.am
292 ++++ b/gio/tests/Makefile.am
293 +@@ -460,10 +460,8 @@ gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotifica
294 +
295 + BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h
296 + gdbus-test-codegen.o: gdbus-test-codegen-generated.h
297 +-gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
298 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
299 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
300 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
301 ++gdbus-test-codegen-generated.h: test-codegen.xml Makefile
302 ++ $(AM_V_GEN) gdbus-codegen \
303 + --interface-prefix org.project. \
304 + --generate-c-code gdbus-test-codegen-generated \
305 + --c-generate-object-manager \
306 +diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
307 +index 1d0464c..f390dca 100644
308 +--- a/gio/tests/gdbus-object-manager-example/Makefile.am
309 ++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
310 +@@ -11,10 +11,8 @@ GDBUS_GENERATED = \
311 + gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml \
312 + $(NULL)
313 +
314 +-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
315 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
316 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
317 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
318 ++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
319 ++ $(AM_V_GEN) gdbus-codegen \
320 + --interface-prefix org.gtk.GDBus.Example.ObjectManager. \
321 + --c-namespace Example \
322 + --c-generate-object-manager \
323 +--
324 +2.16.1
325 +
326
327 diff --git a/dev-libs/glib/files/glib-2.58.2-external-gdbus-codegen.patch b/dev-libs/glib/files/glib-2.58.2-external-gdbus-codegen.patch
328 new file mode 100644
329 index 0000000..7615dbb
330 --- /dev/null
331 +++ b/dev-libs/glib/files/glib-2.58.2-external-gdbus-codegen.patch
332 @@ -0,0 +1,124 @@
333 +From 69da419c33c24a05126d21fb3098139d30ba9093 Mon Sep 17 00:00:00 2001
334 +From: Mart Raudsepp <leio@g.o>
335 +Date: Wed, 19 Dec 2018 14:01:43 +0200
336 +Subject: [PATCH] build: don't build gdbus-codegen and rely on external
337 + gdbus-codegen for tests
338 +
339 +---
340 + configure.ac | 1 -
341 + docs/reference/gio/Makefile.am | 1 -
342 + gio/Makefile.am | 2 +-
343 + gio/tests/Makefile.am | 22 ++++++-------------
344 + .../gdbus-object-manager-example/Makefile.am | 6 ++---
345 + 5 files changed, 10 insertions(+), 22 deletions(-)
346 +
347 +diff --git a/configure.ac b/configure.ac
348 +index 4b15b69b8..9187a12bb 100644
349 +--- a/configure.ac
350 ++++ b/configure.ac
351 +@@ -3481,7 +3481,6 @@ gobject/glib-mkenums
352 + gobject/tests/Makefile
353 + gthread/Makefile
354 + gio/Makefile
355 +-gio/gdbus-2.0/codegen/Makefile
356 + gio/gdbus-2.0/codegen/config.py
357 + gio/gnetworking.h
358 + gio/xdgmime/Makefile
359 +diff --git a/docs/reference/gio/Makefile.am b/docs/reference/gio/Makefile.am
360 +index 08093e8a0..9ce11f824 100644
361 +--- a/docs/reference/gio/Makefile.am
362 ++++ b/docs/reference/gio/Makefile.am
363 +@@ -212,7 +212,6 @@ man_MANS += \
364 + gsettings.1 \
365 + gresource.1 \
366 + gdbus.1 \
367 +- gdbus-codegen.1 \
368 + gio.1 \
369 + $(NULL)
370 +
371 +diff --git a/gio/Makefile.am b/gio/Makefile.am
372 +index 05b20cdef..ed5d7d4cb 100644
373 +--- a/gio/Makefile.am
374 ++++ b/gio/Makefile.am
375 +@@ -1,6 +1,6 @@
376 + include $(top_srcdir)/glib.mk
377 +
378 +-SUBDIRS = gdbus-2.0/codegen
379 ++SUBDIRS =
380 +
381 + if OS_UNIX
382 + SUBDIRS += xdgmime
383 +diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
384 +index c4e7a9257..4b538b1e9 100644
385 +--- a/gio/tests/Makefile.am
386 ++++ b/gio/tests/Makefile.am
387 +@@ -253,9 +253,7 @@ gdbus-daemon-impl.c: $(top_srcdir)/gio/gdbusdaemon.c
388 + # These files are only generated on Windows builds inside GIO,
389 + # but we want them on non-Windows builds for the tests
390 + gdbus-daemon-generated.h gdbus-daemon-generated.c: $(top_srcdir)/gio/dbus-daemon.xml $(GDBUS_PYTHON_DEPS)
391 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
392 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
393 +- $(PYTHON) $(top_srcdir)/gio/gdbus-2.0/codegen/gdbus-codegen.in \
394 ++ $(AM_V_GEN) gdbus-codegen \
395 + --interface-prefix org. \
396 + --generate-c-code gdbus-daemon-generated \
397 + --c-namespace _G \
398 +@@ -494,10 +492,8 @@ gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotifica
399 +
400 + BUILT_SOURCES += gdbus-test-codegen-generated.c gdbus-test-codegen-generated.h gdbus-test-codegen-generated-interface-info.c gdbus-test-codegen-generated-interface-info.h
401 + gdbus-test-codegen.o: gdbus-test-codegen-generated.h gdbus-test-codegen-generated-interface-info.h
402 +-gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
403 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
404 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
405 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
406 ++gdbus-test-codegen-generated.h: test-codegen.xml Makefile
407 ++ $(AM_V_GEN) gdbus-codegen \
408 + --interface-prefix org.project. \
409 + --generate-c-code gdbus-test-codegen-generated \
410 + --c-generate-object-manager \
411 +@@ -516,10 +512,8 @@ gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gd
412 + $(NULL)
413 + gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
414 + @: # Generated as side-effect of .h
415 +-gdbus-test-codegen-generated-interface-info.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
416 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
417 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
418 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
419 ++gdbus-test-codegen-generated-interface-info.h: test-codegen.xml Makefile
420 ++ $(AM_V_GEN) gdbus-codegen \
421 + --interface-info-header \
422 + --annotate "org.project.Bar" Key1 Value1 \
423 + --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
424 +@@ -532,10 +526,8 @@ gdbus-test-codegen-generated-interface-info.h: test-codegen.xml Makefile $(top_b
425 + --output $@ \
426 + $(srcdir)/test-codegen.xml \
427 + $(NULL)
428 +-gdbus-test-codegen-generated-interface-info.c: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
429 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
430 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
431 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
432 ++gdbus-test-codegen-generated-interface-info.c: test-codegen.xml Makefile
433 ++ $(AM_V_GEN) gdbus-codegen \
434 + --interface-info-body \
435 + --annotate "org.project.Bar" Key1 Value1 \
436 + --annotate "org.project.Bar" org.gtk.GDBus.Internal Value2 \
437 +diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
438 +index 1d0464c5c..0603d9b0a 100644
439 +--- a/gio/tests/gdbus-object-manager-example/Makefile.am
440 ++++ b/gio/tests/gdbus-object-manager-example/Makefile.am
441 +@@ -11,10 +11,8 @@ GDBUS_GENERATED = \
442 + gdbus-example-objectmanager-generated-org.gtk.GDBus.Example.ObjectManager.Cat.xml \
443 + $(NULL)
444 +
445 +-$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
446 +- $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
447 +- UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
448 +- $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
449 ++$(GDBUS_GENERATED) : gdbus-example-objectmanager.xml Makefile
450 ++ $(AM_V_GEN) gdbus-codegen \
451 + --interface-prefix org.gtk.GDBus.Example.ObjectManager. \
452 + --c-namespace Example \
453 + --c-generate-object-manager \
454 +--
455 +2.17.0
456 +
457
458 diff --git a/dev-libs/glib/files/glib-2.58.2-gvariant-test-fix.patch b/dev-libs/glib/files/glib-2.58.2-gvariant-test-fix.patch
459 new file mode 100644
460 index 0000000..0bd3a85
461 --- /dev/null
462 +++ b/dev-libs/glib/files/glib-2.58.2-gvariant-test-fix.patch
463 @@ -0,0 +1,96 @@
464 +From 8a028c250a82b667562efcfdf51d35506383adbb Mon Sep 17 00:00:00 2001
465 +From: Mart Raudsepp <leio@g.o>
466 +Date: Wed, 19 Dec 2018 16:22:21 +0200
467 +Subject: [PATCH] tests: Allocate gvariant data from the heap to guarantee
468 + alignment
469 +
470 +On glib-2-58 branch we don't have !455, thus we need aligned data
471 +for the gvariant tests to not fail on i686.
472 +
473 +Fixes #1626
474 +---
475 + glib/tests/gvariant.c | 15 ++++++++++++---
476 + 1 file changed, 12 insertions(+), 3 deletions(-)
477 +
478 +diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
479 +index 8047ef5e8..5ca7b964e 100644
480 +--- a/glib/tests/gvariant.c
481 ++++ b/glib/tests/gvariant.c
482 +@@ -4770,6 +4770,7 @@ test_stack_dict_init (void)
483 + static void
484 + test_normal_checking_tuples (void)
485 + {
486 ++ gpointer aligned_data;
487 + const guint8 data[] = {
488 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
489 + 'a', '(', 'a', 'o', 'a', 'o', 'a', 'a', 'o', 'a', 'a', 'o', ')'
490 +@@ -4778,13 +4779,15 @@ test_normal_checking_tuples (void)
491 + GVariant *variant = NULL;
492 + GVariant *normal_variant = NULL;
493 +
494 +- variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, data, size,
495 ++ aligned_data = g_memdup (data, size); /* guarantee alignment */
496 ++ variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
497 + FALSE, NULL, NULL);
498 + g_assert_nonnull (variant);
499 +
500 + normal_variant = g_variant_get_normal_form (variant);
501 + g_assert_nonnull (normal_variant);
502 +
503 ++ g_free (aligned_data);
504 + g_variant_unref (normal_variant);
505 + g_variant_unref (variant);
506 + }
507 +@@ -4896,6 +4899,7 @@ test_recursion_limits_array_in_variant (void)
508 + static void
509 + test_normal_checking_array_offsets (void)
510 + {
511 ++ gpointer aligned_data;
512 + const guint8 data[] = {
513 + 0x07, 0xe5, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00,
514 + 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'g',
515 +@@ -4904,13 +4908,15 @@ test_normal_checking_array_offsets (void)
516 + GVariant *variant = NULL;
517 + GVariant *normal_variant = NULL;
518 +
519 +- variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, data, size,
520 ++ aligned_data = g_memdup (data, size); /* guarantee alignment */
521 ++ variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
522 + FALSE, NULL, NULL);
523 + g_assert_nonnull (variant);
524 +
525 + normal_variant = g_variant_get_normal_form (variant);
526 + g_assert_nonnull (normal_variant);
527 +
528 ++ g_free (aligned_data);
529 + g_variant_unref (normal_variant);
530 + g_variant_unref (variant);
531 + }
532 +@@ -4944,6 +4950,7 @@ test_normal_checking_tuple_offsets (void)
533 + static void
534 + test_normal_checking_empty_object_path (void)
535 + {
536 ++ gpointer aligned_data;
537 + const guint8 data[] = {
538 + 0x20, 0x20, 0x00, 0x00, 0x00, 0x00,
539 + '(', 'h', '(', 'a', 'i', 'a', 'b', 'i', 'o', ')', ')',
540 +@@ -4952,13 +4959,15 @@ test_normal_checking_empty_object_path (void)
541 + GVariant *variant = NULL;
542 + GVariant *normal_variant = NULL;
543 +
544 +- variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, data, size,
545 ++ aligned_data = g_memdup (data, size); /* guarantee alignment */
546 ++ variant = g_variant_new_from_data (G_VARIANT_TYPE_VARIANT, aligned_data, size,
547 + FALSE, NULL, NULL);
548 + g_assert_nonnull (variant);
549 +
550 + normal_variant = g_variant_get_normal_form (variant);
551 + g_assert_nonnull (normal_variant);
552 +
553 ++ g_free (aligned_data);
554 + g_variant_unref (normal_variant);
555 + g_variant_unref (variant);
556 + }
557 +--
558 +2.17.0
559 +
560
561 diff --git a/dev-libs/glib/glib-2.56.2.ebuild b/dev-libs/glib/glib-2.56.2.ebuild
562 new file mode 100644
563 index 0000000..e200d73
564 --- /dev/null
565 +++ b/dev-libs/glib/glib-2.56.2.ebuild
566 @@ -0,0 +1,302 @@
567 +# Copyright 1999-2018 Gentoo Fondation
568 +# Distributed under the terms of the GNU General Public License v2
569 +
570 +EAPI=6
571 +PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
572 +GNOME2_EAUTORECONF=yes
573 +
574 +inherit autotools bash-completion-r1 epunt-cxx flag-o-matic gnome2 libtool linux-info \
575 + multilib multilib-minimal pax-utils python-any-r1 toolchain-funcs virtualx
576 +
577 +# Until bug #537330 glib is a reverse dependency of pkgconfig and, then
578 +# adding new dependencies end up making stage3 to grow. Every addition needs
579 +# then to be think very closely.
580 +
581 +DESCRIPTION="The GLib library of C routines"
582 +HOMEPAGE="https://www.gtk.org/"
583 +SRC_URI="${SRC_URI}
584 + https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
585 +
586 +LICENSE="LGPL-2.1+"
587 +SLOT="2"
588 +IUSE="dbus debug fam kernel_linux +mime selinux static-libs systemtap test utils xattr"
589 +
590 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
591 +
592 +# Added util-linux multilib dependency to have libmount support (which
593 +# is always turned on on linux systems, unless explicitly disabled, but
594 +# this ebuild does not do that anyway) (bug #599586)
595 +
596 +RDEPEND="
597 + !<dev-util/gdbus-codegen-${PV}
598 + >=dev-libs/libpcre-8.13:3[${MULTILIB_USEDEP},static-libs?]
599 + >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
600 + >=virtual/libffi-3.0.13-r1:=[${MULTILIB_USEDEP}]
601 + >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
602 + >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
603 + kernel_linux? ( sys-apps/util-linux[${MULTILIB_USEDEP}] )
604 + selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] )
605 + xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] )
606 + fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
607 + utils? (
608 + >=dev-util/gdbus-codegen-${PV}
609 + virtual/libelf:0=
610 + )
611 +"
612 +DEPEND="${RDEPEND}
613 + app-text/docbook-xml-dtd:4.1.2
614 + >=dev-libs/libxslt-1.0
615 + >=sys-devel/gettext-0.11
616 + >=dev-util/gtk-doc-am-1.20
617 + systemtap? ( >=dev-util/systemtap-1.3 )
618 + ${PYTHON_DEPS}
619 + test? (
620 + sys-devel/gdb
621 + >=dev-util/gdbus-codegen-${PV}
622 + >=sys-apps/dbus-1.2.14 )
623 + !<dev-util/gtk-doc-1.15-r2
624 +"
625 +# Migration of glib-genmarshal, glib-mkenums and gtester-report to a separate
626 +# python depending package, which can be buildtime depended in packages that
627 +# need these tools, without pulling in python at runtime.
628 +RDEPEND="${RDEPEND}
629 + >=dev-util/glib-utils-${PV}"
630 +PDEPEND="
631 + dbus? ( gnome-base/dconf )
632 + mime? ( x11-misc/shared-mime-info )
633 +"
634 +# shared-mime-info needed for gio/xdgmime, bug #409481
635 +# dconf is needed to be able to save settings, bug #498436
636 +
637 +MULTILIB_CHOST_TOOLS=(
638 + /usr/bin/gio-querymodules$(get_exeext)
639 +)
640 +
641 +pkg_setup() {
642 + if use kernel_linux ; then
643 + CONFIG_CHECK="~INOTIFY_USER"
644 + if use test ; then
645 + CONFIG_CHECK="~IPV6"
646 + WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
647 + fi
648 + linux-info_pkg_setup
649 + fi
650 + python-any-r1_pkg_setup
651 +}
652 +
653 +src_prepare() {
654 +
655 + # Musl fix
656 + eapply "${FILESDIR}/${PV}-quark_init_on_demand.patch"
657 + eapply "${FILESDIR}/${PV}-gobject_init_on_demand.patch"
658 +
659 + # Prevent build failure in stage3 where pkgconfig is not available, bug #481056
660 + mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
661 +
662 + if use test; then
663 + # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
664 + if ! has_version dev-util/desktop-file-utils ; then
665 + ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
666 + ewarn "think on installing it to get these tests run."
667 + sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
668 + sed -i -e "/g_test_add_func/d" gio/tests/desktop-app-info.c || die
669 + fi
670 +
671 + # gdesktopappinfo requires existing terminal (gnome-terminal or any
672 + # other), falling back to xterm if one doesn't exist
673 + if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
674 + ewarn "Some tests will be skipped due to missing terminal program"
675 + sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
676 + fi
677 +
678 + # https://bugzilla.gnome.org/show_bug.cgi?id=722604
679 + sed -i -e "/timer\/stop/d" glib/tests/timer.c || die
680 + sed -i -e "/timer\/basic/d" glib/tests/timer.c || die
681 +
682 + ewarn "Tests for search-utils have been skipped"
683 + sed -i -e "/search-utils/d" glib/tests/Makefile.am || die
684 + else
685 + # Don't build tests, also prevents extra deps, bug #512022
686 + sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die
687 + fi
688 +
689 + # Less max runs in network monitor race test to avoid hitting timeout limits
690 + eapply "${FILESDIR}"/${PV}-network-monitor-race-test-iterations.patch # included in 2.57.1
691 +
692 + # gdbus-codegen is a separate package
693 + eapply "${FILESDIR}"/${PN}-2.54.3-external-gdbus-codegen.patch
694 +
695 + gnome2_src_prepare
696 + epunt_cxx
697 +}
698 +
699 +multilib_src_configure() {
700 + # Avoid circular depend with dev-util/pkgconfig and
701 + # native builds (cross-compiles won't need pkg-config
702 + # in the target ROOT to work here)
703 + if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
704 + if has_version sys-apps/dbus; then
705 + export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
706 + export DBUS1_LIBS="-ldbus-1"
707 + fi
708 + export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
709 + export LIBFFI_LIBS="-lffi"
710 + export PCRE_CFLAGS=" " # test -n "$PCRE_CFLAGS" needs to pass
711 + export PCRE_LIBS="-lpcre"
712 + fi
713 +
714 + # These configure tests don't work when cross-compiling.
715 + if tc-is-cross-compiler ; then
716 + # https://bugzilla.gnome.org/show_bug.cgi?id=756473
717 + case ${CHOST} in
718 + hppa*|metag*) export glib_cv_stack_grows=yes ;;
719 + *) export glib_cv_stack_grows=no ;;
720 + esac
721 + # https://bugzilla.gnome.org/show_bug.cgi?id=756474
722 + export glib_cv_uscore=no
723 + # https://bugzilla.gnome.org/show_bug.cgi?id=756475
724 + export ac_cv_func_posix_get{pwuid,grgid}_r=yes
725 + fi
726 +
727 + local myconf
728 +
729 + case "${CHOST}" in
730 + *-mingw*) myconf="${myconf} --with-threads=win32" ;;
731 + *) myconf="${myconf} --with-threads=posix" ;;
732 + esac
733 +
734 + # libelf used only by the gresource bin
735 + ECONF_SOURCE="${S}" gnome2_src_configure ${myconf} \
736 + $(usex debug --enable-debug=yes ' ') \
737 + $(use_enable xattr) \
738 + $(use_enable fam) \
739 + $(use_enable kernel_linux libmount) \
740 + $(use_enable selinux) \
741 + $(use_enable static-libs static) \
742 + $(use_enable systemtap dtrace) \
743 + $(use_enable systemtap systemtap) \
744 + $(multilib_native_use_enable utils libelf) \
745 + --with-python=${EPYTHON} \
746 + --disable-compile-warnings \
747 + --enable-man \
748 + --with-pcre=system \
749 + --with-xml-catalog="${EPREFIX}/etc/xml/catalog"
750 +
751 + if multilib_is_native_abi; then
752 + local d
753 + for d in glib gio gobject; do
754 + ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
755 + done
756 + fi
757 +}
758 +
759 +multilib_src_test() {
760 + export XDG_CONFIG_DIRS=/etc/xdg
761 + export XDG_DATA_DIRS=/usr/local/share:/usr/share
762 + export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
763 + export LC_TIME=C # bug #411967
764 + unset GSETTINGS_BACKEND # bug #596380
765 + python_setup
766 +
767 + # Related test is a bit nitpicking
768 + mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
769 + chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
770 +
771 + # Hardened: gdb needs this, bug #338891
772 + if host-is-pax ; then
773 + pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
774 + || die "Hardened adjustment failed"
775 + fi
776 +
777 + # Need X for dbus-launch session X11 initialization
778 + virtx emake check
779 +}
780 +
781 +multilib_src_install() {
782 + emake DESTDIR="${D}" completiondir="$(get_bashcompdir)" install
783 + keepdir /usr/$(get_libdir)/gio/modules
784 +}
785 +
786 +multilib_src_install_all() {
787 + einstalldocs
788 +
789 + # These are installed by dev-util/glib-utils
790 + # TODO: With patching we might be able to get rid of the python-any deps and removals, and test depend on glib-utils instead; revisit with meson
791 + rm "${ED}usr/bin/glib-genmarshal" || die
792 + rm "${ED}usr/share/man/man1/glib-genmarshal.1" || die
793 + rm "${ED}usr/bin/glib-mkenums" || die
794 + rm "${ED}usr/share/man/man1/glib-mkenums.1" || die
795 + rm "${ED}usr/bin/gtester-report" || die
796 + rm "${ED}usr/share/man/man1/gtester-report.1" || die
797 +
798 + # Do not install charset.alias even if generated, leave it to libiconv
799 + rm -f "${ED}/usr/$(get_libdir)/charset.alias"
800 +
801 + # Don't install gdb python macros, bug 291328
802 + rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
803 +
804 + # Completely useless with or without USE static-libs, people need to use pkg-config
805 + find "${ED}" -name '*.la' -delete || die
806 +}
807 +
808 +pkg_preinst() {
809 + gnome2_pkg_preinst
810 +
811 + # Make gschemas.compiled belong to glib alone
812 + local cache="usr/share/glib-2.0/schemas/gschemas.compiled"
813 +
814 + if [[ -e ${EROOT}${cache} ]]; then
815 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
816 + else
817 + touch "${ED}"/${cache} || die
818 + fi
819 +
820 + multilib_pkg_preinst() {
821 + # Make giomodule.cache belong to glib alone
822 + local cache="usr/$(get_libdir)/gio/modules/giomodule.cache"
823 +
824 + if [[ -e ${EROOT}${cache} ]]; then
825 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
826 + else
827 + touch "${ED}"/${cache} || die
828 + fi
829 + }
830 +
831 + # Don't run the cache ownership when cross-compiling, as it would end up with an empty cache
832 + # file due to inability to create it and GIO might not look at any of the modules there
833 + if ! tc-is-cross-compiler ; then
834 + multilib_foreach_abi multilib_pkg_preinst
835 + fi
836 +}
837 +
838 +pkg_postinst() {
839 + # force (re)generation of gschemas.compiled
840 + GNOME2_ECLASS_GLIB_SCHEMAS="force"
841 +
842 + gnome2_pkg_postinst
843 +
844 + multilib_pkg_postinst() {
845 + gnome2_giomodule_cache_update \
846 + || die "Update GIO modules cache failed (for ${ABI})"
847 + }
848 + if ! tc-is-cross-compiler ; then
849 + multilib_foreach_abi multilib_pkg_postinst
850 + else
851 + ewarn "Updating of GIO modules cache skipped due to cross-compilation."
852 + ewarn "You might want to run gio-querymodules manually on the target for"
853 + ewarn "your final image for performance reasons and re-run it when packages"
854 + ewarn "installing GIO modules get upgraded or added to the image."
855 + fi
856 +}
857 +
858 +pkg_postrm() {
859 + gnome2_pkg_postrm
860 +
861 + if [[ -z ${REPLACED_BY_VERSION} ]]; then
862 + multilib_pkg_postrm() {
863 + rm -f "${EROOT}"usr/$(get_libdir)/gio/modules/giomodule.cache
864 + }
865 + multilib_foreach_abi multilib_pkg_postrm
866 + rm -f "${EROOT}"usr/share/glib-2.0/schemas/gschemas.compiled
867 + fi
868 +}
869
870 diff --git a/dev-libs/glib/glib-2.56.4.ebuild b/dev-libs/glib/glib-2.56.4.ebuild
871 new file mode 100644
872 index 0000000..f667e2c
873 --- /dev/null
874 +++ b/dev-libs/glib/glib-2.56.4.ebuild
875 @@ -0,0 +1,305 @@
876 +# Copyright 1999-2018 Gentoo Authors
877 +# Distributed under the terms of the GNU General Public License v2
878 +
879 +EAPI=6
880 +PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
881 +GNOME2_EAUTORECONF=yes
882 +
883 +inherit autotools bash-completion-r1 epunt-cxx flag-o-matic gnome2 libtool linux-info \
884 + multilib multilib-minimal pax-utils python-any-r1 toolchain-funcs virtualx
885 +
886 +# Until bug #537330 glib is a reverse dependency of pkgconfig and, then
887 +# adding new dependencies end up making stage3 to grow. Every addition needs
888 +# then to be think very closely.
889 +
890 +DESCRIPTION="The GLib library of C routines"
891 +HOMEPAGE="https://www.gtk.org/"
892 +SRC_URI="${SRC_URI}
893 + https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
894 +
895 +LICENSE="LGPL-2.1+"
896 +SLOT="2"
897 +IUSE="dbus debug fam kernel_linux +mime selinux static-libs systemtap test utils xattr"
898 +
899 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
900 +
901 +# Added util-linux multilib dependency to have libmount support (which
902 +# is always turned on on linux systems, unless explicitly disabled, but
903 +# this ebuild does not do that anyway) (bug #599586)
904 +
905 +RDEPEND="
906 + !<dev-util/gdbus-codegen-${PV}
907 + >=dev-libs/libpcre-8.13:3[${MULTILIB_USEDEP},static-libs?]
908 + >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
909 + >=virtual/libffi-3.0.13-r1:=[${MULTILIB_USEDEP}]
910 + >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
911 + >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
912 + kernel_linux? ( sys-apps/util-linux[${MULTILIB_USEDEP}] )
913 + selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] )
914 + xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] )
915 + fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
916 + utils? (
917 + >=dev-util/gdbus-codegen-${PV}
918 + virtual/libelf:0=
919 + )
920 +"
921 +DEPEND="${RDEPEND}
922 + app-text/docbook-xml-dtd:4.1.2
923 + >=dev-libs/libxslt-1.0
924 + >=sys-devel/gettext-0.11
925 + >=dev-util/gtk-doc-am-1.20
926 + systemtap? ( >=dev-util/systemtap-1.3 )
927 + ${PYTHON_DEPS}
928 + test? (
929 + sys-devel/gdb
930 + >=dev-util/gdbus-codegen-${PV}
931 + >=sys-apps/dbus-1.2.14 )
932 + !<dev-util/gtk-doc-1.15-r2
933 +"
934 +# Migration of glib-genmarshal, glib-mkenums and gtester-report to a separate
935 +# python depending package, which can be buildtime depended in packages that
936 +# need these tools, without pulling in python at runtime.
937 +RDEPEND="${RDEPEND}
938 + >=dev-util/glib-utils-${PV}"
939 +PDEPEND="
940 + dbus? ( gnome-base/dconf )
941 + mime? ( x11-misc/shared-mime-info )
942 +"
943 +# shared-mime-info needed for gio/xdgmime, bug #409481
944 +# dconf is needed to be able to save settings, bug #498436
945 +
946 +MULTILIB_CHOST_TOOLS=(
947 + /usr/bin/gio-querymodules$(get_exeext)
948 +)
949 +
950 +pkg_setup() {
951 + if use kernel_linux ; then
952 + CONFIG_CHECK="~INOTIFY_USER"
953 + if use test ; then
954 + CONFIG_CHECK="~IPV6"
955 + WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
956 + fi
957 + linux-info_pkg_setup
958 + fi
959 + python-any-r1_pkg_setup
960 +}
961 +
962 +src_prepare() {
963 +
964 + # Musl fix
965 + eapply "${FILESDIR}/2.56.2-quark_init_on_demand.patch"
966 + eapply "${FILESDIR}/2.56.2-gobject_init_on_demand.patch"
967 +
968 + # Prevent build failure in stage3 where pkgconfig is not available, bug #481056
969 + mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
970 +
971 + if use test; then
972 + # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
973 + if ! has_version dev-util/desktop-file-utils ; then
974 + ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
975 + ewarn "think on installing it to get these tests run."
976 + sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
977 + sed -i -e "/g_test_add_func/d" gio/tests/desktop-app-info.c || die
978 + fi
979 +
980 + # gdesktopappinfo requires existing terminal (gnome-terminal or any
981 + # other), falling back to xterm if one doesn't exist
982 + if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
983 + ewarn "Some tests will be skipped due to missing terminal program"
984 + sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
985 + fi
986 +
987 + # https://bugzilla.gnome.org/show_bug.cgi?id=722604
988 + sed -i -e "/timer\/stop/d" glib/tests/timer.c || die
989 + sed -i -e "/timer\/basic/d" glib/tests/timer.c || die
990 +
991 + ewarn "Tests for search-utils have been skipped"
992 + sed -i -e "/search-utils/d" glib/tests/Makefile.am || die
993 + else
994 + # Don't build tests, also prevents extra deps, bug #512022
995 + sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die
996 + fi
997 +
998 + # Less max runs in network monitor race test to avoid hitting timeout limits
999 + eapply "${FILESDIR}"/2.56.2-network-monitor-race-test-iterations.patch # included in 2.57.1
1000 +
1001 + # https://gitlab.gnome.org/GNOME/glib/issues/1626
1002 + eapply "${FILESDIR}"/${PN}-2.58.2-gvariant-test-fix.patch
1003 +
1004 + # gdbus-codegen is a separate package
1005 + eapply "${FILESDIR}"/${PN}-2.54.3-external-gdbus-codegen.patch
1006 +
1007 + gnome2_src_prepare
1008 + epunt_cxx
1009 +}
1010 +
1011 +multilib_src_configure() {
1012 + # Avoid circular depend with dev-util/pkgconfig and
1013 + # native builds (cross-compiles won't need pkg-config
1014 + # in the target ROOT to work here)
1015 + if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
1016 + if has_version sys-apps/dbus; then
1017 + export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
1018 + export DBUS1_LIBS="-ldbus-1"
1019 + fi
1020 + export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
1021 + export LIBFFI_LIBS="-lffi"
1022 + export PCRE_CFLAGS=" " # test -n "$PCRE_CFLAGS" needs to pass
1023 + export PCRE_LIBS="-lpcre"
1024 + fi
1025 +
1026 + # These configure tests don't work when cross-compiling.
1027 + if tc-is-cross-compiler ; then
1028 + # https://bugzilla.gnome.org/show_bug.cgi?id=756473
1029 + case ${CHOST} in
1030 + hppa*|metag*) export glib_cv_stack_grows=yes ;;
1031 + *) export glib_cv_stack_grows=no ;;
1032 + esac
1033 + # https://bugzilla.gnome.org/show_bug.cgi?id=756474
1034 + export glib_cv_uscore=no
1035 + # https://bugzilla.gnome.org/show_bug.cgi?id=756475
1036 + export ac_cv_func_posix_get{pwuid,grgid}_r=yes
1037 + fi
1038 +
1039 + local myconf
1040 +
1041 + case "${CHOST}" in
1042 + *-mingw*) myconf="${myconf} --with-threads=win32" ;;
1043 + *) myconf="${myconf} --with-threads=posix" ;;
1044 + esac
1045 +
1046 + # libelf used only by the gresource bin
1047 + ECONF_SOURCE="${S}" gnome2_src_configure ${myconf} \
1048 + $(usex debug --enable-debug=yes ' ') \
1049 + $(use_enable xattr) \
1050 + $(use_enable fam) \
1051 + $(use_enable kernel_linux libmount) \
1052 + $(use_enable selinux) \
1053 + $(use_enable static-libs static) \
1054 + $(use_enable systemtap dtrace) \
1055 + $(use_enable systemtap systemtap) \
1056 + $(multilib_native_use_enable utils libelf) \
1057 + --with-python=${EPYTHON} \
1058 + --disable-compile-warnings \
1059 + --enable-man \
1060 + --with-pcre=system \
1061 + --with-xml-catalog="${EPREFIX}/etc/xml/catalog"
1062 +
1063 + if multilib_is_native_abi; then
1064 + local d
1065 + for d in glib gio gobject; do
1066 + ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
1067 + done
1068 + fi
1069 +}
1070 +
1071 +multilib_src_test() {
1072 + export XDG_CONFIG_DIRS=/etc/xdg
1073 + export XDG_DATA_DIRS=/usr/local/share:/usr/share
1074 + export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
1075 + export LC_TIME=C # bug #411967
1076 + unset GSETTINGS_BACKEND # bug #596380
1077 + python_setup
1078 +
1079 + # Related test is a bit nitpicking
1080 + mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
1081 + chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
1082 +
1083 + # Hardened: gdb needs this, bug #338891
1084 + if host-is-pax ; then
1085 + pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
1086 + || die "Hardened adjustment failed"
1087 + fi
1088 +
1089 + # Need X for dbus-launch session X11 initialization
1090 + virtx emake check
1091 +}
1092 +
1093 +multilib_src_install() {
1094 + emake DESTDIR="${D}" completiondir="$(get_bashcompdir)" install
1095 + keepdir /usr/$(get_libdir)/gio/modules
1096 +}
1097 +
1098 +multilib_src_install_all() {
1099 + einstalldocs
1100 +
1101 + # These are installed by dev-util/glib-utils
1102 + # TODO: With patching we might be able to get rid of the python-any deps and removals, and test depend on glib-utils instead; revisit with meson
1103 + rm "${ED}usr/bin/glib-genmarshal" || die
1104 + rm "${ED}usr/share/man/man1/glib-genmarshal.1" || die
1105 + rm "${ED}usr/bin/glib-mkenums" || die
1106 + rm "${ED}usr/share/man/man1/glib-mkenums.1" || die
1107 + rm "${ED}usr/bin/gtester-report" || die
1108 + rm "${ED}usr/share/man/man1/gtester-report.1" || die
1109 +
1110 + # Do not install charset.alias even if generated, leave it to libiconv
1111 + rm -f "${ED}/usr/$(get_libdir)/charset.alias"
1112 +
1113 + # Don't install gdb python macros, bug 291328
1114 + rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
1115 +
1116 + # Completely useless with or without USE static-libs, people need to use pkg-config
1117 + find "${ED}" -name '*.la' -delete || die
1118 +}
1119 +
1120 +pkg_preinst() {
1121 + gnome2_pkg_preinst
1122 +
1123 + # Make gschemas.compiled belong to glib alone
1124 + local cache="usr/share/glib-2.0/schemas/gschemas.compiled"
1125 +
1126 + if [[ -e ${EROOT}${cache} ]]; then
1127 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
1128 + else
1129 + touch "${ED}"/${cache} || die
1130 + fi
1131 +
1132 + multilib_pkg_preinst() {
1133 + # Make giomodule.cache belong to glib alone
1134 + local cache="usr/$(get_libdir)/gio/modules/giomodule.cache"
1135 +
1136 + if [[ -e ${EROOT}${cache} ]]; then
1137 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
1138 + else
1139 + touch "${ED}"/${cache} || die
1140 + fi
1141 + }
1142 +
1143 + # Don't run the cache ownership when cross-compiling, as it would end up with an empty cache
1144 + # file due to inability to create it and GIO might not look at any of the modules there
1145 + if ! tc-is-cross-compiler ; then
1146 + multilib_foreach_abi multilib_pkg_preinst
1147 + fi
1148 +}
1149 +
1150 +pkg_postinst() {
1151 + # force (re)generation of gschemas.compiled
1152 + GNOME2_ECLASS_GLIB_SCHEMAS="force"
1153 +
1154 + gnome2_pkg_postinst
1155 +
1156 + multilib_pkg_postinst() {
1157 + gnome2_giomodule_cache_update \
1158 + || die "Update GIO modules cache failed (for ${ABI})"
1159 + }
1160 + if ! tc-is-cross-compiler ; then
1161 + multilib_foreach_abi multilib_pkg_postinst
1162 + else
1163 + ewarn "Updating of GIO modules cache skipped due to cross-compilation."
1164 + ewarn "You might want to run gio-querymodules manually on the target for"
1165 + ewarn "your final image for performance reasons and re-run it when packages"
1166 + ewarn "installing GIO modules get upgraded or added to the image."
1167 + fi
1168 +}
1169 +
1170 +pkg_postrm() {
1171 + gnome2_pkg_postrm
1172 +
1173 + if [[ -z ${REPLACED_BY_VERSION} ]]; then
1174 + multilib_pkg_postrm() {
1175 + rm -f "${EROOT}"usr/$(get_libdir)/gio/modules/giomodule.cache
1176 + }
1177 + multilib_foreach_abi multilib_pkg_postrm
1178 + rm -f "${EROOT}"usr/share/glib-2.0/schemas/gschemas.compiled
1179 + fi
1180 +}
1181
1182 diff --git a/dev-libs/glib/glib-2.58.2.ebuild b/dev-libs/glib/glib-2.58.2.ebuild
1183 new file mode 100644
1184 index 0000000..92535b5
1185 --- /dev/null
1186 +++ b/dev-libs/glib/glib-2.58.2.ebuild
1187 @@ -0,0 +1,318 @@
1188 +# Copyright 1999-2018 Gentoo Authors
1189 +# Distributed under the terms of the GNU General Public License v2
1190 +
1191 +EAPI=6
1192 +PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
1193 +GNOME2_EAUTORECONF=yes
1194 +
1195 +inherit autotools bash-completion-r1 epunt-cxx flag-o-matic gnome2 libtool linux-info \
1196 + multilib multilib-minimal pax-utils python-any-r1 toolchain-funcs virtualx
1197 +
1198 +# Until bug #537330 glib is a reverse dependency of pkgconfig and, then
1199 +# adding new dependencies end up making stage3 to grow. Every addition needs
1200 +# then to be think very closely.
1201 +
1202 +DESCRIPTION="The GLib library of C routines"
1203 +HOMEPAGE="https://www.gtk.org/"
1204 +SRC_URI="${SRC_URI}
1205 + https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
1206 +
1207 +LICENSE="LGPL-2.1+"
1208 +SLOT="2"
1209 +IUSE="dbus debug fam gtk-doc kernel_linux +mime selinux static-libs systemtap test utils xattr"
1210 +
1211 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
1212 +
1213 +# Added util-linux multilib dependency to have libmount support (which
1214 +# is always turned on on linux systems, unless explicitly disabled, but
1215 +# this ebuild does not do that anyway) (bug #599586)
1216 +
1217 +RDEPEND="
1218 + !<dev-util/gdbus-codegen-${PV}
1219 + >=dev-libs/libpcre-8.31:3[${MULTILIB_USEDEP},static-libs?]
1220 + >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
1221 + >=virtual/libffi-3.0.13-r1:=[${MULTILIB_USEDEP}]
1222 + >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
1223 + >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
1224 + kernel_linux? ( >=sys-apps/util-linux-2.23[${MULTILIB_USEDEP}] )
1225 + selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] )
1226 + xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] )
1227 + fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
1228 + utils? (
1229 + >=dev-util/gdbus-codegen-${PV}
1230 + virtual/libelf:0=
1231 + )
1232 +"
1233 +DEPEND="${RDEPEND}
1234 + app-text/docbook-xml-dtd:4.1.2
1235 + app-text/docbook-xsl-stylesheets
1236 + >=dev-libs/libxslt-1.0
1237 + >=sys-devel/gettext-0.11
1238 + gtk-doc? ( >=dev-util/gtk-doc-1.20 )
1239 + systemtap? ( >=dev-util/systemtap-1.3 )
1240 + ${PYTHON_DEPS}
1241 + test? (
1242 + sys-devel/gdb
1243 + >=dev-util/gdbus-codegen-${PV}
1244 + >=sys-apps/dbus-1.2.14 )
1245 +"
1246 +# configure.ac has gtk-doc-am stuff behind m4_ifdef, so we don't need a gtk-doc-am build dep
1247 +
1248 +# Migration of glib-genmarshal, glib-mkenums and gtester-report to a separate
1249 +# python depending package, which can be buildtime depended in packages that
1250 +# need these tools, without pulling in python at runtime.
1251 +RDEPEND="${RDEPEND}
1252 + >=dev-util/glib-utils-${PV}"
1253 +PDEPEND="
1254 + dbus? ( gnome-base/dconf )
1255 + mime? ( x11-misc/shared-mime-info )
1256 +"
1257 +# shared-mime-info needed for gio/xdgmime, bug #409481
1258 +# dconf is needed to be able to save settings, bug #498436
1259 +
1260 +MULTILIB_CHOST_TOOLS=(
1261 + /usr/bin/gio-querymodules$(get_exeext)
1262 +)
1263 +
1264 +pkg_setup() {
1265 + if use kernel_linux ; then
1266 + CONFIG_CHECK="~INOTIFY_USER"
1267 + if use test ; then
1268 + CONFIG_CHECK="~IPV6"
1269 + WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
1270 + fi
1271 + linux-info_pkg_setup
1272 + fi
1273 + python-any-r1_pkg_setup
1274 +}
1275 +
1276 +src_prepare() {
1277 +
1278 + # Musl fix
1279 + eapply "${FILESDIR}/2.56.2-quark_init_on_demand.patch"
1280 + eapply "${FILESDIR}/2.56.2-gobject_init_on_demand.patch"
1281 +
1282 + # Prevent build failure in stage3 where pkgconfig is not available, bug #481056
1283 + mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
1284 +
1285 + if use test; then
1286 + # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
1287 + if ! has_version dev-util/desktop-file-utils ; then
1288 + ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
1289 + ewarn "think on installing it to get these tests run."
1290 + sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
1291 + sed -i -e "/g_test_add_func/d" gio/tests/desktop-app-info.c || die
1292 + fi
1293 +
1294 + # gdesktopappinfo requires existing terminal (gnome-terminal or any
1295 + # other), falling back to xterm if one doesn't exist
1296 + #if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
1297 + # ewarn "Some tests will be skipped due to missing terminal program"
1298 + # These tests seem to sometimes fail even with a terminal; skip for now and reevulate with meson
1299 + # Also try https://gitlab.gnome.org/GNOME/glib/issues/1601 once ready for backport (or in a bump) and file new issue if still fails
1300 + sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
1301 + # desktop-app-info/launch* might fail similarly
1302 + sed -i -e "/desktop-app-info\/launch-as-manager/d" gio/tests/desktop-app-info.c || die
1303 + #fi
1304 +
1305 + # https://bugzilla.gnome.org/show_bug.cgi?id=722604
1306 + sed -i -e "/timer\/stop/d" glib/tests/timer.c || die
1307 + sed -i -e "/timer\/basic/d" glib/tests/timer.c || die
1308 +
1309 + ewarn "Tests for search-utils have been skipped"
1310 + sed -i -e "/search-utils/d" glib/tests/Makefile.am || die
1311 + else
1312 + # Don't build tests, also prevents extra deps, bug #512022
1313 + sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die
1314 + fi
1315 +
1316 + # gdbus-codegen is a separate package
1317 + eapply "${FILESDIR}"/${PN}-2.58.2-external-gdbus-codegen.patch
1318 +
1319 + # https://gitlab.gnome.org/GNOME/glib/issues/1626
1320 + eapply "${FILESDIR}"/${P}-gvariant-test-fix.patch
1321 +
1322 + # Tarball doesn't come with gtk-doc.make and we can't unconditionally depend on dev-util/gtk-doc due
1323 + # to circular deps during bootstramp. If actually not building gtk-doc, an almost empty file will do
1324 + # fine as well - this is also what upstream autogen.sh does if gtkdocize is not found. If gtk-doc is
1325 + # installed, eautoreconf will call gtkdocize, which overwrites the empty gtk-doc.make with a full copy.
1326 + cat > gtk-doc.make << EOF
1327 +EXTRA_DIST =
1328 +CLEANFILES =
1329 +EOF
1330 +
1331 + gnome2_src_prepare
1332 + epunt_cxx
1333 +}
1334 +
1335 +multilib_src_configure() {
1336 + # Avoid circular depend with dev-util/pkgconfig and
1337 + # native builds (cross-compiles won't need pkg-config
1338 + # in the target ROOT to work here)
1339 + if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
1340 + if has_version sys-apps/dbus; then
1341 + export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
1342 + export DBUS1_LIBS="-ldbus-1"
1343 + fi
1344 + export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
1345 + export LIBFFI_LIBS="-lffi"
1346 + export PCRE_CFLAGS=" " # test -n "$PCRE_CFLAGS" needs to pass
1347 + export PCRE_LIBS="-lpcre"
1348 + fi
1349 +
1350 + # These configure tests don't work when cross-compiling.
1351 + if tc-is-cross-compiler ; then
1352 + # https://bugzilla.gnome.org/show_bug.cgi?id=756473
1353 + case ${CHOST} in
1354 + hppa*|metag*) export glib_cv_stack_grows=yes ;;
1355 + *) export glib_cv_stack_grows=no ;;
1356 + esac
1357 + # https://bugzilla.gnome.org/show_bug.cgi?id=756474
1358 + export glib_cv_uscore=no
1359 + # https://bugzilla.gnome.org/show_bug.cgi?id=756475
1360 + export ac_cv_func_posix_get{pwuid,grgid}_r=yes
1361 + fi
1362 +
1363 + local myconf
1364 +
1365 + case "${CHOST}" in
1366 + *-mingw*) myconf="${myconf} --with-threads=win32" ;;
1367 + *) myconf="${myconf} --with-threads=posix" ;;
1368 + esac
1369 +
1370 + # libelf used only by the gresource bin
1371 + ECONF_SOURCE="${S}" gnome2_src_configure ${myconf} \
1372 + $(usex debug --enable-debug=yes ' ') \
1373 + $(use_enable xattr) \
1374 + $(use_enable fam) \
1375 + $(multilib_native_use_enable gtk-doc) \
1376 + $(use_enable kernel_linux libmount) \
1377 + $(use_enable selinux) \
1378 + $(use_enable static-libs static) \
1379 + $(use_enable systemtap dtrace) \
1380 + $(use_enable systemtap systemtap) \
1381 + $(multilib_native_use_enable utils libelf) \
1382 + --with-python=${EPYTHON} \
1383 + --disable-compile-warnings \
1384 + --enable-man \
1385 + --with-pcre=system \
1386 + --with-xml-catalog="${EPREFIX}/etc/xml/catalog"
1387 +
1388 + if multilib_is_native_abi; then
1389 + local d
1390 + for d in glib gio gobject; do
1391 + ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
1392 + done
1393 + fi
1394 +}
1395 +
1396 +multilib_src_test() {
1397 + export XDG_CONFIG_DIRS=/etc/xdg
1398 + export XDG_DATA_DIRS=/usr/local/share:/usr/share
1399 + export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
1400 + export LC_TIME=C # bug #411967
1401 + unset GSETTINGS_BACKEND # bug #596380
1402 + python_setup
1403 +
1404 + # Related test is a bit nitpicking
1405 + mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
1406 + chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
1407 +
1408 + # Hardened: gdb needs this, bug #338891
1409 + if host-is-pax ; then
1410 + pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
1411 + || die "Hardened adjustment failed"
1412 + fi
1413 +
1414 + # Need X for dbus-launch session X11 initialization
1415 + virtx emake check
1416 +}
1417 +
1418 +multilib_src_install() {
1419 + emake DESTDIR="${D}" completiondir="$(get_bashcompdir)" install
1420 + keepdir /usr/$(get_libdir)/gio/modules
1421 +}
1422 +
1423 +multilib_src_install_all() {
1424 + einstalldocs
1425 +
1426 + # These are installed by dev-util/glib-utils
1427 + # TODO: With patching we might be able to get rid of the python-any deps and removals, and test depend on glib-utils instead; revisit with meson
1428 + rm "${ED}usr/bin/glib-genmarshal" || die
1429 + rm "${ED}usr/share/man/man1/glib-genmarshal.1" || die
1430 + rm "${ED}usr/bin/glib-mkenums" || die
1431 + rm "${ED}usr/share/man/man1/glib-mkenums.1" || die
1432 + rm "${ED}usr/bin/gtester-report" || die
1433 + rm "${ED}usr/share/man/man1/gtester-report.1" || die
1434 +
1435 + # Do not install charset.alias even if generated, leave it to libiconv
1436 + rm -f "${ED}/usr/$(get_libdir)/charset.alias"
1437 +
1438 + # Don't install gdb python macros, bug 291328
1439 + rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
1440 +
1441 + # Completely useless with or without USE static-libs, people need to use pkg-config
1442 + find "${ED}" -name '*.la' -delete || die
1443 +}
1444 +
1445 +pkg_preinst() {
1446 + gnome2_pkg_preinst
1447 +
1448 + # Make gschemas.compiled belong to glib alone
1449 + local cache="usr/share/glib-2.0/schemas/gschemas.compiled"
1450 +
1451 + if [[ -e ${EROOT}${cache} ]]; then
1452 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
1453 + else
1454 + touch "${ED}"/${cache} || die
1455 + fi
1456 +
1457 + multilib_pkg_preinst() {
1458 + # Make giomodule.cache belong to glib alone
1459 + local cache="usr/$(get_libdir)/gio/modules/giomodule.cache"
1460 +
1461 + if [[ -e ${EROOT}${cache} ]]; then
1462 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
1463 + else
1464 + touch "${ED}"/${cache} || die
1465 + fi
1466 + }
1467 +
1468 + # Don't run the cache ownership when cross-compiling, as it would end up with an empty cache
1469 + # file due to inability to create it and GIO might not look at any of the modules there
1470 + if ! tc-is-cross-compiler ; then
1471 + multilib_foreach_abi multilib_pkg_preinst
1472 + fi
1473 +}
1474 +
1475 +pkg_postinst() {
1476 + # force (re)generation of gschemas.compiled
1477 + GNOME2_ECLASS_GLIB_SCHEMAS="force"
1478 +
1479 + gnome2_pkg_postinst
1480 +
1481 + multilib_pkg_postinst() {
1482 + gnome2_giomodule_cache_update \
1483 + || die "Update GIO modules cache failed (for ${ABI})"
1484 + }
1485 + if ! tc-is-cross-compiler ; then
1486 + multilib_foreach_abi multilib_pkg_postinst
1487 + else
1488 + ewarn "Updating of GIO modules cache skipped due to cross-compilation."
1489 + ewarn "You might want to run gio-querymodules manually on the target for"
1490 + ewarn "your final image for performance reasons and re-run it when packages"
1491 + ewarn "installing GIO modules get upgraded or added to the image."
1492 + fi
1493 +}
1494 +
1495 +pkg_postrm() {
1496 + gnome2_pkg_postrm
1497 +
1498 + if [[ -z ${REPLACED_BY_VERSION} ]]; then
1499 + multilib_pkg_postrm() {
1500 + rm -f "${EROOT}"usr/$(get_libdir)/gio/modules/giomodule.cache
1501 + }
1502 + multilib_foreach_abi multilib_pkg_postrm
1503 + rm -f "${EROOT}"usr/share/glib-2.0/schemas/gschemas.compiled
1504 + fi
1505 +}
1506
1507 diff --git a/dev-libs/glib/metadata.xml b/dev-libs/glib/metadata.xml
1508 new file mode 100644
1509 index 0000000..b88cceb
1510 --- /dev/null
1511 +++ b/dev-libs/glib/metadata.xml
1512 @@ -0,0 +1,31 @@
1513 +<?xml version="1.0" encoding="UTF-8"?>
1514 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1515 +<pkgmetadata>
1516 + <maintainer type="project">
1517 + <email>gnome@g.o</email>
1518 + <name>Gentoo GNOME Desktop</name>
1519 + </maintainer>
1520 + <use>
1521 + <flag name="dbus">
1522 + Enable dependencies required by glib libraries
1523 + using dbus service to manage settings saving
1524 + </flag>
1525 + <flag name="mime">
1526 + Pull in shared MIME database that many glib-based
1527 + applications require at runtime to detect or open files. Warning:
1528 + do not disable this flag unless installing on a headless server.
1529 + </flag>
1530 + <flag name="systemtap">
1531 + Build support for profiling and tracing using
1532 + <pkg>dev-util/systemtap</pkg>
1533 + </flag>
1534 + <flag name="utils">
1535 + Install gtester-report utility to generate test
1536 + report files for your software; build gresource utility with
1537 + ELF support.
1538 + </flag>
1539 + </use>
1540 + <upstream>
1541 + <remote-id type="cpe">cpe:/a:gnome:glib</remote-id>
1542 + </upstream>
1543 +</pkgmetadata>