diff mbox series

[3/7] libsdl2: Find wayland-protocol files in proper location during cross compile

Message ID 20180721162715.12611-3-raj.khem@gmail.com
State New
Headers show
Series [1/7] glibc-locale: Fix host-user-contaminated QA errors | expand

Commit Message

Khem Raj July 21, 2018, 4:27 p.m. UTC
Fixes
| /bin/sh ../SDL2-2.0.8/build-scripts/mkinstalldirs build
| make: *** No rule to make target '//usr/share/wayland/wayland.xml', needed by 'gen/wayland-client-protocol.h'.  Stop.
| make: *** Waiting for unfinished jobs....
| mkdir -p -- build
| ERROR: oe_runmake failed

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...R-for-defining-WAYLAND_PROTOCOLS_DIR.patch | 34 +++++++++++++++++++
 .../recipes-graphics/libsdl2/libsdl2_2.0.8.bb |  7 +++-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DIR.patch

-- 
2.18.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Ross Burton July 23, 2018, 10:31 a.m. UTC | #1
On 21 July 2018 at 17:27, Khem Raj <raj.khem@gmail.com> wrote:
> @@ -29,6 +30,7 @@ EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \

>                  --enable-pthreads \

>                  --enable-sdl-dlopen \

>                  --disable-rpath \

> +                --disable-wayland-shared \


This isn't explained in the commit log.

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj July 23, 2018, 9:11 p.m. UTC | #2
On Mon, Jul 23, 2018 at 3:31 AM Burton, Ross <ross.burton@intel.com> wrote:
>

> On 21 July 2018 at 17:27, Khem Raj <raj.khem@gmail.com> wrote:

> > @@ -29,6 +30,7 @@ EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \

> >                  --enable-pthreads \

> >                  --enable-sdl-dlopen \

> >                  --disable-rpath \

> > +                --disable-wayland-shared \

>

> This isn't explained in the commit log.


disable dynamic loading support for Wayland as it seems to not load
the dependencies correctly.

do you want me to send v2 ?



>

> Ross

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton July 25, 2018, 8:08 p.m. UTC | #3
On 21 July 2018 at 17:27, Khem Raj <raj.khem@gmail.com> wrote:
> +pkgconfig would return an absolute path in /usr/share/wayland-protocols

> +for the pkgdatadir value, which is not suitable for cross-compiling.


For reference this is due to pkgconf (not pkgconfig) having different
behaviour compared to pkgconfig, which is breaking recipes.
Personally I consider this a bug in pkgconf and there are bugs
upstream (and new releases) which may solve it directly instead of
having to fix every user of Weston (which isn't the only user of this
pattern).

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj July 25, 2018, 8:18 p.m. UTC | #4
On Wed, Jul 25, 2018 at 1:08 PM Burton, Ross <ross.burton@intel.com> wrote:
>

> On 21 July 2018 at 17:27, Khem Raj <raj.khem@gmail.com> wrote:

> > +pkgconfig would return an absolute path in /usr/share/wayland-protocols

> > +for the pkgdatadir value, which is not suitable for cross-compiling.

>

> For reference this is due to pkgconf (not pkgconfig) having different

> behaviour compared to pkgconfig, which is breaking recipes.

> Personally I consider this a bug in pkgconf and there are bugs

> upstream (and new releases) which may solve it directly instead of

> having to fix every user of Weston (which isn't the only user of this

> pattern).

>


while I agree its due to a different behavior from pkgconf, the
solution is not relying on pkgconfig features
in itself is an improvement IMO unless you say its regressing builds
when not using pkgconfig
> Ross

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Ross Burton July 25, 2018, 8:22 p.m. UTC | #5
On 25 July 2018 at 21:18, Khem Raj <raj.khem@gmail.com> wrote:
> while I agree its due to a different behavior from pkgconf, the

> solution is not relying on pkgconfig features

> in itself is an improvement IMO unless you say its regressing builds

> when not using pkgconfig


This is a behavioural change between the two and personally I don't
consider this a bug in pkgconfig, so pkgconf should do the same.

Also it turns out that you can override variable lookups with
environment variables in pkgconfig (see
https://git.dereferenced.org/pkgconf/pkgconf/issues/2) so when pkgconf
does this we can override the lookups without needing any patches.

Ross
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj July 26, 2018, 8 p.m. UTC | #6
On Wed, Jul 25, 2018 at 1:23 PM Burton, Ross <ross.burton@intel.com> wrote:
>

> On 25 July 2018 at 21:18, Khem Raj <raj.khem@gmail.com> wrote:

> > while I agree its due to a different behavior from pkgconf, the

> > solution is not relying on pkgconfig features

> > in itself is an improvement IMO unless you say its regressing builds

> > when not using pkgconfig

>

> This is a behavioural change between the two and personally I don't

> consider this a bug in pkgconfig, so pkgconf should do the same.

>

> Also it turns out that you can override variable lookups with

> environment variables in pkgconfig (see

> https://git.dereferenced.org/pkgconf/pkgconf/issues/2) so when pkgconf

> does this we can override the lookups without needing any patches.

>


I would tend to agree. I think it might be ok to defer these fixes for now

> Ross

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DIR.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DIR.patch
new file mode 100644
index 0000000000..f9a666e755
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DIR.patch
@@ -0,0 +1,34 @@ 
+From 07ef55d0fd9f53a4d94ed8df03ac5ef7d3cbf2d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Jul 2018 22:51:32 -0700
+Subject: [PATCH] use PKG_CHECK_VAR for defining WAYLAND_PROTOCOLS_DIR
+
+This allows to override the wayland-protocols pkgdatadir with the
+WAYLAND_PROTOCOLS_DIR from environment.
+
+pkgconfig would return an absolute path in /usr/share/wayland-protocols
+for the pkgdatadir value, which is not suitable for cross-compiling.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ .../libsdl2/2.0.8-r0/SDL2-2.0.8/configure.in                    | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: SDL2-2.0.8/configure.in
+===================================================================
+--- SDL2-2.0.8.orig/configure.in
++++ SDL2-2.0.8/configure.in
+@@ -1395,9 +1395,9 @@ AC_HELP_STRING([--enable-video-wayland-q
+             if $PKG_CONFIG --exists wayland-client wayland-scanner wayland-protocols wayland-egl wayland-cursor egl xkbcommon ; then
+                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
+                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
+-                WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+-                WAYLAND_CORE_PROTOCOL_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-client`
+-                WAYLAND_PROTOCOLS_DIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
++                PKG_CHECK_VAR(WAYLAND_SCANNER, wayland-scanner, wayland_scanner)
++                PKG_CHECK_VAR(WAYLAND_CORE_PROTOCOL_DIR, wayland-client, pkgdatadir)
++                PKG_CHECK_VAR(WAYLAND_PROTOCOLS_DIR, wayland-protocols, pkgdatadir)
+                 video_wayland=yes
+             fi
+         fi
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
index accea38aaa..a8d2283fde 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
@@ -14,7 +14,8 @@  PROVIDES = "virtual/libsdl2"
 
 SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
            file://more-gen-depends.patch \
-"
+           file://0001-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DIR.patch \
+           "
 
 S = "${WORKDIR}/SDL2-${PV}"
 
@@ -29,6 +30,7 @@  EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
                 --enable-pthreads \
                 --enable-sdl-dlopen \
                 --disable-rpath \
+                --disable-wayland-shared \
                 "
 
 # opengl packageconfig factored out to make it easy for distros
@@ -53,6 +55,9 @@  PACKAGECONFIG[x11]        = "--enable-video-x11,--disable-video-x11,virtual/libx
 
 EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
 
+export WAYLAND_PROTOCOLS_DIR="${STAGING_DATADIR}/wayland-protocols"
+export WAYLAND_CORE_PROTOCOL_DIR="${STAGING_DATADIR}/wayland"
+
 do_configure_prepend() {
         # Remove old libtool macros.
         MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"