summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Mattern2021-11-29 13:17:46 +0100
committerPeter Mattern2021-11-29 13:17:46 +0100
commitd39cb7d51521944173b9a5d88f5ce57d493a1ce6 (patch)
treeb08be2222d67636886ff84ffdbe04cd1ea6b1eac
parent1a1d140e60b8333b7afe3bb0e7f6dc6123808e65 (diff)
downloadaur-d39cb7d51521944173b9a5d88f5ce57d493a1ce6.tar.gz
Add patch fixing build against current Xorg server
https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl/-/merge_requests/6
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD8
-rw-r--r--fix-build-against-current-x-server.diff101
3 files changed, 108 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 884379e6d985..b4b4a534a6fb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -25,6 +25,8 @@ pkgbase = xf86-video-qxl-git
conflicts = X-ABI-VIDEODRV_VERSION<23
conflicts = X-ABI-VIDEODRV_VERSION>=24
source = git+https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl.git
+ source = fix-build-against-current-x-server.diff
sha256sums = SKIP
+ sha256sums = a5e4292d3a6bc9641a8d4ec4d9eb92094ee3d20581c590051e878c8829b9a035
pkgname = xf86-video-qxl-git
diff --git a/PKGBUILD b/PKGBUILD
index 392d75fc2a70..2ce3be85c581 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,8 +16,10 @@ optdepends=('python2: Xspice server')
makedepends=('git' 'xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=23' 'spice-protocol')
provides=('xf86-video-qxl')
conflicts=('xf86-video-qxl' 'X-ABI-VIDEODRV_VERSION<23' 'X-ABI-VIDEODRV_VERSION>=24')
-source=("git+https://gitlab.freedesktop.org/xorg/driver/$_pkgname.git")
-sha256sums=('SKIP')
+source=("git+https://gitlab.freedesktop.org/xorg/driver/$_pkgname.git"
+ fix-build-against-current-x-server.diff)
+sha256sums=('SKIP'
+ a5e4292d3a6bc9641a8d4ec4d9eb92094ee3d20581c590051e878c8829b9a035)
pkgver() {
cd $_pkgname
@@ -26,7 +28,7 @@ pkgver() {
prepare() {
cd $_pkgname
- sed -i '1c #!/usr/bin/python2' scripts/Xspice
+ patch -p1 < ../fix-build-against-current-x-server.diff
}
build() {
diff --git a/fix-build-against-current-x-server.diff b/fix-build-against-current-x-server.diff
new file mode 100644
index 000000000000..d1a8d7e6f2a9
--- /dev/null
+++ b/fix-build-against-current-x-server.diff
@@ -0,0 +1,101 @@
+From 4b083ede3c4a827a84295ff223e34ee3c2e581b2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Sat, 28 Aug 2021 15:38:40 +0200
+Subject: [PATCH] Fix a build error with Xorg master
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use xf86ReturnOptValBool() in get_bool_option() instead of
+options[option_index].value.bool to fix a compiler error with
+current Xorg xserver master branch.
+
+Also use xf86GetOptValInteger() in get_int_option() and
+xf86GetOptValString() in get_str_option() for consistency.
+
+The change causes a slight performance drop during option parsing
+because the passed-in index_value is no longer used as an index
+into the options array.
+
+Instead, it's used as a token now for the standard option getter
+functions which works since the index_value to the get_*_option()
+functions are identical to the value of options[n].token in the
+passed-in OptionInfoRec array.
+
+Also rename "int option_index" to "int token" for clarity in all
+three functions.
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ src/qxl_option_helpers.c | 13 +++++++------
+ src/qxl_option_helpers.h | 6 +++---
+ 2 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/src/qxl_option_helpers.c b/src/qxl_option_helpers.c
+index 2aba677..7707b7c 100644
+--- a/src/qxl_option_helpers.c
++++ b/src/qxl_option_helpers.c
+@@ -10,31 +10,32 @@
+
+ #include "qxl_option_helpers.h"
+
+-int get_int_option(OptionInfoPtr options, int option_index,
++int get_int_option(OptionInfoPtr options, int token,
+ const char *env_name)
+ {
++ int value;
+ if (env_name && getenv(env_name)) {
+ return atoi(getenv(env_name));
+ }
+- return options[option_index].value.num;
++ return xf86GetOptValInteger(options, token, &value) ? value : 0;
+ }
+
+-const char *get_str_option(OptionInfoPtr options, int option_index,
++const char *get_str_option(OptionInfoPtr options, int token,
+ const char *env_name)
+ {
+ if (getenv(env_name)) {
+ return getenv(env_name);
+ }
+- return options[option_index].value.str;
++ return xf86GetOptValString(options, token);
+ }
+
+-int get_bool_option(OptionInfoPtr options, int option_index,
++int get_bool_option(OptionInfoPtr options, int token,
+ const char *env_name)
+ {
+ const char* value = getenv(env_name);
+
+ if (!value) {
+- return options[option_index].value.bool;
++ return xf86ReturnOptValBool(options, token, FALSE);
+ }
+ if (strcmp(value, "0") == 0 ||
+ strcasecmp(value, "off") == 0 ||
+diff --git a/src/qxl_option_helpers.h b/src/qxl_option_helpers.h
+index 7c54c72..66d0a17 100644
+--- a/src/qxl_option_helpers.h
++++ b/src/qxl_option_helpers.h
+@@ -4,13 +4,13 @@
+ #include <xf86Crtc.h>
+ #include <xf86Opt.h>
+
+-int get_int_option(OptionInfoPtr options, int option_index,
++int get_int_option(OptionInfoPtr options, int token,
+ const char *env_name);
+
+-const char *get_str_option(OptionInfoPtr options, int option_index,
++const char *get_str_option(OptionInfoPtr options, int token,
+ const char *env_name);
+
+-int get_bool_option(OptionInfoPtr options, int option_index,
++int get_bool_option(OptionInfoPtr options, int token,
+ const char *env_name);
+
+ #endif // OPTION_HELPERS_H
+--
+GitLab
+