[7/8] qemu: replace a gtk wrapper with directly setting environment from runqemu

Message ID 20220206215316.367469-7-alex@linutronix.de
State Accepted, archived
Commit 34f152de14f803fcfe5c92c515bf585838bba10a
Headers show
Series [1/8] mesa: fold mesa-gl variant into the main recipe using mcextend class | expand

Commit Message

Alexander Kanavin Feb. 6, 2022, 9:53 p.m. UTC
The wrapper is executed by host bash, and host bash refuses to run
when pseudo libc is preloaded via LD_PRELOAD (which is the case
when gl is enabled).

Only the fontconfig setting is carried over as local testing showed that
only that is necessary for the gui to look ok nowadays; adjust further
if necessary.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/recipes-devtools/qemu/qemu-native.inc |  4 ----
 meta/recipes-devtools/qemu/qemu.inc        | 11 -----------
 meta/recipes-devtools/qemu/qemu_6.2.0.bb   |  4 ----
 scripts/runqemu                            |  1 +
 4 files changed, 1 insertion(+), 19 deletions(-)

Patch

diff --git a/meta/recipes-devtools/qemu/qemu-native.inc b/meta/recipes-devtools/qemu/qemu-native.inc
index 5d3ba3486c..d9acc613f9 100644
--- a/meta/recipes-devtools/qemu/qemu-native.inc
+++ b/meta/recipes-devtools/qemu/qemu-native.inc
@@ -5,7 +5,3 @@  inherit native
 EXTRA_OEMAKE:append = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
 
 LDFLAGS:append = " -fuse-ld=bfd"
-
-do_install:append() {
-     ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
-}
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 843de3337a..325118cfb3 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -138,17 +138,6 @@  do_install:append() {
 }
 # END of qemu-mips workaround
 
-make_qemu_wrapper() {
-        gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0`
-
-        for tool in `ls ${D}${bindir}/qemu-system-*`; do
-                create_wrapper $tool \
-                        GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \
-                        FONTCONFIG_PATH=/etc/fonts \
-                        GTK_THEME=Adwaita
-        done
-}
-
 # Disable kvm/virgl/mesa on targets that do not support it
 PACKAGECONFIG:remove:darwin = "kvm virglrenderer glx gtk+"
 PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer glx gtk+"
diff --git a/meta/recipes-devtools/qemu/qemu_6.2.0.bb b/meta/recipes-devtools/qemu/qemu_6.2.0.bb
index c9a53e3b05..062ed32b01 100644
--- a/meta/recipes-devtools/qemu/qemu_6.2.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_6.2.0.bb
@@ -12,10 +12,6 @@  EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}"
 EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
 EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
 
-do_install:append:class-nativesdk() {
-     ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)}
-}
-
 PACKAGECONFIG ??= " \
     fdt sdl kvm pie \
     ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
diff --git a/scripts/runqemu b/scripts/runqemu
index d60cb2e152..5c108ec23a 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1377,6 +1377,7 @@  class BaseConfig(object):
                 if self.sdl == True:
                     self.qemu_opt += 'sdl,'
                 elif self.gtk == True:
+                    os.environ['FONTCONFIG_PATH'] = '/etc/fonts'
                     self.qemu_opt += 'gtk,'
 
                 if self.gl == True: