[oe-commits] Klaus Kurzmann : glib-2.0: add 2.26 with DEFAULT_PREFERENCE = "-1" and prefer it for SHR

git version control git at git.openembedded.org
Sat Dec 4 20:01:38 UTC 2010


Module: openembedded.git
Branch: master
Commit: 8ed56c77b914739450bf00394a68dc72cce8818d
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=8ed56c77b914739450bf00394a68dc72cce8818d

Author: Klaus Kurzmann <mok at fluxnetz.de>
Date:   Sat Dec  4 20:04:14 2010 +0100

glib-2.0: add 2.26 with DEFAULT_PREFERENCE = "-1" and prefer it for SHR

Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>

---

 conf/distro/include/preferred-shr-versions.inc     |    4 +-
 .../60_wait-longer-for-threads-to-die.patch        |   26 +++++++
 .../glib-2.0-2.26.1/configure-libtool.patch        |   30 ++++++++
 .../glib-2.0-2.26.1/g_once_init_enter.patch        |   11 +++
 .../gatomic-proper-pointer-get-cast.patch          |   12 +++
 recipes/glib-2.0/glib-2.0_2.26.1.bb                |   76 ++++++++++++++++++++
 6 files changed, 157 insertions(+), 2 deletions(-)

diff --git a/conf/distro/include/preferred-shr-versions.inc b/conf/distro/include/preferred-shr-versions.inc
index 75c31d1..9942a74 100644
--- a/conf/distro/include/preferred-shr-versions.inc
+++ b/conf/distro/include/preferred-shr-versions.inc
@@ -40,8 +40,8 @@ PREFERRED_VERSION_libtool-sdk   = "${LIBTOOL_VERSION}"
 PREFERRED_VERSION_udev          = "151"
 PREFERRED_VERSION_usbutils      = "0.86"
 PREFERRED_VERSION_wpa-supplicant = "0.6.9"
-PREFERRED_VERSION_glib-2.0      = "2.24.1"
-PREFERRED_VERSION_glib-2.0-native = "2.24.1"
+PREFERRED_VERSION_glib-2.0      = "2.26.1"
+PREFERRED_VERSION_glib-2.0-native = "2.26.1"
 PREFERRED_VERSION_openssl = "1.0.0b"
 PREFERRED_VERSION_openssl-native = "1.0.0b"
 UDEV_GE_141 = "1"
diff --git a/recipes/glib-2.0/glib-2.0-2.26.1/60_wait-longer-for-threads-to-die.patch b/recipes/glib-2.0/glib-2.0-2.26.1/60_wait-longer-for-threads-to-die.patch
new file mode 100644
index 0000000..02fe9ff
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.26.1/60_wait-longer-for-threads-to-die.patch
@@ -0,0 +1,26 @@
+--- glib/tests/threadpool-test.c.old	2008-02-12 06:11:21.000000000 +0100
++++ glib/tests/threadpool-test.c	2008-02-12 06:11:52.000000000 +0100
+@@ -5,8 +5,8 @@
+ 
+ #include <glib.h>
+ 
+-#define DEBUG_MSG(x)
+-/* #define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");  */
++/* #define DEBUG_MSG(x) */
++#define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");
+ 
+ #define WAIT                5    /* seconds */
+ #define MAX_THREADS         10
+@@ -124,10 +124,10 @@
+    DEBUG_MSG (("[unused] stopping unused threads"));
+    g_thread_pool_stop_unused_threads ();
+ 
+-   DEBUG_MSG (("[unused] waiting ONE second for threads to die"));
++   DEBUG_MSG (("[unused] waiting FIVE second for threads to die"));
+ 
+    /* Some time for threads to die. */
+-   g_usleep (G_USEC_PER_SEC);
++   g_usleep (5 * G_USEC_PER_SEC);
+ 
+    DEBUG_MSG (("[unused] stopped idle threads, %d remain, %d threads still exist",
+ 	       g_thread_pool_get_num_unused_threads (),
diff --git a/recipes/glib-2.0/glib-2.0-2.26.1/configure-libtool.patch b/recipes/glib-2.0/glib-2.0-2.26.1/configure-libtool.patch
new file mode 100644
index 0000000..8d211dd
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.26.1/configure-libtool.patch
@@ -0,0 +1,30 @@
+diff -uri glib-2.26.1.orig/configure.ac glib-2.26.1/configure.ac
+--- glib-2.26.1.orig/configure.ac	2010-11-14 06:59:52.000000000 +0100
++++ glib-2.26.1/configure.ac	2010-12-01 16:48:16.653342967 +0100
+@@ -1386,7 +1386,7 @@
+   G_MODULE_LDFLAGS=
+ else
+   export SED
+-  G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++  G_MODULE_LDFLAGS=`($host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1451,7 +1451,7 @@
+ 	LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ 	echo "void glib_plugin_test(void) { }" > plugin.c
+-	${SHELL} ./libtool --mode=compile ${CC} -shared \
++	${SHELL} $host_alias-libtool --mode=compile ${CC} -shared \
+ 		-export-dynamic -o plugin.o plugin.c 2>&1 >/dev/null
+ 	AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
+ 		glib_cv_rtldglobal_broken,[
+@@ -1525,7 +1525,7 @@
+ 
+ AC_MSG_CHECKING(for the suffix of module shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`$host_alias-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
diff --git a/recipes/glib-2.0/glib-2.0-2.26.1/g_once_init_enter.patch b/recipes/glib-2.0/glib-2.0-2.26.1/g_once_init_enter.patch
new file mode 100644
index 0000000..58e4108
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.26.1/g_once_init_enter.patch
@@ -0,0 +1,11 @@
+--- glib-2.22.1/glib/gthread.h.orig	2009-10-13 22:53:23.000000000 +0200
++++ glib-2.22.1/glib/gthread.h	2009-10-13 23:34:59.000000000 +0200
+@@ -341,7 +341,7 @@
+ G_INLINE_FUNC gboolean
+ g_once_init_enter (volatile gsize *value_location)
+ {
+-  if G_LIKELY ((gpointer) g_atomic_pointer_get (value_location) != NULL)
++  if G_LIKELY ((gpointer) g_atomic_pointer_get ((volatile gpointer *)value_location) != NULL)
+     return FALSE;
+   else
+     return g_once_init_enter_impl (value_location);
diff --git a/recipes/glib-2.0/glib-2.0-2.26.1/gatomic-proper-pointer-get-cast.patch b/recipes/glib-2.0/glib-2.0-2.26.1/gatomic-proper-pointer-get-cast.patch
new file mode 100644
index 0000000..5a8e37d
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0-2.26.1/gatomic-proper-pointer-get-cast.patch
@@ -0,0 +1,12 @@
+diff -uri glib-2.26.1.orig/glib/gatomic.h glib-2.26.1/glib/gatomic.h
+--- glib-2.26.1.orig/glib/gatomic.h	2010-07-11 05:56:45.000000000 +0200
++++ glib-2.26.1/glib/gatomic.h	2010-12-01 16:20:33.140009635 +0100
+@@ -70,7 +70,7 @@
+   (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval)))
+ # define g_atomic_pointer_get(atomic) \
+  ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \
+-  (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic)))
++  (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void G_GNUC_MAY_ALIAS *) (atomic)))
+ # define g_atomic_pointer_set(atomic, newval) \
+  ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \
+   (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval)))
diff --git a/recipes/glib-2.0/glib-2.0_2.26.1.bb b/recipes/glib-2.0/glib-2.0_2.26.1.bb
new file mode 100644
index 0000000..d95f894
--- /dev/null
+++ b/recipes/glib-2.0/glib-2.0_2.26.1.bb
@@ -0,0 +1,76 @@
+DESCRIPTION = "GLib is a general-purpose utility library, \
+which provides many useful data types, macros, \
+type conversions, string utilities, file utilities, a main \
+loop abstraction, and so on. It works on many \
+UNIX-like platforms, Windows, OS/2 and BeOS."
+LICENSE = "LGPLv2+"
+SECTION = "libs"
+PRIORITY = "optional"
+DEPENDS = "glib-2.0-native gtk-doc zlib"
+DEPENDS_virtclass-native = "gettext-native gtk-doc-native \
+                            pkgconfig-native"
+
+PR = "r0"
+
+SRC_URI = "\
+  http://ftp.gnome.org/pub/GNOME/sources/glib/2.26/glib-${PV}.tar.bz2;name=archive \
+  file://glibconfig-sysdefs.h \
+  file://configure-libtool.patch \
+  file://g_once_init_enter.patch \
+  file://gatomic-proper-pointer-get-cast.patch \
+  file://60_wait-longer-for-threads-to-die.patch \
+  file://glib-mkenums-interpreter.patch \
+"
+
+SRC_URI[archive.md5sum] = "17535accceef55bcb17a74d73f9c2aef"
+SRC_URI[archive.sha256sum] = "7a74ff12b6b9dee1f2d0e520b56b68b621920c4f4250bdf23468e515625c28d5"
+
+inherit autotools gettext
+
+S = "${WORKDIR}/glib-${PV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+EXTRA_OECONF = "--disable-debug "
+
+# Add and entry for your favourite arch if your (g)libc has a sane printf
+EXTRA_OECONF_append_glibc_arm = "  --enable-included-printf=no "
+
+do_configure_prepend () {
+	install -m 0644 ${WORKDIR}/glibconfig-sysdefs.h .
+}
+
+do_install_append() {
+	sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g ${D}${bindir}/glib-mkenums || true
+}
+
+EXTRA_OECONF_virtclass-native = ""
+
+do_configure_prepend_virtclass-native() {
+    if [ -e ${S}/${TARGET_SYS}-libtool ] ; then
+                echo "${TARGET_SYS}-libtool already present"
+    else
+        cp ${STAGING_BINDIR}/${TARGET_SYS}-libtool ${S}
+    fi
+
+}
+
+BBCLASSEXTEND = "native"
+
+PACKAGES =+ "gobject-2.0 gmodule-2.0 gthread-2.0 gio-2.0 glib-2.0-utils "
+LEAD_SONAME = "libglib-2.0.*"
+FILES_glib-2.0-utils = "${bindir}/*"
+FILES_${PN} = "${libdir}/lib*so.* ${libdir}/gio/modules/*.so"
+FILES_${PN}-dev += "${libdir}/glib-2.0 ${datadir}/glib-2.0 ${libdir}/gio/modules/*.la"
+FILES_${PN}-dbg += "${libdir}/gio/modules/.debug"
+FILES_gmodule-2.0 = "${libdir}/libgmodule-2.0.so.*"
+FILES_gobject-2.0 = "${libdir}/libgobject-2.0.so.*"
+FILES_gio-2.0 = "${libdir}/libgio-2.0.so.*"
+FILES_gthread-2.0 = "${libdir}/libgthread-2.0.so.*"
+
+# Let various glib components end up in glib package
+# for compatibility (with binary packages from Maemo).
+FILES_gthread-2.0_chinook-compat = ""
+FILES_gmodule-2.0_chinook-compat = ""
+FILES_gobject-2.0_chinook-compat = ""
+FILES_gio-2.0_chinook-compat = ""





More information about the Openembedded-commits mailing list