[oe-commits] Ross Burton : gtk+: version installed gtk-update-icon-cache and use alternatives

git at git.openembedded.org git at git.openembedded.org
Thu Jan 10 23:52:50 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: a9e71b41463c6c8e2be50d40403a0017d3cdf146
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a9e71b41463c6c8e2be50d40403a0017d3cdf146

Author: Ross Burton <ross.burton at intel.com>
Date:   Wed Jan  9 16:48:06 2013 +0000

gtk+: version installed gtk-update-icon-cache and use alternatives

With GTK+ 3 being added soon we'll have potentially two providers of
gtk-update-icon-cache.  Append a version to the binary and use
update-alternatives to ensure that the unversioned name works.

For gtk+-native the alternatives won't take effect, so install a symlink
explicitly.  This will break if we have a gtk+3-native but we can fix that if
and when that happens.

Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-gnome/gtk+/gtk+.inc        |   15 +++++++++++++--
 meta/recipes-gnome/gtk+/gtk+_2.24.14.bb |    2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-gnome/gtk+/gtk+.inc b/meta/recipes-gnome/gtk+/gtk+.inc
index c6d235f..97d3650 100644
--- a/meta/recipes-gnome/gtk+/gtk+.inc
+++ b/meta/recipes-gnome/gtk+/gtk+.inc
@@ -23,11 +23,11 @@ PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
 PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"
 PACKAGECONFIG[gtk-directfb] = "--with-gdktarget=directfb,,directfb"
 
-inherit autotools gtk-doc pkgconfig
+inherit autotools gtk-doc pkgconfig update-alternatives
 
 PACKAGES += "libgail gtk-demo"
 
-FILES_${PN} = "${bindir}/gtk-update-icon-cache \
+FILES_${PN} = "${bindir}/gtk-update-icon-cache-2.0 \
 	${bindir}/gtk-query-immodules-2.0 \
 	${libdir}/lib*${SOLIBS} \
 	${datadir}/themes ${sysconfdir} \
@@ -66,6 +66,9 @@ GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
 RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
 RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
 
+ALTERNATIVE_${PN} = "gtk-update-icon-cache"
+ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-2.0"
+
 do_install () {
 	autotools_do_install
 
@@ -77,6 +80,14 @@ do_install () {
 	install -m 0644 gtk/gtkfilechooserprivate.h ${D}${includedir}/gtk-2.0/gtk/
 	install -m 0644 gtk/gtkfilechooserutils.h   ${D}${includedir}/gtk-2.0/gtk/
 	install -m 0644 gtk/gtkfilesystemmodel.h    ${D}${includedir}/gtk-2.0/gtk/
+
+	mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-2.0
+}
+
+do_install_append_class-native () {
+	# Ideally we'd use alternatives in the sysroot, but they don't work.
+	# As we know we don't have a native GTK+ 3 (yet), make a symlink instead.
+	ln -s gtk-update-icon-cache-2.0 ${D}${bindir}/gtk-update-icon-cache
 }
 
 SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess"
diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.14.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.14.bb
index 553196a..028b238 100644
--- a/meta/recipes-gnome/gtk+/gtk+_2.24.14.bb
+++ b/meta/recipes-gnome/gtk+/gtk+_2.24.14.bb
@@ -43,7 +43,7 @@ RRECOMMENDS_${PN}_class-native = ""
 DEPENDS_class-native = "glib-2.0-native atk-native pango-native cairo-native gdk-pixbuf-native"
 
 do_install_append_class-native () {
-	create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
+	create_wrapper ${D}/${bindir}/gtk-update-icon-cache-2.0 \
 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
 }
 





More information about the Openembedded-commits mailing list