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.

(From OE-Core rev: a9e71b41463c6c8e2be50d40403a0017d3cdf146)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton 2013-01-09 16:48:06 +00:00 committed by Richard Purdie
parent c8e7c30041
commit 2a311dd992
2 changed files with 14 additions and 3 deletions

View File

@ -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"

View File

@ -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
}