summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorroy <roy@pkgsrc.org>2010-02-19 11:44:56 +0000
committerroy <roy@pkgsrc.org>2010-02-19 11:44:56 +0000
commitdc2588f2bdb0d2f0521ba5ddf274ed15336ebcc7 (patch)
tree480ec635b1368a8faeb7758ed66752d54127d871 /devel
parent2eafede819cf8d07c1e4da579a8e7b6eb25789b4 (diff)
downloadpkgsrc-dc2588f2bdb0d2f0521ba5ddf274ed15336ebcc7.tar.gz
Add patches to gmodule so that RTLD_DEFAULT is used on platforms that
define it and g_module_unload symbols are only resolved in the module and not any dependencies.
Diffstat (limited to 'devel')
-rw-r--r--devel/glib2/Makefile3
-rw-r--r--devel/glib2/distinfo4
-rw-r--r--devel/glib2/patches/patch-am53
-rw-r--r--devel/glib2/patches/patch-an24
4 files changed, 82 insertions, 2 deletions
diff --git a/devel/glib2/Makefile b/devel/glib2/Makefile
index c70923819d4..ef78ba3b8b5 100644
--- a/devel/glib2/Makefile
+++ b/devel/glib2/Makefile
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.169 2010/01/18 18:15:46 drochner Exp $
+# $NetBSD: Makefile,v 1.170 2010/02/19 11:44:56 roy Exp $
# When updating glib2, please apply patch-ak to configure.in
# Then run a matching version of autoconf to regen patch-aa.
DISTNAME= glib-2.22.4
PKGNAME= ${DISTNAME:S/glib/glib2/}
+PKGREVISION= 1
CATEGORIES= devel
MASTER_SITES= ftp://ftp.gtk.org/pub/glib/2.22/ \
${MASTER_SITE_GNOME:=sources/glib/2.22/}
diff --git a/devel/glib2/distinfo b/devel/glib2/distinfo
index 9cfab90822a..a1c3a016678 100644
--- a/devel/glib2/distinfo
+++ b/devel/glib2/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.127 2010/01/18 18:15:46 drochner Exp $
+$NetBSD: distinfo,v 1.128 2010/02/19 11:44:56 roy Exp $
SHA1 (glib-2.22.4.tar.bz2) = be135a25c233a199f043161777d31ac30e42f435
RMD160 (glib-2.22.4.tar.bz2) = 66dc6ec0f1b1d422f50f6d55700bee8d526318cc
@@ -15,6 +15,8 @@ SHA1 (patch-ai) = ff1963c05cf82059de692cd5bf08872544297b7f
SHA1 (patch-aj) = 9e5a7ccf081e3ebdf7888a67b027b696f632177c
SHA1 (patch-ak) = 04e3d1eb9648186776dee81d2db9507c0df0c62e
SHA1 (patch-al) = 6c8b7c569fb5fae5eff719ebd2925d79f5df3b2e
+SHA1 (patch-am) = 68a86d0d20a41780a534d51065ff77cd7de33ab9
+SHA1 (patch-an) = d5b3d97b5746b5fb932db45b194cf89224e63801
SHA1 (patch-ba) = b235c2037bce84e0cdd9c87abaac274550ec0c95
SHA1 (patch-cb) = 0f084c33fb67fbb8e12448034450699da26289ff
SHA1 (patch-cc) = dd73079b727bca9013465204dc3b53b76a280e54
diff --git a/devel/glib2/patches/patch-am b/devel/glib2/patches/patch-am
new file mode 100644
index 00000000000..a500f3f15a2
--- /dev/null
+++ b/devel/glib2/patches/patch-am
@@ -0,0 +1,53 @@
+$NetBSD: patch-am,v 1.3 2010/02/19 11:44:56 roy Exp $
+
+We should only check the module itself for g_module_check_init and
+g_module_unload functions.
+
+This also makes loading a module a lot faster if these functions do
+not exist and the module as a lot of dependencies.
+
+--- gmodule/gmodule.c 2010-02-18 19:59:34.000000000 +0000
++++ gmodule/gmodule.c 2010-02-18 20:18:06.000000000 +0000
+@@ -474,25 +474,33 @@
+ module->cp_file_name = g_locale_from_utf8 (file_name, -1,
+ NULL, NULL, NULL);
+ #endif
+- module->handle = handle;
++ /* we set RTLD_NEXT so we only load private functions from
++ * the module and not any dependencies */
++ module->handle = RTLD_NEXT;
+ module->ref_count = 1;
+ module->is_resident = FALSE;
+ module->unload = NULL;
+ module->next = modules;
+ modules = module;
++
++ /* load private functions */
++ g_module_symbol (module, "g_module_check_init", (gpointer) &check_init);
++ g_module_symbol (module, "g_module_unload", (gpointer) &module->unload);
++
++ /* now set the real handle */
++ module->handle = handle;
+
+ /* check initialization */
+- if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init) && check_init != NULL)
+- check_failed = check_init (module);
+-
+- /* we don't call unload() if the initialization check failed. */
+- if (!check_failed)
+- g_module_symbol (module, "g_module_unload", (gpointer) &module->unload);
+-
+- if (check_failed)
++ if (check_init != NULL)
++ check_failed = check_init(module);
++
++ if (check_failed != NULL)
+ {
+ gchar *error;
+
++ /* we don't call unload() if the initialization check failed. */
++ module->unload = NULL;
++
+ error = g_strconcat ("GModule (",
+ file_name ? file_name : "NULL",
+ ") initialization check failed: ",
diff --git a/devel/glib2/patches/patch-an b/devel/glib2/patches/patch-an
new file mode 100644
index 00000000000..fafeaf51f4e
--- /dev/null
+++ b/devel/glib2/patches/patch-an
@@ -0,0 +1,24 @@
+$NetBSD: patch-an,v 1.1 2010/02/19 11:44:56 roy Exp $
+
+Use RTLD_DEFAULT if the platform defines it.
+
+--- gmodule/gmodule-dl.c 2009-04-01 00:04:20.000000000 +0100
++++ gmodule/gmodule-dl.c 2010-02-19 07:13:26.000000000 +0000
+@@ -107,6 +107,9 @@
+ static gpointer
+ _g_module_self (void)
+ {
++#ifdef RTLD_DEFAULT
++ return RTLD_DEFAULT;
++#else
+ gpointer handle;
+
+ /* to query symbols from the program itself, special link options
+@@ -118,6 +121,7 @@
+ g_module_set_error (fetch_dlerror (TRUE));
+
+ return handle;
++#endif
+ }
+
+ static void