All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kelly <martin@xevo.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [meta-oe][PATCH] libsdl: enable X11 for nativesdk
Date: Thu, 6 Apr 2017 12:54:45 -0700	[thread overview]
Message-ID: <1491508485-2813-1-git-send-email-martin@xevo.com> (raw)

From: Martin Kelly <mkelly@xevo.com>

Currently, the following situation fails:

- Build an SDK and image. Make the image support graphics but not X11.
- Extract SDK and copy image somewhere outside of the Yocto workspace. Do
  runqemu on the image.

This results in the error:
"Could not initialize SDL(No available video device) - exiting"

This error occurs because libSDL attempts to load libX11 for video devices. When
it fails, qemu also fails.

Note that the same runqemu command will work fine from within the Yocto
workspace environment because it will use the native libSDL -- which supports
X11 -- rather than the nativesdk libSDL. In addition, the command will work fine
as long as DISTRO_FEATURES includes x11, because then the nativesdk libSDL will
be compiled with X11 support.

Although the example above may seem a bit silly, this is actually a pretty bad
error because it breaks the ability to build an SDK and image on one machine and
run it on a different machine.

Fix the issue by building nativesdk-libsdl with X11 support -- even when
DISTRO_FEATURES does not include X11 -- as we already do for libsdl-native.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb      | 3 ++-
 meta/recipes-graphics/xorg-lib/libxcb_1.12.bb      | 1 +
 meta/recipes-graphics/xorg-lib/xorg-lib-common.inc | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
index c802a6f..89d84ab 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -43,8 +43,9 @@ EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
+# Without X11 support, qemu will fail because SDL cannot find video devices.
 PACKAGECONFIG_class-native = "x11"
-PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG_class-nativesdk = "x11"
 
 PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
diff --git a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
index a38bdea..6d7e675 100644
--- a/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
+++ b/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
@@ -31,6 +31,7 @@ inherit autotools pkgconfig distro_features_check
 # The libxau and others requires x11 in DISTRO_FEATURES
 REQUIRED_DISTRO_FEATURES = "x11"
 REQUIRED_DISTRO_FEATURES_class-native = ""
+REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
 
 export PYTHON = "python3"
 
diff --git a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
index 6f4e444..b397923 100644
--- a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
+++ b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
@@ -25,3 +25,4 @@ UNKNOWN_CONFIGURE_WHITELIST += "--enable-malloc0returnsnull --disable-malloc0ret
 
 REQUIRED_DISTRO_FEATURES ?= "x11"
 REQUIRED_DISTRO_FEATURES_class-native = ""
+REQUIRED_DISTRO_FEATURES_class-nativesdk = ""
-- 
2.1.4



                 reply	other threads:[~2017-04-06 19:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491508485-2813-1-git-send-email-martin@xevo.com \
    --to=martin@xevo.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.