gtk+-native: fix relocation
authorChris Larson <chris_larson@mentor.com>
Mon, 4 Oct 2010 16:46:34 +0000 (09:46 -0700)
committerChris Larson <chris_larson@mentor.com>
Tue, 5 Oct 2010 01:33:22 +0000 (18:33 -0700)
In a sysroot process hook, to deal with relocation:

  - Re-generate the gdk-pixbuf.loaders file to contain the current sysroot path
    to the pixbuf loaders directory.
  - Create wrappers for gdk-pixbuf-csource and gdk-pixbuf-query-loaders
    utilities, passing along the appropriate environment variables to ensure
    they too point at the current sysroot path.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
recipes/gtk+/gtk+.inc

index bb74d78..76e1a4f 100644 (file)
@@ -16,7 +16,7 @@ SRC_URI = "http://download.gnome.org/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.bz2;
        file://xsettings.patch \
        "
 
-INC_PR = "r8"
+INC_PR = "r10"
 
 inherit autotools pkgconfig
 
@@ -66,21 +66,26 @@ do_install_append () {
        rm -f ${D}${libdir}/gtk-2.0/*/*.la ${D}${libdir}/gtk-2.0/${LIBV}/*/*.la
 }
 
-do_install_virtclass-native () {
-        autotools_do_install
-
-       mkdir -p ${D}${libdir}/gtk-2.0/include
-       install -m 0644 gdk/gdkconfig.h ${D}${libdir}/gtk-2.0/include/gdkconfig.h
-       # Copy over all headers, since the maemo stuff needs access to the private api. *sigh*
-       cp gtk/*.h ${D}${includedir}/gtk-2.0/gtk/
-
-       install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DATADIR}/aclocal/
-
-       install -d ${D}${sysconfdir}/gtk-2.0
-       rm -f ${D}${libdir}/gtk-2.0/*/*.la ${D}${libdir}/gtk-2.0/${LIBV}/*/*.la
+do_install_append_virtclass-native () {
+       ${D}${bindir}/gdk-pixbuf-query-loaders \
+               ${D}${libdir}/gtk-2.0/${LIBV}/loaders/*.so | \
+               sed -e's,${D},,' > \
+                       ${D}${sysconfdir}/gtk-2.0/gdk-pixbuf.loaders
+}
 
-       mkdir -p "${D}${sysconfdir}/gtk-2.0"
-       ${B}/gdk-pixbuf/gdk-pixbuf-query-loaders ${B}/gdk-pixbuf/.libs/*.so | sed 's:${B}/gdk-pixbuf/.libs:${STAGING_LIBDIR}/gtk-2.0/${LIBV}/loaders:' > "${D}${sysconfdir}/gtk-2.0/gdk-pixbuf.loaders"
+SYSROOT_PREPROCESS_FUNCS_append_virtclass-native = " gdk_pixbuf_fixup"
+
+_SYSROOT_DEST = "${SYSROOT_DESTDIR}${STAGING_DIR_HOST}"
+gdk_pixbuf_fixup () {
+       create_wrapper ${_SYSROOT_DEST}${bindir}/gdk-pixbuf-query-loaders \
+               LD_LIBRARY_PATH=${STAGING_LIBDIR} \
+               GDK_PIXBUF_MODULEDIR=${libdir}/gtk-2.0/${LIBV}/loaders
+       ${_SYSROOT_DEST}${bindir}/gdk-pixbuf-query-loaders \
+               ${_SYSROOT_DEST}${libdir}/gtk-2.0/${LIBV}/loaders/*.so | \
+               sed -e's,${_SYSROOT_DEST},,' > \
+                       ${_SYSROOT_DEST}${sysconfdir}/gtk-2.0/gdk-pixbuf.loaders
+       create_wrapper ${_SYSROOT_DEST}${bindir}/gdk-pixbuf-csource \
+               GDK_PIXBUF_MODULE_FILE=${sysconfdir}/gtk-2.0/gdk-pixbuf.loaders
 }
 
 postinst_prologue() {