summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/gtk-immodules-cache.bbclass70
-rw-r--r--scripts/postinst-intercepts/update_gtk_immodules_cache18
2 files changed, 46 insertions, 42 deletions
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index 3d82dbe9e3..9bb0af8b26 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -10,53 +10,39 @@ GTKIMMODULES_PACKAGES ?= "${PN}"
10 10
11gtk_immodule_cache_postinst() { 11gtk_immodule_cache_postinst() {
12if [ "x$D" != "x" ]; then 12if [ "x$D" != "x" ]; then
13 if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then 13 $INTERCEPT_DIR/postinst_intercept update_gtk_immodules_cache ${PKG} \
14 IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so) 14 mlprefix=${MLPREFIX} \
15 ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \ 15 binprefix=${MLPREFIX} \
16 $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null && 16 libdir=${libdir} \
17 sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache 17 libexecdir=${libexecdir} \
18 fi 18 base_libdir=${base_libdir} \
19 if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then 19 bindir=${bindir}
20 IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so) 20else
21 ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \ 21 if [ ! -z `which gtk-query-immodules-2.0` ]; then
22 $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null && 22 gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
23 sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache 23 fi
24 fi 24 if [ ! -z `which gtk-query-immodules-3.0` ]; then
25 25 gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
26 [ $? -ne 0 ] && exit 1 26 fi
27 exit 0
28fi
29if [ ! -z `which gtk-query-immodules-2.0` ]; then
30 gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
31fi
32if [ ! -z `which gtk-query-immodules-3.0` ]; then
33 gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
34fi 27fi
35} 28}
36 29
37gtk_immodule_cache_postrm() { 30gtk_immodule_cache_postrm() {
38if [ "x$D" != "x" ]; then 31if [ "x$D" != "x" ]; then
39 if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then 32 $INTERCEPT_DIR/postinst_intercept update_gtk_immodules_cache ${PKG} \
40 IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so) 33 mlprefix=${MLPREFIX} \
41 ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \ 34 binprefix=${MLPREFIX} \
42 $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null && 35 libdir=${libdir} \
43 sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache 36 libexecdir=${libexecdir} \
44 fi 37 base_libdir=${base_libdir} \
45 if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then 38 bindir=${bindir}
46 IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so) 39else
47 ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \ 40 if [ ! -z `which gtk-query-immodules-2.0` ]; then
48 $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null && 41 gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
49 sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache 42 fi
50 fi 43 if [ ! -z `which gtk-query-immodules-3.0` ]; then
51 44 gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
52 [ $? -ne 0 ] && exit 1 45 fi
53 exit 0
54fi
55if [ ! -z `which gtk-query-immodules-2.0` ]; then
56 gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
57fi
58if [ ! -z `which gtk-query-immodules-3.0` ]; then
59 gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
60fi 46fi
61} 47}
62 48
diff --git a/scripts/postinst-intercepts/update_gtk_immodules_cache b/scripts/postinst-intercepts/update_gtk_immodules_cache
new file mode 100644
index 0000000000..e2b9ff7438
--- /dev/null
+++ b/scripts/postinst-intercepts/update_gtk_immodules_cache
@@ -0,0 +1,18 @@
1#!/bin/sh
2
3set -e
4
5if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
6 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
7 $D/${bindir}/gtk-query-immodules-2.0 \
8 > $D${libdir}/gtk-2.0/2.10.0/immodules.cache &&
9 sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
10 chown root:root $D${libdir}/gtk-2.0/2.10.0/immodules.cache
11fi
12if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
13 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
14 $D/${bindir}/gtk-query-immodules-3.0 \
15 > $D${libdir}/gtk-3.0/3.0.0/immodules.cache &&
16 sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
17 chown root:root $D${libdir}/gtk-3.0/3.0.0/immodules.cache
18fi