From ae9a754a6bda12b2886a9a919a6351c69a6645e6 Mon Sep 17 00:00:00 2001
From: Peter Shkenev <santurysim@gmail.com>
Date: Sat, 23 Mar 2024 22:43:00 +0000
Subject: [PATCH] main/libxkbcommon: upgrade to 1.7.0

---
 main/libxkbcommon/APKBUILD              |  9 ++-
 main/libxkbcommon/allow-skip-test.patch | 84 +++++++++++++++++++++++++
 2 files changed, 90 insertions(+), 3 deletions(-)
 create mode 100644 main/libxkbcommon/allow-skip-test.patch

diff --git a/main/libxkbcommon/APKBUILD b/main/libxkbcommon/APKBUILD
index bbb33275309d..3d50e9b8e008 100644
--- a/main/libxkbcommon/APKBUILD
+++ b/main/libxkbcommon/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Leo <thinkabit.ukim@gmail.com>
 # Maintainer: Peter Shkenev <santurysim@gmail.com>
 pkgname=libxkbcommon
-pkgver=1.6.0
+pkgver=1.7.0
 pkgrel=0
 pkgdesc="keyboard handling library"
 url="https://www.xkbcommon.org/"
@@ -27,7 +27,9 @@ subpackages="
 	xkbcli-doc
 	xkbcli-bash-completion
 	"
-source="https://xkbcommon.org/download/libxkbcommon-$pkgver.tar.xz"
+source="https://xkbcommon.org/download/libxkbcommon-$pkgver.tar.xz
+	allow-skip-test.patch
+	"
 
 build() {
 	abuild-meson \
@@ -69,5 +71,6 @@ bashcomp() {
 
 
 sha512sums="
-4f93225eada1c5d0806bbc01f72d82d72729f4580ade963ff6a386711c9b2232aae5213c8488abf01c3b81f0e1fdb7f4d8a4d3786113ccc134251ff164c4be5c  libxkbcommon-1.6.0.tar.xz
+4b74a9f3f63e2ebc1cbdcaa963c70362e55fa527e1d89b6a1fd30d7a84a8b60c1b3dc99bcfbde85aa31890e0b2f62f0bad3c8ff8340fe6a930ee662b33448ba5  libxkbcommon-1.7.0.tar.xz
+17608171e5fe145030585a84ac43770a5f3d57a8d083b27ee443f08e886e046a802833658f68bcd2c07834ec7c95d5fa952414d6940a9ae4c38736c55d0bf98f  allow-skip-test.patch
 "
diff --git a/main/libxkbcommon/allow-skip-test.patch b/main/libxkbcommon/allow-skip-test.patch
new file mode 100644
index 000000000000..b0f342ec4cac
--- /dev/null
+++ b/main/libxkbcommon/allow-skip-test.patch
@@ -0,0 +1,84 @@
+Partial revert of 0ed9390c07130c2d3ebaf2e1b67c6dc0011a8aee
+as we don't have xvfb, needed for the tests, packaged in main
+
+diff --git a/test/x11.c b/test/x11.c
+index c3cf2ee..4ff211e 100644
+--- a/test/x11.c
++++ b/test/x11.c
+@@ -45,7 +45,7 @@ X11_TEST(test_basic)
+     */
+     conn = xcb_connect(display, NULL);
+     if (!conn || xcb_connection_has_error(conn)) {
+-        exit_code = TEST_SETUP_FAILURE;
++        exit_code = SKIP_TEST;
+         goto err_conn;
+     }
+ 
+@@ -55,7 +55,7 @@ X11_TEST(test_basic)
+                                       XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS,
+                                       NULL, NULL, NULL, NULL);
+     if (!ret) {
+-        exit_code = TEST_SETUP_FAILURE;
++        exit_code = SKIP_TEST;
+         goto err_conn;
+     }
+ 
+diff --git a/test/x11comp.c b/test/x11comp.c
+index 33dd7c2..dc70fd1 100644
+--- a/test/x11comp.c
++++ b/test/x11comp.c
+@@ -51,7 +51,7 @@ X11_TEST(test_basic)
+ 
+     conn = xcb_connect(display, NULL);
+     if (xcb_connection_has_error(conn)) {
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_conn;
+     }
+     ret = xkb_x11_setup_xkb_extension(conn,
+@@ -60,7 +60,7 @@ X11_TEST(test_basic)
+                                       XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS,
+                                       NULL, NULL, NULL, NULL);
+     if (!ret) {
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_xcb;
+     }
+     device_id = xkb_x11_get_core_keyboard_device_id(conn);
+@@ -72,12 +72,12 @@ X11_TEST(test_basic)
+     ret = posix_spawnp(&xkbcomp_pid, "xkbcomp", NULL, NULL, xkbcomp_argv, envp);
+     free(xkb_path);
+     if (ret != 0) {
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_xcb;
+     }
+     ret = waitpid(xkbcomp_pid, &status, 0);
+     if (ret < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_xcb;
+     }
+ 
+diff --git a/test/xvfb-wrapper.c b/test/xvfb-wrapper.c
+index ab0c645..144187a 100644
+--- a/test/xvfb-wrapper.c
++++ b/test/xvfb-wrapper.c
+@@ -92,7 +92,7 @@ xvfb_wrapper(int (*test_func)(char* display))
+     ret = posix_spawnp(&xvfb_pid, "Xvfb", NULL, NULL, xvfb_argv, envp);
+     if (ret != 0) {
+         fprintf(stderr, "posix_spawnp error %d: %s\n", ret, strerror(ret));
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_xvfd;
+     }
+ 
+@@ -118,7 +118,7 @@ xvfb_wrapper(int (*test_func)(char* display))
+     length = fread(&display[1], 1, sizeof(display) - 1, display_fd);
+     if (length <= 0) {
+         fprintf(stderr, "fread error: length=%zu\n", length);
+-        ret = TEST_SETUP_FAILURE;
++        ret = SKIP_TEST;
+         goto err_xvfd;
+     } else {
+         /* Drop the newline character */
-- 
GitLab