summaryrefslogtreecommitdiffstats
path: root/meta/classes/pixbufcache.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-28 17:51:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-31 10:32:45 +0100
commite384d9ba0c4a3335575a766a82ed79201d794b11 (patch)
tree8aadb36e089d163a98ce10ae2f6684ea34f8af68 /meta/classes/pixbufcache.bbclass
parent64acfb32491e9b4666b55cac625eb13dafed2144 (diff)
downloadpoky-e384d9ba0c4a3335575a766a82ed79201d794b11.tar.gz
pixbufcache: Use sceneQueueComplete event to simplify usage
Ensuring the native pixbuf cache is correct after new loaders have been installed is tricky. This needs to be done without races and work regardless of whether the build is from sstate or freshly built for one or more modules. This adds a hook into base.bbclass which is then triggered by the code from pixbufcache. This patch is an improved version which means base.bbclass has no pixbuf knowledge and the mechanism can be reused in other cases. (From OE-Core rev: b411085fefc8582d24c172db5f6610705eb44c2f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/pixbufcache.bbclass')
-rw-r--r--meta/classes/pixbufcache.bbclass28
1 files changed, 9 insertions, 19 deletions
diff --git a/meta/classes/pixbufcache.bbclass b/meta/classes/pixbufcache.bbclass
index 9e6ecc8a53..349967d74b 100644
--- a/meta/classes/pixbufcache.bbclass
+++ b/meta/classes/pixbufcache.bbclass
@@ -45,6 +45,10 @@ python populate_packages_append() {
45 d.setVar('pkg_postrm_%s' % pkg, postrm) 45 d.setVar('pkg_postrm_%s' % pkg, postrm)
46} 46}
47 47
48gdkpixbuf_complete() {
49 GDK_PIXBUF_FATAL_LOADER=1 ${STAGING_BINDIR_NATIVE}/gdk-pixbuf-query-loaders --update-cache || exit 1
50}
51
48# 52#
49# Add an sstate postinst hook to update the cache for native packages. 53# Add an sstate postinst hook to update the cache for native packages.
50# An error exit during populate_sysroot_setscene allows bitbake to 54# An error exit during populate_sysroot_setscene allows bitbake to
@@ -52,26 +56,12 @@ python populate_packages_append() {
52# 56#
53SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst" 57SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst"
54 58
59# See base.bbclass for the other half of this
55pixbufcache_sstate_postinst() { 60pixbufcache_sstate_postinst() {
56 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] 61 if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
57 then 62 ${gdkpixbuf_complete}
58 GDK_PIXBUF_FATAL_LOADER=1 gdk-pixbuf-query-loaders --update-cache || exit 1 63 elif [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
64 echo "${gdkpixbuf_complete}" >> ${STAGING_DIR}/sstatecompletions
59 fi 65 fi
60} 66}
61 67
62# Add all of the dependencies of gdk-pixbuf as dependencies of
63# do_populate_sysroot_setscene so that pixbufcache_sstate_postinst can work
64# (otherwise gdk-pixbuf-query-loaders may not exist or link). Only add
65# gdk-pixbuf-native if we're not building gdk-pixbuf itself.
66#
67# Packages that use this class should extend this variable with their runtime
68# dependencies.
69PIXBUFCACHE_SYSROOT_DEPS = ""
70PIXBUFCACHE_SYSROOT_DEPS_class-native = "\
71 ${@['gdk-pixbuf-native:do_populate_sysroot_setscene', '']['${BPN}' == 'gdk-pixbuf']} \
72 glib-2.0-native:do_populate_sysroot_setscene libffi-native:do_populate_sysroot_setscene \
73 libpng-native:do_populate_sysroot_setscene zlib-native:do_populate_sysroot_setscene \
74 harfbuzz-native:do_populate_sysroot_setscene \
75 "
76do_populate_sysroot_setscene[depends] += "${PIXBUFCACHE_SYSROOT_DEPS}"
77do_populate_sysroot[depends] += "${@d.getVar('PIXBUFCACHE_SYSROOT_DEPS', True).replace('_setscene','')}"