summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/base.bbclass15
-rw-r--r--meta/classes/pixbufcache.bbclass28
2 files changed, 23 insertions, 20 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e0f1053164..bfc78dba3a 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -204,8 +204,10 @@ def buildcfg_neededvars(d):
204 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) 204 bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
205 205
206addhandler base_eventhandler 206addhandler base_eventhandler
207base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise" 207base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.runqueue.sceneQueueComplete"
208python base_eventhandler() { 208python base_eventhandler() {
209 import bb.runqueue
210
209 if isinstance(e, bb.event.ConfigParsed): 211 if isinstance(e, bb.event.ConfigParsed):
210 if not e.data.getVar("NATIVELSBSTRING", False): 212 if not e.data.getVar("NATIVELSBSTRING", False):
211 e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) 213 e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
@@ -241,6 +243,17 @@ python base_eventhandler() {
241 e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++") 243 e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++")
242 e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs") 244 e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs")
243 245
246 if isinstance(e, bb.runqueue.sceneQueueComplete):
247 completions = e.data.expand("${STAGING_DIR}/sstatecompletions")
248 if os.path.exists(completions):
249 cmds = set()
250 with open(completions, "r") as f:
251 cmds = set(f)
252 e.data.setVar("completion_function", "\n".join(cmds))
253 e.data.setVarFlag("completion_function", "func", "1")
254 bb.debug(1, "Executing SceneQueue Completion commands: %s" % "\n".join(cmds))
255 bb.build.exec_func("completion_function", e.data)
256 os.remove(completions)
244} 257}
245 258
246CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" 259CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
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','')}"