Skip to contentSkip to conversation

libsdl: expand PACKAGECONFIG and enable native builds

RFC PATCH In review Ross Burton 4 participants 9 messages Feb 29, 2016 – Mar 14, 2016

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 libsdl: expand PACKAGECONFIG and enable native builds

Use PACKAGECONFIG instead of using logic in DEPENDS and EXTRA_OECONF, adding new options for PulseAudio, tslib, DirectFB, OpenGL and X11. Pass --disable-x11-shared so that it links to the X libraries instead of using dlopen().

Disable tslib by default as the kernel event input subsystem is generally used.

SDL's OpenGL support requires X11 so check for both x11 and opengl, and merge the dependencies.

Finally enable native builds, with a minimal PACKAGECONFIG that will build from oe-core for native and nativesdk.

(From OE-Core rev: 3d6c31c3a4ff34376e17005a981bb55fc6f7a38f)

---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 35 ++++++++++++++-------------
 1 file changed, 18 insertions(+), 17 deletions(-)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +18 -17
index c0d5c6a..1cf3c39 100644
@@ -12,13 +12,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
 
 PROVIDES = "virtual/libsdl"
 
-DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libglu', '', d)} \
-           tslib"
-DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
-
 PR = "r3"
 
 SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
@@ -38,21 +31,29 @@ inherit autotools lib_package binconfig-disabled pkgconfig
 
 EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers \
                 --enable-file --disable-oss --disable-esd --disable-arts \
-                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+                --disable-diskaudio --disable-nas \
                 --disable-mintaudio --disable-nasm --disable-video-dga \
                 --disable-video-fbcon --disable-video-ps2gs --disable-video-ps3 \
                 --disable-xbios --disable-gem --disable-video-dummy \
-                --enable-input-events --enable-input-tslib --enable-pthreads \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', '--enable-video-directfb', '--disable-video-directfb', d)} \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '--enable-video-opengl', '--disable-video-opengl', d)} \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--enable-video-x11', '--disable-video-x11', d)} \
+                --enable-input-events --enable-pthreads \
                 --disable-video-svga \
                 --disable-video-picogui --disable-video-qtopia --enable-sdl-dlopen \
-                --disable-rpath \
-                --disable-pulseaudio"
+                --disable-rpath"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-native = "x11"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
-PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib] = "--enable-input-tslib, --disable-input-tslib, tslib"
+PACKAGECONFIG[directfb] = "--enable-video-directfb, --disable-video-directfb, directfb"
+PACKAGECONFIG[opengl] = "--enable-video-opengl, --disable-video-opengl, virtual/libgl libglu"
+PACKAGECONFIG[x11] = "--enable-video-x11 --disable-x11-shared, --disable-video-x11, virtual/libx11 libxext libxrandr libxrender"
 
 EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
 
@@ -65,4 +66,4 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.7.0
#1 lore raw

RFC PATCH 2/2 conf/local.conf.sample: comment out ASSUME_PROVIDED=libsdl-native

Ubuntu 15.10 and Debian testing can't build qemu-native against the host libsdl. Now that libsdl-native is buildable, comment out the ASSUME_PROVIDED which meant it wouldn't be used.

[ YOCTO #8553 ]

(From meta-yocto rev: 759accbfca46de058ce402938713189dab22a70c)

---
 meta-yocto/conf/local.conf.sample | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta-yocto/conf/local.conf.sample +4 -3
index bf6dd90..72c16b25d 100644
@@ -225,11 +225,12 @@ BB_DISKMON_DIRS = "\
 # Qemu configuration
 #
 # By default qemu will build with a builtin VNC server where graphical output can be
-# seen. The two lines below enable the SDL backend too. This assumes there is a
-# libsdl library available on your build system.
+# seen. The two lines below enable the SDL backend too. By default libsdl-native will
+# be built, if you want to use your host's libSDL instead of the minimal libsdl built
+# by libsdl-native then uncomment the ASSUME_PROVIDED line below.
 PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
-ASSUME_PROVIDED += "libsdl-native"
+#ASSUME_PROVIDED += "libsdl-native"
 
 
 # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
Signature · 1 line
2.7.0
#2 lore raw
In reply to Ross Burton

This patch causes my jethro build to now fail with:

ERROR: Nothing PROVIDES 'virtual/nativesdk-nativesdk-libx11' (but virtual:nativesdk:/z/dragon410c-repo/dragon410c-tw-jethro/layers/openembedded-core/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb DEPENDS on or otherwise requires it). Close matches:
virtual/nativesdk-libx11
virtual/nativesdk-libc
virtual/nativesdk-db

Quoted 84 lines · Ross Burton

Use PACKAGECONFIG instead of using logic in DEPENDS and EXTRA_OECONF, adding new options for PulseAudio, tslib, DirectFB, OpenGL and X11. Pass --disable-x11-shared so that it links to the X libraries instead of using dlopen().

Disable tslib by default as the kernel event input subsystem is generally used.

SDL's OpenGL support requires X11 so check for both x11 and opengl, and merge the dependencies.

Finally enable native builds, with a minimal PACKAGECONFIG that will build from oe-core for native and nativesdk.

(From OE-Core rev: 3d6c31c3a4ff34376e17005a981bb55fc6f7a38f)

---
  meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 35 ++++++++++++++-------------
  1 file changed, 18 insertions(+), 17 deletions(-)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +18 -17
index c0d5c6a..1cf3c39 100644
@@ -12,13 +12,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
 
  PROVIDES = "virtual/libsdl"
 
-DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
-           ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libglu', '', d)} \
-           tslib"
-DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
-
  PR = "r3"
 
  SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
@@ -38,21 +31,29 @@ inherit autotools lib_package binconfig-disabled pkgconfig
 
  EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers \
                  --enable-file --disable-oss --disable-esd --disable-arts \
-                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+                --disable-diskaudio --disable-nas \
                  --disable-mintaudio --disable-nasm --disable-video-dga \
                  --disable-video-fbcon --disable-video-ps2gs --disable-video-ps3 \
                  --disable-xbios --disable-gem --disable-video-dummy \
-                --enable-input-events --enable-input-tslib --enable-pthreads \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', '--enable-video-directfb', '--disable-video-directfb', d)} \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '--enable-video-opengl', '--disable-video-opengl', d)} \
-                ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--enable-video-x11', '--disable-video-x11', d)} \
+                --enable-input-events --enable-pthreads \
                  --disable-video-svga \
                  --disable-video-picogui --disable-video-qtopia --enable-sdl-dlopen \
-                --disable-rpath \
-                --disable-pulseaudio"
+                --disable-rpath"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-native = "x11"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
-PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib] = "--enable-input-tslib, --disable-input-tslib, tslib"
+PACKAGECONFIG[directfb] = "--enable-video-directfb, --disable-video-directfb, directfb"
+PACKAGECONFIG[opengl] = "--enable-video-opengl, --disable-video-opengl, virtual/libgl libglu"
+PACKAGECONFIG[x11] = "--enable-video-x11 --disable-x11-shared, --disable-video-x11, virtual/libx11 libxext libxrandr libxrender"
 
  EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
 
@@ -65,4 +66,4 @@ do_configure_prepend() {
          export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
  }
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
#3 lore raw
Quoted 4 lines · Trevor Woerner

ERROR: Nothing PROVIDES 'virtual/nativesdk-nativesdk-libx11' (but virtual:nativesdk:/z/dragon410c-repo/dragon410c-tw-jethro/layers/openembedded-core/meta/recipes-graphics/libsdl/ libsdl_1.2.15.bb DEPENDS on or otherwise requires it). Close matches:

That's an awesome comment. Clearly my testing wasn't optimal, there's another patch required.

Can you verify that cherry-picking 55ca1fb8f0e81ff739b3c46897e43356d1f760c3 solves this?

Ross

#4 lore raw

Hi Ross,

Quoted 9 lines · Ross

On 11 March 2016 at 20:20, Trevor Woerner <[email protected] <mailto:[email protected]>> wrote:

ERROR: Nothing PROVIDES 'virtual/nativesdk-nativesdk-libx11' (but virtual:nativesdk:/z/dragon410c-repo/dragon410c-tw-jethro/layers/openembedded-core/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
<http://libsdl_1.2.15.bb> DEPENDS on or otherwise requires it).
Close matches:

Quoted 3 lines

That's an awesome comment. Clearly my testing wasn't optimal, there's another patch required.

Can you verify that cherry-picking 55ca1fb8f0e81ff739b3c46897e43356d1f760c3 solves this?

Yes, verified. Cherry-picking 55ca1fb8 solves the problem.

Thanks! :-)

#5 lore raw
Quoted 20 lines · Trevor Woerner

Hi Ross,

Quoted 17 lines · Ross

On 11 March 2016 at 20:20, Trevor Woerner <[email protected] <mailto:[email protected]>> wrote:

ERROR: Nothing PROVIDES 'virtual/nativesdk-nativesdk-libx11'
(but

    virtual:nativesdk:/z/dragon410c-repo/dragon410c-tw
(quoted diff) +0 -2
-jethro/layers/openembedded-core/meta/recipes
-graphics/libsdl/libsdl_1.2.15.bb
    <http://libsdl_1.2.15.bb> DEPENDS on or otherwise requires it).
    Close matches:

That's an awesome comment. Clearly my testing wasn't optimal, there's
another patch required.

Quoted 7 lines
Quoted 3 lines

Can you verify that
cherry-picking 55ca1fb8f0e81ff739b3c46897e43356d1f760c3 solves this?

Yes, verified. Cherry-picking 55ca1fb8 solves the problem.

Thanks! :-)

I just merged the fix to the branch, thanks for testing.

Cheers,

Richard

#6 lore raw
Quoted 20 lines · Richard Purdie
Quoted 19 lines · Trevor Woerner

Hi Ross,

Quoted 16 lines · Ross

On 11 March 2016 at 20:20, Trevor Woerner <[email protected] <mailto:[email protected]>> wrote:

ERROR: Nothing PROVIDES 'virtual/nativesdk-nativesdk-libx11'
(but

     virtual:nativesdk:/z/dragon410c-repo/dragon410c-tw
(quoted diff) +0 -2
-jethro/layers/openembedded-core/meta/recipes
-graphics/libsdl/libsdl_1.2.15.bb
     <http://libsdl_1.2.15.bb> DEPENDS on or otherwise requires it).
     Close matches:

That's an awesome comment. Clearly my testing wasn't optimal, there's
another patch required.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Can you verify that
cherry-picking 55ca1fb8f0e81ff739b3c46897e43356d1f760c3 solves this?

Yes, verified. Cherry-picking 55ca1fb8 solves the problem.

Thanks! :-)

I just merged the fix to the branch, thanks for testing.

Thank _you_ people for being so fast to respond to the issues your users find!

#7 lore raw

Hello folks,

Quoted 9 lines · Trevor Woerner
Quoted 8 lines · Richard Purdie
Quoted 7 lines · Trevor Woerner
Quoted 3 lines · Ross

Can you verify that
cherry-picking 55ca1fb8f0e81ff739b3c46897e43356d1f760c3 solves this?

Yes, verified. Cherry-picking 55ca1fb8 solves the problem.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Thanks! :-)

I just merged the fix to the branch, thanks for testing.

Thank _you_ people for being so fast to respond to the issues your users find!

This did not fix the issue when the distro does not have X11. For framebuffer based distros it is failing badly.

See:

http://ci.ossystems.com.br/view/FSL%20Community%20BSP%20-%20jethro/job/fsl-community-bsp-jethro_framebuffer-imx28evk/77/console

The native flavour ought to enable X11 ONLY if it is in DISTRO_FEATURES.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#8 lore raw

On 14 March 2016 at 18:40, Otavio Salvador <[email protected]

Quoted 4 lines

wrote:

The native flavour ought to enable X11 ONLY if it is in DISTRO_FEATURES.

Backport of the relevant fix - not workaround - submitted.

Ross