Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Apr 2024 16:26:47 GMT
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 5c3c7500abd3 - main - x11-servers/xorg-server: Add upstream patch for xkbcomp directory
Message-ID:  <202404101626.43AGQloT012532@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5c3c7500abd37116903994674f562c603a29aec1

commit 5c3c7500abd37116903994674f562c603a29aec1
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2024-04-09 15:25:10 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2024-04-10 16:26:43 +0000

    x11-servers/xorg-server: Add upstream patch for xkbcomp directory
    
    Add a patch commited upstream but not present in any releases (except
    Xwayland ones) as xorg-server releases stopped a while ago. This adds
    a fallback to use $XDG_RUNTIME_DIR for xkbcomp result file if the user
    can't write to the configured directory, which is unlikely for xorg-server
    as it's SUID but it is likely for xephyr or xvfb.
    While here use the meson default for xkb_dir as it's the same as the one we
    provide and use also the default for xkb_output_dir which defaults to
    xkb_dir/compiled which is a link to /var/lib/xkb (setup by the xkeyboard-config
    port).
    
    Differential Revision:  https://reviews.freebsd.org/D44697
    Reviewed by:    bapt
    Sponsored by:   Beckhoff Automation GmbH & Co. KG
---
 x11-servers/xorg-server/Makefile                  |  6 +----
 x11-servers/xorg-server/files/patch-xkb_ddxLoad.c | 30 +++++++++++++++++++++++
 x11-servers/xorg-server/pkg-plist                 |  2 --
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile
index 9939340ec737..ec5deabbea4b 100644
--- a/x11-servers/xorg-server/Makefile
+++ b/x11-servers/xorg-server/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	xorg
 PORTVERSION=	21.1.12
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	x11-servers
 MASTER_SITES=	XORG/individual/xserver
@@ -34,7 +35,6 @@ PKGMESSAGE=
 BINARY_NAME=	${FLAVOR:C/^(.).*/\1/:tu}${FLAVOR:C/^.//}
 PLIST_FILES=	bin/${BINARY_NAME} \
 		share/man/man1/${BINARY_NAME}.1.gz
-PLIST_DIRS=	/var/lib/xkb /var/lib
 .endif
 
 DESCR=	${.CURDIR}/pkg-descr-${FLAVOR}
@@ -53,8 +53,6 @@ MESON_ARGS+=	-Dxwin=false \
 		-Dfallback_input_driver=libinput \
 		-Ddocs=false \
 		-Dxcsecurity=true \
-		-Dxkb_dir=${LOCALBASE}/share/X11/xkb \
-		-Dxkb_output_dir=/var/lib/xkb \
 		-D${FLAVOR}=true
 
 .for f in ${FLAVORS:N${FLAVOR}}
@@ -126,13 +124,11 @@ post-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
 	@${INSTALL_DATA} ${FILESDIR}/20-evdev-kbd.conf \
 		${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
-	${MKDIR} -p ${STAGEDIR}/var/lib/xkb
 .else
 post-install:
 	${RM} -r ${STAGEDIR}${PREFIX}/lib/xorg/protocol.txt
 	${RMDIR} ${STAGEDIR}${PREFIX}/lib/xorg
 	${RM} ${STAGEDIR}${PREFIX}/share/man/man1/Xserver.1
-	${MKDIR} -p ${STAGEDIR}/var/lib/xkb
 .endif
 
 .include <bsd.port.post.mk>
diff --git a/x11-servers/xorg-server/files/patch-xkb_ddxLoad.c b/x11-servers/xorg-server/files/patch-xkb_ddxLoad.c
new file mode 100644
index 000000000000..509c70b6a680
--- /dev/null
+++ b/x11-servers/xorg-server/files/patch-xkb_ddxLoad.c
@@ -0,0 +1,30 @@
+--- xkb/ddxLoad.c.orig	2024-04-03 20:50:12 UTC
++++ xkb/ddxLoad.c
+@@ -31,6 +31,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ #include <xkb-config.h>
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <ctype.h>
+ #include <X11/X.h>
+ #include <X11/Xos.h>
+@@ -70,9 +71,17 @@ OutputDirectory(char *outdir, size_t size)
+     /* Can we write an xkm and then open it too? */
+     if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0) {
+         directory = XKM_OUTPUT_DIR;
+-        if (XKM_OUTPUT_DIR[strlen(XKM_OUTPUT_DIR) - 1] != '/')
+-            pathsep = "/";
++    } else {
++        const char *xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
++
++        if (xdg_runtime_dir && xdg_runtime_dir[0] == '/' &&
++            access(xdg_runtime_dir, W_OK | X_OK) == 0)
++            directory = xdg_runtime_dir;
+     }
++
++    if (directory && directory[strlen(directory) - 1] != '/')
++        pathsep = "/";
++
+ #else
+     directory = Win32TempDir();
+     pathsep = "\\";
diff --git a/x11-servers/xorg-server/pkg-plist b/x11-servers/xorg-server/pkg-plist
index d99baab25f6b..b920012e58ba 100644
--- a/x11-servers/xorg-server/pkg-plist
+++ b/x11-servers/xorg-server/pkg-plist
@@ -189,5 +189,3 @@ share/X11/xorg.conf.d/20-evdev-kbd.conf
 share/aclocal/xorg-server.m4
 @dir etc/X11/xorg.conf.d
 @dir %%FONTPATHD%%
-@dir /var/lib/xkb
-@dir /var/lib



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404101626.43AGQloT012532>