summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-12-16 22:32:16 +0000
committerSam James <sam@gentoo.org>2021-12-16 22:32:16 +0000
commit33ed515d5d5578cfa5066fba4634ccb9e84d6857 (patch)
treefb85de1b74fc7c2a810359c3c8f3a8278fe64c4b /x11-drivers
parentapp-dicts/aspell-rw: drop 0.50.0 (diff)
downloadgentoo-33ed515d5d5578cfa5066fba4634ccb9e84d6857.tar.gz
gentoo-33ed515d5d5578cfa5066fba4634ccb9e84d6857.tar.bz2
gentoo-33ed515d5d5578cfa5066fba4634ccb9e84d6857.zip
x11-drivers/xf86-video-qxl: fix build with xorg 21
Closes: https://bugs.gentoo.org/827652 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/xf86-video-qxl/files/xf86-video-qxl-0.1.5_p20200205-xorg-21.0-build.patch93
-rw-r--r--x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.5_p20200205-r1.ebuild52
2 files changed, 145 insertions, 0 deletions
diff --git a/x11-drivers/xf86-video-qxl/files/xf86-video-qxl-0.1.5_p20200205-xorg-21.0-build.patch b/x11-drivers/xf86-video-qxl/files/xf86-video-qxl-0.1.5_p20200205-xorg-21.0-build.patch
new file mode 100644
index 000000000000..b4f9024a1e4a
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/files/xf86-video-qxl-0.1.5_p20200205-xorg-21.0-build.patch
@@ -0,0 +1,93 @@
+https://bugs.gentoo.org/827652
+https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl/-/merge_requests/6
+
+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>
+--- 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 ||
+--- 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
diff --git a/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.5_p20200205-r1.ebuild b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.5_p20200205-r1.ebuild
new file mode 100644
index 000000000000..86d9d4133a45
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.5_p20200205-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit autotools python-single-r1 xorg-3
+
+DESCRIPTION="QEMU QXL paravirt video driver"
+SRC_URI="https://dev.gentoo.org/~slashbeast/distfiles/${PN}/${P}.tar.xz"
+S="${WORKDIR}"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="xspice"
+REQUIRED_USE="xspice? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ xspice? (
+ app-emulation/spice
+ ${PYTHON_DEPS}
+ )
+ x11-base/xorg-server[-minimal]
+ >=x11-libs/libdrm-2.4.46"
+DEPEND="
+ ${RDEPEND}
+ >=app-emulation/spice-protocol-0.12.0
+ x11-base/xorg-proto"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.1.5_p20200205-xorg-21.0-build.patch
+)
+
+pkg_setup() {
+ use xspice && python-single-r1_pkg_setup
+ xorg-3_pkg_setup
+}
+
+src_prepare() {
+ xorg-3_src_prepare
+ eautoreconf
+
+ use xspice && python_fix_shebang scripts
+}
+
+src_configure() {
+ local XORG_CONFIGURE_OPTIONS=(
+ $(use_enable xspice)
+ )
+ xorg-3_src_configure
+}