commit:     309b61024f2fa97cb7fdeb82f3c9e26955624cbd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 27 21:46:26 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 27 21:46:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=309b6102

x11-base/xwayland: fix modern C issue

Signed-off-by: Sam James <sam <AT> gentoo.org>

 x11-base/xwayland/files/xwayland-23.2.4-c99.patch |  72 ++++++++++++++
 x11-base/xwayland/xwayland-23.2.4-r1.ebuild       | 113 ++++++++++++++++++++++
 2 files changed, 185 insertions(+)

diff --git a/x11-base/xwayland/files/xwayland-23.2.4-c99.patch 
b/x11-base/xwayland/files/xwayland-23.2.4-c99.patch
new file mode 100644
index 000000000000..21131ea317e4
--- /dev/null
+++ b/x11-base/xwayland/files/xwayland-23.2.4-c99.patch
@@ -0,0 +1,72 @@
+https://gitlab.freedesktop.org/xorg/xserver/-/commit/f0a187f55d76139225c11ce92ab69816d46db55c
+
+From f0a187f55d76139225c11ce92ab69816d46db55c Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Mon, 29 Jan 2024 10:31:36 +0100
+Subject: [PATCH] xwayland: Use correct pointer types on i386
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+And other 32-bit architectures, where uint32_t and CARD32 are
+not the same type.  Otherwise the build will fail with GCC 14
+with errors like:
+
+../hw/xwayland/xwayland-glamor.c: In function ‘xwl_glamor_get_formats’:
+../hw/xwayland/xwayland-glamor.c:291:43: error: passing argument 3 of 
‘xwl_get_formats_for_device’ from incompatible pointer type 
[-Wincompatible-pointer-types]
+  291 |                                           num_formats, formats);
+      |                                           ^~~~~~~~~~~
+      |                                           |
+      |                                           CARD32 * {aka long unsigned 
int *}
+../hw/xwayland/xwayland-glamor.c:238:38: note: expected ‘uint32_t *’ {aka 
‘unsigned int *’} but argument is of type ‘CARD32 *’ {aka ‘long 
unsigned int *’}
+  238 |                            uint32_t *num_formats, uint32_t **formats)
+      |                            ~~~~~~~~~~^~~~~~~~~~~
+../hw/xwayland/xwayland-glamor.c:291:56: error: passing argument 4 of 
‘xwl_get_formats_for_device’ from incompatible pointer type 
[-Wincompatible-pointer-types]
+  291 |                                           num_formats, formats);
+      |                                                        ^~~~~~~
+      |                                                        |
+      |                                                        CARD32 ** {aka 
long unsigned int **}
+../hw/xwayland/xwayland-glamor.c:238:62: note: expected ‘uint32_t **’ {aka 
‘unsigned int **’} but argument is of type ‘CARD32 **’ {aka ‘long 
unsigned int **’}
+  238 |                            uint32_t *num_formats, uint32_t **formats)
+      |                                                   ~~~~~~~~~~~^~~~~~~
+../hw/xwayland/xwayland-glamor.c:295:28: error: passing argument 3 of 
‘xwl_get_formats’ from incompatible pointer type 
[-Wincompatible-pointer-types]
+  295 |                            num_formats, formats);
+      |                            ^~~~~~~~~~~
+      |                            |
+      |                            CARD32 * {aka long unsigned int *}
+../hw/xwayland/xwayland-glamor.c:217:26: note: expected ‘uint32_t *’ {aka 
‘unsigned int *’} but argument is of type ‘CARD32 *’ {aka ‘long 
unsigned int *’}
+  217 |                uint32_t *num_formats, uint32_t **formats)
+      |                ~~~~~~~~~~^~~~~~~~~~~
+../hw/xwayland/xwayland-glamor.c:295:41: error: passing argument 4 of 
‘xwl_get_formats’ from incompatible pointer type 
[-Wincompatible-pointer-types]
+  295 |                            num_formats, formats);
+      |                                         ^~~~~~~
+      |                                         |
+      |                                         CARD32 ** {aka long unsigned 
int **}
+../hw/xwayland/xwayland-glamor.c:217:50: note: expected ‘uint32_t **’ {aka 
‘unsigned int **’} but argument is of type ‘CARD32 **’ {aka ‘long 
unsigned int **’}
+  217 |                uint32_t *num_formats, uint32_t **formats)
+      |                                       ~~~~~~~~~~~^~~~~~~
+--- a/hw/xwayland/xwayland-glamor.c
++++ b/hw/xwayland/xwayland-glamor.c
+@@ -212,7 +212,7 @@ xwl_screen_get_main_dev(struct xwl_screen *xwl_screen)
+ 
+ static Bool
+ xwl_get_formats(struct xwl_format *format_array, int format_array_len,
+-               uint32_t *num_formats, uint32_t **formats)
++               CARD32 *num_formats, CARD32 **formats)
+ {
+     *num_formats = 0;
+     *formats = NULL;
+@@ -233,9 +233,9 @@ xwl_get_formats(struct xwl_format *format_array, int 
format_array_len,
+ 
+ static Bool
+ xwl_get_formats_for_device(struct xwl_dmabuf_feedback *xwl_feedback, 
drmDevice *device,
+-                           uint32_t *num_formats, uint32_t **formats)
++                           CARD32 *num_formats, CARD32 **formats)
+ {
+-    uint32_t *ret = NULL;
++    CARD32 *ret = NULL;
+     uint32_t count = 0;
+ 
+     /* go through all matching sets of tranches for the window's device */
+-- 
+GitLab

diff --git a/x11-base/xwayland/xwayland-23.2.4-r1.ebuild 
b/x11-base/xwayland/xwayland-23.2.4-r1.ebuild
new file mode 100644
index 000000000000..2a4fe1f5c0f8
--- /dev/null
+++ b/x11-base/xwayland/xwayland-23.2.4-r1.ebuild
@@ -0,0 +1,113 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git";
+       inherit git-r3
+else
+       
SRC_URI="https://xorg.freedesktop.org/archive/individual/xserver/${P}.tar.xz";
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standalone X server running under Wayland"
+HOMEPAGE="https://wayland.freedesktop.org/xserver.html";
+
+IUSE="libei selinux systemd video_cards_nvidia unwind xcsecurity"
+
+LICENSE="MIT"
+SLOT="0"
+
+COMMON_DEPEND="
+       dev-libs/libbsd
+       dev-libs/openssl:=
+       >=dev-libs/wayland-1.21.0
+       >=dev-libs/wayland-protocols-1.30
+       media-fonts/font-util
+       >=media-libs/libepoxy-1.5.4[X,egl(+)]
+       media-libs/libglvnd[X]
+       >=media-libs/mesa-21.1[X(+),egl(+),gbm(+)]
+       >=x11-libs/libdrm-2.4.109
+       >=x11-libs/libXau-1.0.4
+       x11-libs/libxcvt
+       >=x11-libs/libXdmcp-1.0.2
+       >=x11-libs/libXfont2-2.0.1
+       x11-libs/libxkbfile
+       >=x11-libs/libxshmfence-1.1
+       >=x11-libs/pixman-0.27.2
+       >=x11-misc/xkeyboard-config-2.4.1-r3
+
+       libei? ( dev-libs/libei )
+       systemd? ( sys-apps/systemd )
+       unwind? ( sys-libs/libunwind )
+       video_cards_nvidia? ( gui-libs/egl-wayland )
+"
+DEPEND="
+       ${COMMON_DEPEND}
+       >=x11-base/xorg-proto-2022.2
+       >=x11-libs/xtrans-1.3.5
+"
+RDEPEND="
+       ${COMMON_DEPEND}
+       x11-apps/xkbcomp
+
+       libei? ( >=sys-apps/xdg-desktop-portal-1.18.0 )
+       selinux? ( sec-policy/selinux-xserver )
+"
+BDEPEND="
+       app-alternatives/lex
+       dev-util/wayland-scanner
+"
+
+PATCHES=(
+       "${FILESDIR}"/xwayland-drop-redundantly-installed-files.patch
+       "${FILESDIR}"/xwayland-23.2.3-systemd-automagic.patch
+       "${FILESDIR}"/xwayland-23.2.4-c99.patch
+)
+
+src_configure() {
+       local emesonargs=(
+               $(meson_use selinux xselinux)
+               $(meson_use systemd)
+               $(meson_use unwind libunwind)
+               $(meson_use xcsecurity)
+               $(meson_use video_cards_nvidia xwayland_eglstream)
+               -Ddpms=true
+               -Ddri3=true
+               -Ddrm=true
+               -Ddtrace=false
+               -Dglamor=true
+               -Dglx=true
+               -Dipv6=true
+               -Dsecure-rpc=false
+               -Dscreensaver=true
+               -Dsha1=libcrypto
+               -Dxace=true
+               -Dxdmcp=true
+               -Dxinerama=true
+               -Dxvfb=true
+               -Dxv=true
+               -Dxwayland-path="${EPREFIX}"/usr/bin
+               -Dlibdecor=false
+               -Ddocs=false
+               -Ddevel-docs=false
+               -Ddocs-pdf=false
+       )
+
+       if use libei; then
+               emesonargs+=( -Dxwayland_ei=portal )
+       else
+               emesonargs+=( -Dxwayland_ei=false )
+       fi
+
+       meson_src_configure
+}
+
+src_install() {
+       dosym ../bin/Xwayland /usr/libexec/Xwayland
+
+       meson_src_install
+}

Reply via email to