Re: git: 036fb65ae6f0 - main - x11-servers/xlibre-server: New port: Xlibre X server

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Fri, 12 Dec 2025 22:27:37 UTC
And it seems to be unbuildable on non-x86 ARCHes (aarch64 for me)

FAILED: [code=1] hw/xfree86/os-support/libxorg_os_support.a.p/bsd_arm_video.c.o
cc -Ihw/xfree86/os-support/libxorg_os_support.a.p -Ihw/xfree86/os-support -I../hw/xfree86/os-support -I. -I.. -IXext -I../Xext -IXi -I../Xi -Icomposite -I../composite -Idamageext -I../damageex
In file included from ../hw/xfree86/os-support/bsd/arm_video.c:67:
In file included from ../hw/xfree86/common/xf86.h:70:
/usr/local/include/pciaccess.h:63:9: warning: '__deprecated' macro redefined [-Wmacro-redefined]
    63 | #define __deprecated __attribute__((deprecated))
       |         ^
/usr/include/sys/cdefs.h:157:9: note: previous definition is here
   157 | #define __deprecated    __attribute__((__deprecated__))
       |         ^
../hw/xfree86/os-support/bsd/arm_video.c:68:10: fatal error: 'xf86_os_support.' file not found
    68 | #include "xf86_os_support."
       |          ^~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.

On 12.12.2025 04:26, Jose Alonso Cardenas Marquez wrote:
> The branch main has been updated by acm:
> 
> URL: https://cgit.FreeBSD.org/ports/commit/?id=036fb65ae6f04e25e4080371998c042b2c0a0535
> 
> commit 036fb65ae6f04e25e4080371998c042b2c0a0535
> Author:     b-aaz <b-aazbsd@proton.me>
> AuthorDate: 2025-12-12 01:00:05 +0000
> Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
> CommitDate: 2025-12-12 01:26:25 +0000
> 
>      x11-servers/xlibre-server: New port: Xlibre X server
>      
>      This package contains the XLibre X server and some associated programs.
>      
>      See also: https://github.com/X11Libre/xserver
>      
>      Reviewed by:    dtxdf acm
>      Tested by:      dtxdf acm
>      Obtained from:  https://github.com/b-aaz/xlibre-ports
> ---
>   x11-servers/Makefile                               |   1 +
>   x11-servers/xlibre-server/Makefile                 |  54 +++++++
>   x11-servers/xlibre-server/Makefile.common          |  90 +++++++++++
>   x11-servers/xlibre-server/Makefile.version         |   4 +
>   x11-servers/xlibre-server/distinfo                 |   3 +
>   x11-servers/xlibre-server/files/20-evdev-kbd.conf  |   6 +
>   .../xlibre-server/files/patch-config_udev.c        |  56 +++++++
>   .../files/patch-hw_xfree86_compat_ones.c           |  15 ++
>   .../files/patch-hw_xfree86_meson.build             |  11 ++
>   .../patch-hw_xfree86_os-support_bsd_bsd__init.c    |  55 +++++++
>   .../files/patch-hw_xfree86_os-support_meson.build  |  10 ++
>   .../files/patch-hw_xfree86_xorg-wrapper.c          |  23 +++
>   x11-servers/xlibre-server/files/patch-meson.build  |  11 ++
>   x11-servers/xlibre-server/files/patch-os-utils.c   |  18 +++
>   x11-servers/xlibre-server/files/pkg-message.in     |  35 +++++
>   x11-servers/xlibre-server/pkg-descr                |   3 +
>   x11-servers/xlibre-server/pkg-plist                | 174 +++++++++++++++++++++
>   17 files changed, 569 insertions(+)
> 
> diff --git a/x11-servers/Makefile b/x11-servers/Makefile
> index 2942aa453f6b..0640585416a5 100644
> --- a/x11-servers/Makefile
> +++ b/x11-servers/Makefile
> @@ -6,6 +6,7 @@
>       SUBDIR += xarcan
>       SUBDIR += xlibre-ephyr
>       SUBDIR += xlibre-nest
> +    SUBDIR += xlibre-server
>       SUBDIR += xorg-server
>       SUBDIR += xwayland
>   
> diff --git a/x11-servers/xlibre-server/Makefile b/x11-servers/xlibre-server/Makefile
> new file mode 100644
> index 000000000000..829d8dacc862
> --- /dev/null
> +++ b/x11-servers/xlibre-server/Makefile
> @@ -0,0 +1,54 @@
> +PORTNAME=	xlibre-server
> +PORTVERSION=	${XLIBRE_VER}
> +CATEGORIES=	x11-servers
> +
> +MAINTAINER=	b-aazbsd@proton.me
> +COMMENT=	Xlibre X server
> +WWW=		https://github.com/X11Libre/xserver/
> +
> +LICENSE=	MIT
> +
> +CONFLICTS=	xorg-server
> +
> +USES+=		xlibre-cat:server
> +
> +OPTIONS_SUB=	YES
> +OPTIONS_DEFINE=	UDEV SUID
> +OPTIONS_DEFAULT=UDEV SUID
> +
> +UDEV_DESC= Enable udev (For libinput & autoconfiguration/hotplug).
> +UDEV_MESON_ON=	-Dudev=true -Dudev_kms=true
> +UDEV_MESON_OFF=	-Dudev=false -Dudev_kms=false
> +UDEV_LIB_DEPENDS=	libudev.so:devel/libudev-devd
> +
> +SUID_DESC= Enable the setuid binary (For starting X as a normal user).
> +SUID_MESON_ON=		-Dsuid_wrapper=true
> +SUID_MESON_OFF=		-Dsuid_wrapper=false
> +
> +LIB_DEPENDS+=	libxcvt.so:x11/libxcvt \
> +		libdrm.so:graphics/libdrm \
> +		libepoxy.so:graphics/libepoxy \
> +		libepoll-shim.so:devel/libepoll-shim
> +
> +MESON_ARGS+=	-Dlog_dir=/var/log \
> +		-Ddrm=true
> +
> +PLIST_SUB+=	FONTPATHD="${FONTPATHD:S,^${PREFIX}/,,}"
> +
> +USE_XORG+=	pciaccess
> +
> +USE_GL+=	gbm
> +
> +.include "../xlibre-server/Makefile.common"
> +
> +OLDMODULEDIR=	/lib/xorg/modules
> +post-install:
> +	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
> +	@${MKDIR} ${STAGEDIR}${PREFIX}${OLDMODULEDIR}/extensions
> +	@${MKDIR} ${STAGEDIR}${PREFIX}${OLDMODULEDIR}/drivers
> +	@${MKDIR} ${STAGEDIR}${PREFIX}${OLDMODULEDIR}/input
> +	@${MKDIR} ${STAGEDIR}${FONTPATHD}
> +	@${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
> +	@${INSTALL_DATA} ${FILESDIR}/20-evdev-kbd.conf \
> +		${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
> +.include <bsd.port.post.mk>
> diff --git a/x11-servers/xlibre-server/Makefile.common b/x11-servers/xlibre-server/Makefile.common
> new file mode 100644
> index 000000000000..60f301137b51
> --- /dev/null
> +++ b/x11-servers/xlibre-server/Makefile.common
> @@ -0,0 +1,90 @@
> +_XMASTERDIR_REL=../xlibre-server/
> +XMASTERDIR=	${_XMASTERDIR_REL:tA}
> +PATCHDIR?=	${XMASTERDIR}/files
> +DISTINFO_FILE?=	${XMASTERDIR}/distinfo
> +
> +.include "${XMASTERDIR}/Makefile.version"
> +
> +
> +USES+=		gl compiler:c11 meson pkgconfig tar:xz xorg
> +USE_GL+=	gl
> +USE_XORG+=	pixman xau xdmcp xfont2 xkbfile xorgproto xshmfence xtrans
> +
> +OPTIONS_DEFINE+=LIBUNWIND
> +OPTIONS_DEFAULT+=LIBUNWIND
> +LIBUNWIND_DESC= Enable libunwind for better stack traces in case of an error.
> +
> +SERVERS=	xorg xnest xephyr xvfb
> +SERVERNAME=	${PORTNAME:S/^xlibre-/x/:S/xserver/xorg/}
> +
> +BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
> +RUN_DEPENDS+=	xkeyboard-config>=2.5:x11/xkeyboard-config \
> +		xkbcomp:x11/xkbcomp \
> +		${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
> +
> +MESON_ARGS+=	-Dxwin=false \
> +		-Dxquartz=false \
> +		-Ddtrace=false \
> +		-Dhal=false \
> +		-Dsystemd_logind=false \
> +		-Dxselinux=false \
> +		-Dfallback_input_driver=libinput \
> +		-Ddocs=false \
> +		-Dxcsecurity=true
> +MESON_ARGS+=	-D${SERVERNAME}=true
> +
> +.for f in ${SERVERS:N${SERVERNAME}}
> +MESON_ARGS+=	-D${f}=false
> +.endfor
> +
> +FONTPATH_ROOT?=	${LOCALBASE}/share/fonts
> +FONTPATHD?=	${PREFIX}/etc/X11/fontpath.d
> +DEFAULT_FONTPATH_LIST= \
> +	${FONTPATH_ROOT}/misc/	\
> +	${FONTPATH_ROOT}/TTF/ \
> +	${FONTPATH_ROOT}/OTF/ \
> +	${FONTPATH_ROOT}/Type1/ \
> +	${FONTPATH_ROOT}/100dpi/ \
> +	${FONTPATH_ROOT}/75dpi/ \
> +	catalogue:${FONTPATHD}
> +MESON_ARGS+=	-Ddefault_font_path=${DEFAULT_FONTPATH_LIST:ts,}
> +
> +
> +# Non X server common flags
> +.if ${SERVERNAME} != xorg
> +MESON_ARGS+=	-Dudev=false \
> +		-Dudev_kms=false
> +PLIST=
> +PKGMESSAGE=
> +BINARY_NAME=	${SERVERNAME:C/^(.).*/\1/:tu}${SERVERNAME:C/^.//}
> +PLIST_FILES=	bin/${BINARY_NAME} \
> +		share/man/man1/${BINARY_NAME}.1.gz
> +.endif
> +
> +.include <bsd.port.pre.mk>
> +.if ${OPSYS}==FreeBSD
> +AMD64=amd64
> +.else
> +AMD64=x86_64
> +.endif
> +
> +.if ${PORT_OPTIONS:MLIBUNWIND}
> +.  if ${ARCH} == aarch64 || ${ARCH} == ${AMD64} || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le
> +LIB_DEPENDS+=	libunwind.so:devel/libunwind
> +MESON_ARGS+=	-Dlibunwind=true
> +.  endif
> +.else
> +MESON_ARGS+=	-Dlibunwind=false
> +.endif
> +
> +.if ${OPSYS} == FreeBSD
> +MESON_ARGS+=	-Dsha1=libmd
> +.endif
> +
> +.if ${SERVERNAME} != xorg
> +post-install:
> +	${RM} -r ${STAGEDIR}${PREFIX}/lib/xorg/protocol.txt
> +	${RMDIR} ${STAGEDIR}${PREFIX}/lib/xorg
> +	${RM} ${STAGEDIR}${PREFIX}/share/man/man1/Xserver.1
> +.include <bsd.port.post.mk>
> +.endif
> diff --git a/x11-servers/xlibre-server/Makefile.version b/x11-servers/xlibre-server/Makefile.version
> new file mode 100644
> index 000000000000..762f9dcca745
> --- /dev/null
> +++ b/x11-servers/xlibre-server/Makefile.version
> @@ -0,0 +1,4 @@
> +XLIBRE_MJR_VER=25.0
> +XLIBRE_MIN_VER=0.16
> +
> +XLIBRE_VER=${XLIBRE_MJR_VER}.${XLIBRE_MIN_VER}
> diff --git a/x11-servers/xlibre-server/distinfo b/x11-servers/xlibre-server/distinfo
> new file mode 100644
> index 000000000000..9e7aa077a41f
> --- /dev/null
> +++ b/x11-servers/xlibre-server/distinfo
> @@ -0,0 +1,3 @@
> +TIMESTAMP = 1763716462
> +SHA256 (xlibre/server/X11Libre-xserver-25.0.0.16-xlibre-xserver-25.0.0.16_GH0.tar.gz) = 0187e57331daefa75ddc33a4f878ef4c08526b83dc91dbc51a25375d2ff33b8c
> +SIZE (xlibre/server/X11Libre-xserver-25.0.0.16-xlibre-xserver-25.0.0.16_GH0.tar.gz) = 5415775
> diff --git a/x11-servers/xlibre-server/files/20-evdev-kbd.conf b/x11-servers/xlibre-server/files/20-evdev-kbd.conf
> new file mode 100644
> index 000000000000..7a73fb641c36
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/20-evdev-kbd.conf
> @@ -0,0 +1,6 @@
> +Section "InputClass"
> +	Identifier		"Evdev keyboard"
> +	MatchDevicePath		"/dev/input/event*"
> +	MatchIsKeyboard		"on"
> +	Option			"XkbRules" "evdev"
> +EndSection
> diff --git a/x11-servers/xlibre-server/files/patch-config_udev.c b/x11-servers/xlibre-server/files/patch-config_udev.c
> new file mode 100644
> index 000000000000..38b3e84db5ad
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-config_udev.c
> @@ -0,0 +1,56 @@
> +* Don't pass the device parameter when using kbdmux to prevent conflict
> +*
> +* Specify a driver to use for basic devices (keyboard and mouse), otherwise none attaches
> +*
> +--- config/udev.c.orig	2017-03-15 18:05:25 UTC
> ++++ config/udev.c
> +@@ -29,6 +29,7 @@
> +
> + #include <libudev.h>
> + #include <ctype.h>
> ++#include <fcntl.h>
> + #include <unistd.h>
> +
> + #include "input.h"
> +@@ -188,7 +189,21 @@ device_added(struct udev_device *udev_de
> +         attrs.product = strdup(name);
> +     input_options = input_option_new(input_options, "name", name);
> +     input_options = input_option_new(input_options, "path", path);
> +-    input_options = input_option_new(input_options, "device", path);
> ++    if(strstr(path, "kbdmux") != NULL) {
> ++        /*
> ++         * Don't pass "device" option if the keyboard is already attached
> ++         * to the console (ie. open() fails). This would activate a special
> ++         * logic in xf86-input-keyboard. Prevent any other attached to console
> ++         * keyboards being processed. There can be only one such device.
> ++         */
> ++        int fd = open(path, O_RDONLY);
> ++        if (fd > -1) {
> ++            close(fd);
> ++            input_options = input_option_new(input_options, "device", path);
> ++        }
> ++    }
> ++    else
> ++        input_options = input_option_new(input_options, "device", path);
> +     input_options = input_option_new(input_options, "major", itoa(major(devnum)));
> +     input_options = input_option_new(input_options, "minor", itoa(minor(devnum)));
> +     if (path)
> +@@ -272,6 +287,18 @@ device_added(struct udev_device *udev_de
> +         }
> +     }
> +
> ++    if (attrs.flags & (ATTR_KEY | ATTR_KEYBOARD)) {
> ++        if (!feature_present("evdev_support"))
> ++            input_options = input_option_new(input_options, "driver", "kbd");
> ++    } else if (attrs.flags & ATTR_POINTER) {
> ++        if (strstr(path, "vbox"))
> ++            input_options = input_option_new(input_options, "driver", "vboxmouse");
> ++        else {
> ++            if (!feature_present("evdev_support"))
> ++                input_options = input_option_new(input_options, "driver", "mouse");
> ++        }
> ++    }
> ++
> +     input_options = input_option_new(input_options, "config_info", config_info);
> +
> +     /* Default setting needed for non-seat0 seats */
> diff --git a/x11-servers/xlibre-server/files/patch-hw_xfree86_compat_ones.c b/x11-servers/xlibre-server/files/patch-hw_xfree86_compat_ones.c
> new file mode 100644
> index 000000000000..1a296ff48141
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-hw_xfree86_compat_ones.c
> @@ -0,0 +1,15 @@
> +--- hw/xfree86/compat/ones.c.orig
> ++++ hw/xfree86/compat/ones.c
> +@@ -20,8 +20,12 @@ int
> + Ones(unsigned long mask)
> + {                               /* HACKMEM 169 */
> +     /* can't add a message here because this should be fast */
> ++#if defined __has_builtin
> + #if __has_builtin(__builtin_popcountl)
> +     return __builtin_popcountl (mask);
> ++#endif
> ++#elif defined __builtin_popcountl
> ++    return __builtin_popcountl (mask);
> + #else
> +     unsigned long y;
> +
> diff --git a/x11-servers/xlibre-server/files/patch-hw_xfree86_meson.build b/x11-servers/xlibre-server/files/patch-hw_xfree86_meson.build
> new file mode 100644
> index 000000000000..5b5e9e9bc038
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-hw_xfree86_meson.build
> @@ -0,0 +1,11 @@
> +--- hw/xfree86/meson.build.orig	2022-06-29 14:37:28.042085000 +0000
> ++++ hw/xfree86/meson.build	2022-06-29 14:37:36.259147000 +0000
> +@@ -152,7 +152,7 @@ if get_option('suid_wrapper')
> +         c_args: xorg_c_args,
> +         install: true,
> +         install_dir: get_option('libexecdir'),
> +-        install_mode: ['r-sr-xr-x', 0, 0],
> ++        #    install_mode: ['r-sr-xr-x', 0, 0],
> +     )
> +
> +     # meson gets confused when there are two targets of the same name
> diff --git a/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c b/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c
> new file mode 100644
> index 000000000000..54bedf2a4c75
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c
> @@ -0,0 +1,55 @@
> +--- hw/xfree86/os-support/bsd/bsd_init.c.orig	2023-10-25 01:40:28 UTC
> ++++ hw/xfree86/os-support/bsd/bsd_init.c
> +@@ -48,6 +48,8 @@ static int initialVT = -1;
> + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
> + static int VTnum = -1;
> + static int initialVT = -1;
> ++static struct termios tty_attr;	/* tty state to restore */
> ++static int tty_mode;		/* kbd mode to restore */
> + #endif
> +
> + #ifdef PCCONS_SUPPORT
> +@@ -253,6 +255,7 @@ xf86OpenConsole()
> + #endif
> +  acquire_vt:
> +             if (!xf86Info.ShareVTs) {
> ++                struct termios nTty;
> +                 /*
> +                  * now get the VT
> +                  */
> +@@ -287,6 +290,26 @@ xf86OpenConsole()
> +                 if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) {
> +                     FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
> +                 }
> ++
> ++                tcgetattr(xf86Info.consoleFd, &tty_attr);
> ++                ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
> ++
> ++                /* disable special keys */
> ++                if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0) {
> ++                    FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed (%s)",
> ++                               strerror(errno));
> ++                }
> ++
> ++                nTty = tty_attr;
> ++                nTty.c_iflag = IGNPAR | IGNBRK;
> ++                nTty.c_oflag = 0;
> ++                nTty.c_cflag = CREAD | CS8;
> ++                nTty.c_lflag = 0;
> ++                nTty.c_cc[VTIME] = 0;
> ++                nTty.c_cc[VMIN] = 1;
> ++                cfsetispeed(&nTty, 9600);
> ++                cfsetospeed(&nTty, 9600);
> ++                tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
> +             }
> +             else {              /* xf86Info.ShareVTs */
> +                 close(xf86Info.consoleFd);
> +@@ -594,6 +617,8 @@ xf86CloseConsole()
> +     case SYSCONS:
> +     case PCVT:
> +         ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);  /* Back to text mode */
> ++        ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
> ++        tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
> +         if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) {
> +             VT.mode = VT_AUTO;
> +             ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */
> diff --git a/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_meson.build b/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_meson.build
> new file mode 100644
> index 000000000000..24b04eec83ec
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-hw_xfree86_os-support_meson.build
> @@ -0,0 +1,10 @@
> +--- hw/xfree86/os-support/meson.build.orig	2025-07-20 14:22:32 UTC
> ++++ hw/xfree86/os-support/meson.build
> +@@ -98,6 +98,7 @@ elif host_machine.system().endswith('bsd')
> +         'bsd/bsd_bell.c',
> +         'bsd/bsd_init.c',
> +         'shared/drm_platform.c',
> ++        'misc/SlowBcopy.c',
> + 	'shared/pm_noop.c'
> +     ]
> +
> diff --git a/x11-servers/xlibre-server/files/patch-hw_xfree86_xorg-wrapper.c b/x11-servers/xlibre-server/files/patch-hw_xfree86_xorg-wrapper.c
> new file mode 100644
> index 000000000000..9a4327eff91f
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-hw_xfree86_xorg-wrapper.c
> @@ -0,0 +1,23 @@
> +* Skip the detection of root rights requirement, the assumption that presence
> +* of KMS drivers removes the root requirement is only valid for Linux
> +*
> +--- hw/xfree86/xorg-wrapper.c.orig	2022-01-02 23:41:56.000000000 +0100
> ++++ hw/xfree86/xorg-wrapper.c	2022-06-29 16:28:24.797008000 +0200
> +@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
> +
> + int main(int argc, char *argv[])
> + {
> +-#ifdef WITH_LIBDRM
> ++#if defined(WITH_LIBDRM) && defined(__linux__)
> +     struct drm_mode_card_res res;
> + #endif
> +     char buf[PATH_MAX];
> +@@ -230,7 +230,7 @@ int main(int argc, char *argv[])
> +         }
> +     }
> +
> +-#ifdef WITH_LIBDRM
> ++#if defined(WITH_LIBDRM) && defined(__linux__)
> +     /* Detect if we need root rights, except when overridden by the config */
> +     if (needs_root_rights == -1) {
> +         for (i = 0; i < 16; i++) {
> diff --git a/x11-servers/xlibre-server/files/patch-meson.build b/x11-servers/xlibre-server/files/patch-meson.build
> new file mode 100644
> index 000000000000..f933599bfac2
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-meson.build
> @@ -0,0 +1,11 @@
> +--- meson.build.orig	2025-09-16 15:49:48 UTC
> ++++ meson.build
> +@@ -456,7 +456,7 @@ else
> +     build_dri2 = get_option('dri2') == 'true'
> + endif
> +
> +-if host_machine.system() in ['freebsd', 'openbsd']
> ++if host_machine.system() in ['dragonfly', 'freebsd', 'openbsd']
> +    epoll_dep = dependency('epoll-shim')
> + else
> +    epoll_dep = []
> diff --git a/x11-servers/xlibre-server/files/patch-os-utils.c b/x11-servers/xlibre-server/files/patch-os-utils.c
> new file mode 100644
> index 000000000000..8f9c4f1f137d
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/patch-os-utils.c
> @@ -0,0 +1,18 @@
> +--- os/utils.c.orig	2014-04-15 01:01:57 UTC
> ++++ os/utils.c
> +@@ -443,11 +443,11 @@ GetTimeInMillis(void)
> +     static clockid_t clockid;
> +
> +     if (!clockid) {
> +-#ifdef CLOCK_MONOTONIC_COARSE
> +-        if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
> ++#ifdef CLOCK_MONOTONIC_FAST
> ++        if (clock_getres(CLOCK_MONOTONIC_FAST, &tp) == 0 &&
> +             (tp.tv_nsec / 1000) <= 1000 &&
> +-            clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
> +-            clockid = CLOCK_MONOTONIC_COARSE;
> ++            clock_gettime(CLOCK_MONOTONIC_FAST, &tp) == 0)
> ++            clockid = CLOCK_MONOTONIC_FAST;
> +         else
> + #endif
> +         if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
> diff --git a/x11-servers/xlibre-server/files/pkg-message.in b/x11-servers/xlibre-server/files/pkg-message.in
> new file mode 100644
> index 000000000000..07198f4e1924
> --- /dev/null
> +++ b/x11-servers/xlibre-server/files/pkg-message.in
> @@ -0,0 +1,35 @@
> +[
> +{ type: install
> +  message: <<EOM
> +XLibre-server has been installed.
> +
> +If your kernel is compiled with the EVDEV_SUPPORT option enabled
> +(default starting from FreeBSD 12.1) it is recommended to enable evdev mode in
> +pointer device drivers like ums(4) and psm(4). This will give improvements like
> +better tilt wheel support for mice and centralized gesture support via
> +xf86-input-synaptics or libinput drivers for touchpads.
> +
> +This is also needed for PS/2 devices to be properly detected by XLibre when
> +moused service is disabled in /etc/rc.conf and kernel is compiled with
> +EVDEV_SUPPORT.
> +
> +To enable evdev in such a device, run the following:
> +
> +# sysctl kern.evdev.rcpt_mask=6
> +
> +To make it persistent across reboots, add the following to /etc/sysctl.conf:
> +
> +kern.evdev.rcpt_mask=6
> +
> +In case you're using a serial mouse or any other mouse that *only* works over
> +sysmouse(4) and moused(8) on an evdev enabled kernel, please run this:
> +
> +# sysctl kern.evdev.rcpt_mask=3
> +
> +To make it persistent across reboots, add to this /etc/sysctl.conf:
> +
> +kern.evdev.rcpt_mask=3
> +
> +EOM
> +}
> +]
> diff --git a/x11-servers/xlibre-server/pkg-descr b/x11-servers/xlibre-server/pkg-descr
> new file mode 100644
> index 000000000000..6165e40db316
> --- /dev/null
> +++ b/x11-servers/xlibre-server/pkg-descr
> @@ -0,0 +1,3 @@
> +This package contains the XLibre X server and some associated programs.
> +
> +See also: https://github.com/X11Libre/xserver
> diff --git a/x11-servers/xlibre-server/pkg-plist b/x11-servers/xlibre-server/pkg-plist
> new file mode 100644
> index 000000000000..1dec48a8741b
> --- /dev/null
> +++ b/x11-servers/xlibre-server/pkg-plist
> @@ -0,0 +1,174 @@
> +bin/X
> +bin/Xorg
> +bin/gtf
> +include/xorg/Xprintf.h
> +include/xorg/callback.h
> +include/xorg/client.h
> +include/xorg/closure.h
> +include/xorg/colormap.h
> +include/xorg/colormapst.h
> +include/xorg/compiler.h
> +include/xorg/compositeext.h
> +include/xorg/cursor.h
> +include/xorg/cursorstr.h
> +include/xorg/damage.h
> +include/xorg/damagestr.h
> +include/xorg/dgaproc.h
> +include/xorg/displaymode.h
> +include/xorg/dix.h
> +include/xorg/dixaccess.h
> +include/xorg/dixfont.h
> +include/xorg/dixfontstr.h
> +include/xorg/dixstruct.h
> +include/xorg/dri.h
> +include/xorg/dri2.h
> +include/xorg/dri3.h
> +include/xorg/dristruct.h
> +include/xorg/edid.h
> +include/xorg/events.h
> +include/xorg/exa.h
> +include/xorg/exevents.h
> +include/xorg/extension.h
> +include/xorg/extinit.h
> +include/xorg/extnsionst.h
> +include/xorg/fb.h
> +include/xorg/fbdevhw.h
> +include/xorg/fboverlay.h
> +include/xorg/fbpict.h
> +include/xorg/fbrop.h
> +include/xorg/fd_notify.h
> +include/xorg/fourcc.h
> +include/xorg/gc.h
> +include/xorg/gcstruct.h
> +include/xorg/glamor.h
> +include/xorg/globals.h
> +include/xorg/glxvndabi.h
> +include/xorg/glyphstr.h
> +include/xorg/hotplug.h
> +include/xorg/i2c_def.h
> +include/xorg/input.h
> +include/xorg/inputstr.h
> +include/xorg/list.h
> +include/xorg/mi.h
> +include/xorg/micmap.h
> +include/xorg/micoord.h
> +include/xorg/migc.h
> +include/xorg/miline.h
> +include/xorg/mioverlay.h
> +include/xorg/mipict.h
> +include/xorg/mipointer.h
> +include/xorg/mipointrst.h
> +include/xorg/misc.h
> +include/xorg/miscstruct.h
> +include/xorg/mistruct.h
> +include/xorg/misync.h
> +include/xorg/misyncfd.h
> +include/xorg/misyncshm.h
> +include/xorg/misyncstr.h
> +include/xorg/mizerarc.h
> +include/xorg/nonsdk_extinit.h
> +include/xorg/opaque.h
> +include/xorg/optionstr.h
> +include/xorg/os.h
> +include/xorg/picture.h
> +include/xorg/picturestr.h
> +include/xorg/pixmap.h
> +include/xorg/pixmapstr.h
> +include/xorg/present.h
> +include/xorg/privates.h
> +include/xorg/property.h
> +include/xorg/ptrveloc.h
> +include/xorg/randrstr.h
> +include/xorg/region.h
> +include/xorg/regionstr.h
> +include/xorg/resource.h
> +include/xorg/rgb.h
> +include/xorg/rrtransform.h
> +include/xorg/sarea.h
> +include/xorg/screenint.h
> +include/xorg/scrnintstr.h
> +include/xorg/servermd.h
> +include/xorg/shadow.h
> +include/xorg/shadowfb.h
> +include/xorg/shmint.h
> +include/xorg/syncsdk.h
> +include/xorg/validate.h
> +include/xorg/vbe.h
> +include/xorg/vbeModes.h
> +include/xorg/vgaHW.h
> +include/xorg/vndserver.h
> +include/xorg/wfbrename.h
> +include/xorg/window.h
> +include/xorg/windowstr.h
> +include/xorg/xaarop.h
> +include/xorg/xf86-input-inputtest-protocol.h
> +include/xorg/xf86.h
> +include/xorg/xf86Crtc.h
> +include/xorg/xf86Cursor.h
> +include/xorg/xf86DDC.h
> +include/xorg/xf86Modes.h
> +include/xorg/xf86Module.h
> +include/xorg/xf86Opt.h
> +include/xorg/xf86Optionstr.h
> +include/xorg/xf86Optrec.h
> +include/xorg/xf86Parser.h
> +include/xorg/xf86Pci.h
> +include/xorg/xf86PciInfo.h
> +include/xorg/xf86Priv.h
> +include/xorg/xf86Privstr.h
> +include/xorg/xf86RandR12.h
> +include/xorg/xf86Xinput.h
> +include/xorg/xf86_OSlib.h
> +include/xorg/xf86_OSproc.h
> +include/xorg/xf86cmap.h
> +include/xorg/xf86fbman.h
> +include/xorg/xf86i2c.h
> +include/xorg/xf86int10.h
> +include/xorg/xf86platformBus.h
> +include/xorg/xf86sbusBus.h
> +include/xorg/xf86str.h
> +include/xorg/xf86xv.h
> +include/xorg/xf86xvmc.h
> +include/xorg/xisb.h
> +include/xorg/xkbrules.h
> +include/xorg/xkbsrv.h
> +include/xorg/xkbstr.h
> +include/xorg/xorg-server.h
> +include/xorg/xorgVersion.h
> +include/xorg/xserver-properties.h
> +include/xorg/xvdix.h
> +include/xorg/xvmcext.h
> +lib/xorg/modules/xlibre-25.0/drivers/modesetting_drv.so
> +lib/xorg/modules/xlibre-25.0/extensions/libglx.so
> +lib/xorg/modules/xlibre-25.0/input/inputtest_drv.so
> +lib/xorg/modules/xlibre-25.0/libexa.so
> +lib/xorg/modules/xlibre-25.0/libfbdevhw.so
> +lib/xorg/modules/xlibre-25.0/libglamoregl.so
> +lib/xorg/modules/xlibre-25.0/libint10.so
> +lib/xorg/modules/xlibre-25.0/libshadow.so
> +lib/xorg/modules/xlibre-25.0/libshadowfb.so
> +lib/xorg/modules/xlibre-25.0/libvgahw.so
> +lib/xorg/modules/xlibre-25.0/libwfb.so
> +lib/xorg/protocol.txt
> +libdata/pkgconfig/xorg-server.pc
> +%%SUID%%libexec/Xorg
> +%%SUID%%@(,,4555) libexec/Xorg.wrap
> +%%UDEV%%share/X11/xorg.conf.d/10-quirks.conf
> +share/X11/xorg.conf.d/20-evdev-kbd.conf
> +share/aclocal/xorg-server.m4
> +share/man/man1/Xorg.1.gz
> +%%SUID%%share/man/man1/Xorg.wrap.1.gz
> +share/man/man1/Xserver.1.gz
> +share/man/man1/gtf.1.gz
> +share/man/man4/exa.4.gz
> +share/man/man4/fbdevhw.4.gz
> +share/man/man4/inputtestdrv.4.gz
> +share/man/man4/modesetting.4.gz
> +%%SUID%%share/man/man5/Xwrapper.config.5.gz
> +share/man/man5/xorg.conf.5.gz
> +share/man/man5/xorg.conf.d.5.gz
> +@dir %%FONTPATHD%%
> +@dir etc/X11/xorg.conf.d
> +@dir lib/xorg/modules/drivers
> +@dir lib/xorg/modules/input
> +@dir lib/xorg/modules/extensions
> 

-- 
Sincerely,
Dima (fluffy@FreeBSD.org, https://t.me/FluffyBSD, @fluffy:matrix-dev.freebsd.org)
(desktop, kde, x11, office, ports-secteam)@FreeBSD team