Skip to contentSkip to conversation

Extend target version for libsdl and enable openGL for it

PATCH Applied Jiajun Xu 3 participants 6 messages Aug 15, 2011 – Aug 16, 2011

lore
Share & tools
lore

Jiajun Xu

author
#0 lore raw

cover Extend target version for libsdl and enable openGL for it

Some targets need to run 3D games, which requires libsdl. Enable libsdl for target and add a flag to check in build time if openGL needed to be built.

The following changes since commit d126e22f6b3f27196144f87e22b36ebccd6dea65:

rt-tests: use an explicit commit ID (2011-08-12 17:51:18 +0100)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jxu49/oe-contrib
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/oe-contrib

Jiajun Xu (2):
libsdl: add target version
libsdl: enable opengl for libsdl

 ...libsdl-nativesdk_1.2.11.bb => libsdl_1.2.11.bb} |   23 ++++++++++++++-----
 1 files changed, 17 insertions(+), 6 deletions(-)
 rename meta/recipes-graphics/libsdl/{libsdl-nativesdk_1.2.11.bb => libsdl_1.2.11.bb} (64%)
author
#1 lore raw

PATCH 1/2 libsdl: add target version

Rename libsdl-nativesdk to libsdl to enable target version. libsdl is needed in some graphics testing.

---
 ...libsdl-nativesdk_1.2.11.bb => libsdl_1.2.11.bb} |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)
 rename meta/recipes-graphics/libsdl/{libsdl-nativesdk_1.2.11.bb => libsdl_1.2.11.bb} (73%)
meta/recipes-graphics/libsdl/libsdl_1.2.11.bb renamed from meta/recipes-graphics/libsdl/libsdl-nativesdk_1.2.11.bb +15 -5
similarity index 73%
rename from meta/recipes-graphics/libsdl/libsdl-nativesdk_1.2.11.bb
rename to meta/recipes-graphics/libsdl/libsdl_1.2.11.bb
index e64a62e..7c1c507 100644
@@ -1,17 +1,25 @@
-DESCRIPTION = "Simple DirectMedia Layer - native Edition"
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
 HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
 SECTION = "libs"
-LICENSE = "LGPLv2.1"
-DEPENDS = "libx11-nativesdk libxext-nativesdk libxrandr-nativesdk libxrender-nativesdk"
-RDEPENDS_${PN} = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
-PR = "r5"
 
+LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
 
+DEPENDS = "virtual/libx11 libxext libxrandr libxrender"
+DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
+
+PR = "r6"
+
 SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
 	   file://acinclude.m4 \
 	   file://configure_tweak.patch;patch=1 \
 	   file://kernel-asm-page.patch;patch=1 "
+
 S = "${WORKDIR}/SDL-${PV}"
 
 SRC_URI[md5sum] = "418b42956b7cd103bfab1b9077ccc149"
@@ -34,3 +42,5 @@ PARALLEL_MAKE = ""
 do_configure_prepend() {
 	cp ${WORKDIR}/acinclude.m4 ${S}/acinclude.m4
 }
+
+BBCLASSEXTEND = "nativesdk"
Signature · 1 line
1.7.1
author
#2 lore raw

PATCH 2/2 libsdl: enable opengl for libsdl

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.

---
 meta/recipes-graphics/libsdl/libsdl_1.2.11.bb |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
meta/recipes-graphics/libsdl/libsdl_1.2.11.bb +4 -3
index 7c1c507..f08077d 100644
@@ -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"
 
Signature · 1 line
1.7.1
#3 lore raw

Re: [PATCH 2/2] libsdl: enable opengl for libsdl

Op 15 aug. 2011, om 15:05 heeft Jiajun Xu het volgende geschreven:

Quoted 3 lines

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.

Quoted 42 lines

---
meta/recipes-graphics/libsdl/libsdl_1.2.11.bb | 7 ++++---

1 files changed, 4 insertions(+), 3 deletions(-)
meta/recipes-graphics/libsdl/libsdl_1.2.11.bb +0 -0
index 7c1c507..f08077d 100644
@@ -10,10 +10,10 @@ SECTION = "libs"

LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"

meta/recipes-graphics/libsdl/libsdl_1.2.11.bb +1 -1
-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"

meta/recipes-graphics/libsdl/libsdl_1.2.11.bb +1 -1
-PR = "r6"
+PR = "r7"
SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
	   file://acinclude.m4 \
meta/recipes-graphics/libsdl/libsdl_1.2.11.bb +2 -1
@@ -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"
 
Signature · 7 lines
1.7.1


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
#4 lore raw

Re: [PATCH 2/2] libsdl: enable opengl for libsdl

Quoted 7 lines · Koen Kooi

Op 15 aug. 2011, om 15:05 heeft Jiajun Xu het volgende geschreven:

Quoted 3 lines

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

#5 lore raw
In reply to Jiajun Xu
Quoted 8 lines · Jiajun Xu

Some targets need to run 3D games, which requires libsdl. Enable libsdl for target and add a flag to check in build time if openGL needed to be built.

The following changes since commit d126e22f6b3f27196144f87e22b36ebccd6dea65:

rt-tests: use an explicit commit ID (2011-08-12 17:51:18 +0100)

Quoted 7 lines

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jxu49/oe-contrib
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/oe-contrib

Jiajun Xu (2):
libsdl: add target version
libsdl: enable opengl for libsdl

Merged to master, thanks Jiajun!

Cheers,

Richard