Patchwork [2/2] libsdl: enable opengl for libsdl

login
register
mail settings
Submitter Jiajun Xu
Date Aug. 15, 2011, 1:05 p.m.
Message ID <34d0c69915195c65e082c2575dc233716bf9ab57.1313413181.git.jiajun.xu@intel.com>
Download mbox | patch
Permalink /patch/9865/
State New, archived
Headers show

Comments

Jiajun Xu - Aug. 15, 2011, 1:05 p.m.
To enable opengl for libsdl, we need DEPENDS on virtual/libgl. Add a check for
"opengl" in DISTRO_FEATURES and when it's set, "--enable-video-opengl"
and "virtual/libgl" will be added into EXTRA_CONF and DEPENDS.

Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
Acked-by: Phil Blundell <philb@gnu.org>
---
 meta/recipes-graphics/libsdl/libsdl_1.2.11.bb |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Koen Kooi - Aug. 16, 2011, 7:52 a.m.
Op 15 aug. 2011, om 15:05 heeft Jiajun Xu het volgende geschreven:

> To enable opengl for libsdl, we need DEPENDS on virtual/libgl. Add a check for
> "opengl" in DISTRO_FEATURES and when it's set, "--enable-video-opengl"
> and "virtual/libgl" will be added into EXTRA_CONF and DEPENDS.

Is that really a distro feature? Opengl has always been a machine feature in OE, so with this the situation gets a lot worse.


> 
> Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
> Acked-by: Phil Blundell <philb@gnu.org>
> ---
> meta/recipes-graphics/libsdl/libsdl_1.2.11.bb |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
> index 7c1c507..f08077d 100644
> --- a/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
> +++ b/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
> @@ -10,10 +10,10 @@ SECTION = "libs"
> LICENSE = "LGPLv2.1"
> LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
> 
> -DEPENDS = "virtual/libx11 libxext libxrandr libxrender"
> +DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender"
> DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
> 
> -PR = "r6"
> +PR = "r7"
> 
> SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
> 	   file://acinclude.m4 \
> @@ -33,7 +33,8 @@ EXTRA_OECONF = "--disable-static --disable-debug --disable-cdrom --enable-thread
>                 --disable-mintaudio --disable-nasm --enable-video-x11 --disable-video-dga \
>                 --disable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
>                 --disable-video-xbios --disable-video-gem --disable-video-dummy \
> -                --disable-video-opengl --enable-input-events --enable-pthreads \
> +                --enable-input-events --enable-pthreads \
> +		${@base_contains('DISTRO_FEATURES', 'opengl', '--enable-video-opengl', '--disable-video-opengl', d)} \
> 		--disable-video-svga \
>                 --disable-video-picogui --disable-video-qtopia --enable-dlopen"
> 
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Richard Purdie - Aug. 16, 2011, 10:19 a.m.
On Tue, 2011-08-16 at 09:52 +0200, Koen Kooi wrote:
> Op 15 aug. 2011, om 15:05 heeft Jiajun Xu het volgende geschreven:
> 
> > To enable opengl for libsdl, we need DEPENDS on virtual/libgl. Add a check for
> > "opengl" in DISTRO_FEATURES and when it's set, "--enable-video-opengl"
> > and "virtual/libgl" will be added into EXTRA_CONF and DEPENDS.
> 
> Is that really a distro feature? Opengl has always been a machine feature in OE, so with this the situation gets a lot worse.

Not really. This is one of the flags that makes sense at both a machine
*and* distro level. The distro flag means "build GL components" or can
be used to globally disable GL. The machine flag means the hardware can
support accelerated GL. This isn't the only such flag and was
anticipated long ago and why we have COMBINED_FEATURES (or whatever its
called).

The tricky piece to fit into this is software rendering. There are some
cases where we might want to build and include mesa-xlib even though we
know it will be slow (e.g. qemu machines to allow fuller testing).
Should or shouldn't those machines list opengl? Should we always fall
back to software rendering or error? Those questions are harder to
answer.

Cheers,

Richard

Patch

diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
index 7c1c507..f08077d 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
@@ -10,10 +10,10 @@  SECTION = "libs"
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
 
-DEPENDS = "virtual/libx11 libxext libxrandr libxrender"
+DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender"
 DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
 
-PR = "r6"
+PR = "r7"
 
 SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
 	   file://acinclude.m4 \
@@ -33,7 +33,8 @@  EXTRA_OECONF = "--disable-static --disable-debug --disable-cdrom --enable-thread
                 --disable-mintaudio --disable-nasm --enable-video-x11 --disable-video-dga \
                 --disable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
                 --disable-video-xbios --disable-video-gem --disable-video-dummy \
-                --disable-video-opengl --enable-input-events --enable-pthreads \
+                --enable-input-events --enable-pthreads \
+		${@base_contains('DISTRO_FEATURES', 'opengl', '--enable-video-opengl', '--disable-video-opengl', d)} \
 		--disable-video-svga \
                 --disable-video-picogui --disable-video-qtopia --enable-dlopen"