Skip to contentSkip to conversation

package/x11r7/xserver_xorg-server: Fix build with wayland, part I

PATCH New Bernd Kuhls 3 participants 7 messages Dec 27, 2016 – Jan 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 package/x11r7/xserver_xorg-server: Fix build with wayland, part I

Add missing dependency wayland-protocols.

Partly fixes
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

---
v2: added missing 'y' (Gustavo)

 package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +2 -2
index 6444a206b..7aebbc1d2 100644
@@ -82,9 +82,9 @@ XSERVER_XORG_SERVER_CONF_OPTS += \
 endif
 
 # Xwayland support needs libdrm, libepoxy, wayland and libxcomposite
-ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_LIBEPOXY)$(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),yyyy)
+ifeq ($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_LIBEPOXY)$(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_WAYLAND_PROTOCOLS)$(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),yyyyy)
 XSERVER_XORG_SERVER_CONF_OPTS += --enable-xwayland
-XSERVER_XORG_SERVER_DEPENDENCIES += libdrm libepoxy wayland xlib_libXcomposite
+XSERVER_XORG_SERVER_DEPENDENCIES += libdrm libepoxy wayland wayland-protocols xlib_libXcomposite
 else
 XSERVER_XORG_SERVER_CONF_OPTS += --disable-xwayland
 endif
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 2/3 package/x11r7/xserver_xorg-server: Fix build with wayland, part II

The previous patch is not sufficient to fix a build with wayland support based on
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

The build still errors out at a later stage during configure:

configure: error: Xwayland requires CLOCK_MONOTONIC support.

Add a patch from OpenEmbedded to fix the problem.

---
v2: no changes

 ...onfigure.ac-Fix-check-for-CLOCK_MONOTONIC.patch | 66 ++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 package/x11r7/xserver_xorg-server/1.19.0/0002-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
package/x11r7/xserver_xorg-server/1.19.0/0002-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch new file +66 -0
new file mode 100644
index 000000000..c5f04bf25
@@ -0,0 +1,66 @@
+Discover monotonic clock using compile-time check
+
+monotonic clock check does not work when cross-compiling.
+
+Upstream-Status: Denied [Does not work on OpenBSD]
+Signed-off-by: Jussi Kukkonen <[email protected]>
+
+
+
+Original patch follows:
+
+When xorg-xserver is being cross-compiled, there is currently no way
+for us to detect whether the monotonic clock is available on the
+target system, because we aren't able to run a test program on the host
+system. Currently, in this situation, we default to not use the
+monotonic clock. One problem with this situation is that the user will
+be treated as idle when the date is updated.
+
+To fix this situation, we now use a compile-time check to detect whether the
+monotonic clock is available. This check can run just fine when we are
+cross-compiling.
+
+Signed-off-by: David James <[email protected]>
+
+Downloaded from
+https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+---
+ configure.ac | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f7ab48c..26e85cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1048,19 +1048,16 @@ if ! test "x$have_clock_gettime" = xno; then
+         CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+     fi
+ 
+-    AC_RUN_IFELSE([AC_LANG_SOURCE([
++    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <time.h>
+-
+-int main(int argc, char *argv[[]]) {
+-    struct timespec tp;
+-
+-    if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
++#include <unistd.h>
++int main() {
++#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
++        #error No monotonic clock
++#endif
+         return 0;
+-    else
+-        return 1;
+ }
+-    ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+-       [MONOTONIC_CLOCK="cross compiling"])
++]])],[MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no])
+ 
+     LIBS="$LIBS_SAVE"
+     CPPFLAGS="$CPPFLAGS_SAVE"
+-- 
+2.1.4
+
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 2/3 package/x11r7/xserver_xorg-server: Fix build with wayland, part II

Hello,

Quoted 6 lines · Bernd Kuhls

The previous patch is not sufficient to fix a build with wayland support based on
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

The build still errors out at a later stage during configure:

Quoted 7 lines

configure: error: Xwayland requires CLOCK_MONOTONIC support.

Add a patch from OpenEmbedded to fix the problem.

---
v2: no changes

Applied to master, with a reworked commit title/log, and tweaked because the X.org server version has been updated in the mean time.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 3/3 package/pkgconf: variable pkgdatadir also needs sysroot prefixing, wayland patch III

In reply to Bernd Kuhls

Needed when wayland support is enabled in xserver_xorg-server.

This patch fixes the final build error:

Making all in xwayland
make[3]: Entering directory '/home/buildroot/br5/output/build/xserver_xorg-server-1.19.0/hw/xwayland'
make[3]: *** No rule to make target '/usr/share/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml', needed by 'relative-pointer-unstable-v1-client-protocol.h'. Stop.

when trying to build
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

---
v2: no changes

 ...0001-Fix-all-variables-sysroot-prefix-problem.patch | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch +12 -6
index bac9f6208..bc2b5273c 100644
@@ -1,4 +1,4 @@
-From abc7a780f2a52a1aa3ee288e17140b817b545cc3 Mon Sep 17 00:00:00 2001
+From aa6bbc09e68426592faf722630fe92b6ede75bc8 Mon Sep 17 00:00:00 2001
 From: Gustavo Zacarias <[email protected]>
 Date: Mon, 2 Nov 2015 18:38:00 -0300
 Subject: [PATCH] Fix all-variables sysroot prefix problem
@@ -14,15 +14,19 @@ the directories may be requested barebones via pkg-config
 --variable=includedir libfool for example.
 
 Signed-off-by: Gustavo Zacarias <[email protected]>
+
+Added pkgdatadir to the list of to-be-prefixed variables.
+
+Signed-off-by: Bernd Kuhls <[email protected]>
 ---
- main.c | 17 ++++++++++++-----
- 1 file changed, 12 insertions(+), 5 deletions(-)
+ main.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
 
 diff --git a/main.c b/main.c
-index 6947126..52d16c2 100644
+index 6947126..ce5e18f 100644
 --- a/main.c
 +++ b/main.c
-@@ -313,9 +313,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+@@ -313,9 +313,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
  			memset(req->buf, 0, sizeof(req->buf));
  
  			if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
@@ -33,12 +37,13 @@ index 6947126..52d16c2 100644
 +			    	(!strcmp(req->variable, "includedir") || \
 +				    !strcmp(req->variable, "libdir") || \
 +				    !strcmp(req->variable, "mapdir") || \
++				    !strcmp(req->variable, "pkgdatadir") || \
 +				    !strcmp(req->variable, "sdkdir")))
 +					strlcat(req->buf, sysroot_dir, sizeof(req->buf));
  			strlcat(req->buf, var, sizeof(req->buf));
  			return;
  		}
-@@ -323,8 +326,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+@@ -323,8 +327,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
  		strlcat(req->buf, " ", sizeof(req->buf));
  
  		if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
@@ -48,6 +53,7 @@ index 6947126..52d16c2 100644
 +		    	(!strcmp(req->variable, "includedir") || \
 +			    !strcmp(req->variable, "libdir") || \
 +			    !strcmp(req->variable, "mapdir") || \
++			    !strcmp(req->variable, "pkgdatadir") || \
 +			    !strcmp(req->variable, "sdkdir")))
 +				strlcat(req->buf, sysroot_dir, sizeof(req->buf));
  
Signature · 1 line
2.11.0
#4 lore raw

PATCH v2 3/3 package/pkgconf: variable pkgdatadir also needs sysroot prefixing, wayland patch III

Hello,

Peter, Gustavo, you are the pkg-config tweaks gurus. Could you comment on the following patch?

Thanks,

Thomas

Quoted 75 lines · Bernd Kuhls

Needed when wayland support is enabled in xserver_xorg-server.

This patch fixes the final build error:

Making all in xwayland
make[3]: Entering directory '/home/buildroot/br5/output/build/xserver_xorg-server-1.19.0/hw/xwayland'
make[3]: *** No rule to make target '/usr/share/wayland-protocols/unstable/relative-pointer/relative-pointer-unstable-v1.xml', needed by 'relative-pointer-unstable-v1-client-protocol.h'. Stop.

when trying to build
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

---
v2: no changes

 ...0001-Fix-all-variables-sysroot-prefix-problem.patch | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
package/pkgconf/0001-Fix-all-variables-sysroot-prefix-problem.patch +12 -6
index bac9f6208..bc2b5273c 100644
@@ -1,4 +1,4 @@
-From abc7a780f2a52a1aa3ee288e17140b817b545cc3 Mon Sep 17 00:00:00 2001
+From aa6bbc09e68426592faf722630fe92b6ede75bc8 Mon Sep 17 00:00:00 2001
 From: Gustavo Zacarias <[email protected]>
 Date: Mon, 2 Nov 2015 18:38:00 -0300
 Subject: [PATCH] Fix all-variables sysroot prefix problem
@@ -14,15 +14,19 @@ the directories may be requested barebones via pkg-config
 --variable=includedir libfool for example.
 
 Signed-off-by: Gustavo Zacarias <[email protected]>
+
+Added pkgdatadir to the list of to-be-prefixed variables.
+
+Signed-off-by: Bernd Kuhls <[email protected]>
 ---
- main.c | 17 ++++++++++++-----
- 1 file changed, 12 insertions(+), 5 deletions(-)
+ main.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
 
 diff --git a/main.c b/main.c
-index 6947126..52d16c2 100644
+index 6947126..ce5e18f 100644
 --- a/main.c
 +++ b/main.c
-@@ -313,9 +313,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+@@ -313,9 +313,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
  			memset(req->buf, 0, sizeof(req->buf));
 
  			if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
@@ -33,12 +37,13 @@ index 6947126..52d16c2 100644
 +			    	(!strcmp(req->variable, "includedir") || \
 +				    !strcmp(req->variable, "libdir") || \
 +				    !strcmp(req->variable, "mapdir") || \
++				    !strcmp(req->variable, "pkgdatadir") || \
 +				    !strcmp(req->variable, "sdkdir")))
 +					strlcat(req->buf, sysroot_dir, sizeof(req->buf));
  			strlcat(req->buf, var, sizeof(req->buf));
  			return;
  		}
-@@ -323,8 +326,12 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
+@@ -323,8 +327,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
  		strlcat(req->buf, " ", sizeof(req->buf));
 
  		if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
@@ -48,6 +53,7 @@ index 6947126..52d16c2 100644
 +		    	(!strcmp(req->variable, "includedir") || \
 +			    !strcmp(req->variable, "libdir") || \
 +			    !strcmp(req->variable, "mapdir") || \
++			    !strcmp(req->variable, "pkgdatadir") || \
 +			    !strcmp(req->variable, "sdkdir")))
 +				strlcat(req->buf, sysroot_dir, sizeof(req->buf));
 
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#5 lore raw

PATCH v2 3/3 package/pkgconf: variable pkgdatadir also needs sysroot prefixing, wayland patch III

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,
Peter, Gustavo, you are the pkg-config tweaks gurus. Could you comment on the following patch?

It's another case of build/runtime dirs confusion, so unless some package uses it for a runtime path it should be ok.

On my PC the only .pc files using pkgdatadir are from icu and wayland, and I did a test build of icu without problems, so lets see what the autobuilders say - Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH v2 1/3 package/x11r7/xserver_xorg-server: Fix build with wayland, part I

In reply to Bernd Kuhls

Hello,

Quoted 8 lines · Bernd Kuhls

Add missing dependency wayland-protocols.

Partly fixes
http://autobuild.buildroot.net/results/cf0/cf026e9b18e86b9890341612050f4d166a7b822d/

---
v2: added missing 'y' (Gustavo)

Applied to master, with a reworked commit title. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com