diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 22:31:25 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 19:43:26 +0300 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.xz |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass')
-rw-r--r-- | import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass new file mode 100644 index 000000000..c099cd38e --- /dev/null +++ b/import-layers/yocto-poky/meta/classes/gtk-immodules-cache.bbclass @@ -0,0 +1,87 @@ +# This class will update the inputmethod module cache for virtual keyboards +# +# Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules + +DEPENDS =+ "qemu-native" + +inherit qemu + +GTKIMMODULES_PACKAGES ?= "${PN}" + +gtk_immodule_cache_postinst() { +if [ "x$D" != "x" ]; then + if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then + IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so) + ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \ + $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null && + sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache + elif [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then + IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so) + ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \ + $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null && + sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache + fi + + [ $? -ne 0 ] && exit 1 + exit 0 +fi +if [ ! -z `which gtk-query-immodules-2.0` ]; then + gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache +fi +if [ ! -z `which gtk-query-immodules-3.0` ]; then + gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache +fi +} + +gtk_immodule_cache_postrm() { +if [ "x$D" != "x" ]; then + if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then + IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so) + ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \ + $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null && + sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache + elif [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then + IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so) + ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \ + $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null && + sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache + fi + + [ $? -ne 0 ] && exit 1 + exit 0 +fi +if [ ! -z `which gtk-query-immodules-2.0` ]; then + gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache +fi +if [ ! -z `which gtk-query-immodules-3.0` ]; then + gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache +fi +} + +python populate_packages_append () { + gtkimmodules_pkgs = d.getVar('GTKIMMODULES_PACKAGES', True).split() + + for pkg in gtkimmodules_pkgs: + bb.note("adding gtk-immodule-cache postinst and postrm scripts to %s" % pkg) + + postinst = d.getVar('pkg_postinst_%s' % pkg, True) + if not postinst: + postinst = '#!/bin/sh\n' + postinst += d.getVar('gtk_immodule_cache_postinst', True) + d.setVar('pkg_postinst_%s' % pkg, postinst) + + postrm = d.getVar('pkg_postrm_%s' % pkg, True) + if not postrm: + postrm = '#!/bin/sh\n' + postrm += d.getVar('gtk_immodule_cache_postrm', True) + d.setVar('pkg_postrm_%s' % pkg, postrm) +} + +python __anonymous() { + if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d): + gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES', False) + if not gtkimmodules_check: + bb_filename = d.getVar('FILE', False) + raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename) +} + |