diff --git a/x11-servers/xorg-server/Makefile b/x11-servers/xorg-server/Makefile index 089fe72c7c99..7903e64aa44c 100644 --- a/x11-servers/xorg-server/Makefile +++ b/x11-servers/xorg-server/Makefile @@ -1,147 +1,147 @@ PORTNAME= xorg PORTVERSION= 21.1.8 -PORTREVISION= 5 +PORTREVISION= 6 PORTEPOCH= 1 CATEGORIES= x11-servers MASTER_SITES= XORG/individual/xserver DISTNAME= xorg-server-${PORTVERSION} MAINTAINER= x11@FreeBSD.org COMMENT= X.Org X server and related programs WWW= https://www.freedesktop.org/Software/xorg LICENSE= MIT FLAVORS= xorg xnest xephyr xvfb FLAVOR?= ${FLAVORS:[1]} EXTRA_PATCHES= ${FILESDIR}/0002-xephyr_Dont_check_for_SeatId_anymore.patch:-p1 USES= compiler:c11 cpe gl meson pkgconfig tar:xz xorg USE_GL= gl .if ${FLAVOR} == xephyr PORTNAME= xephyr .elif ${FLAVOR} == xorg PKGNAMESUFFIX= -server .elif ${FLAVOR} == xnest PORTEPOCH= 2 PKGNAMESUFFIX= -nestserver .elif ${FLAVOR} == xvfb PKGNAMESUFFIX= -vfbserver .endif .if ${FLAVOR} != xorg PLIST= PKGMESSAGE= BINARY_NAME= ${FLAVOR:C/^(.).*/\1/:tu}${FLAVOR:C/^.//} PLIST_FILES= bin/${BINARY_NAME} \ man/man1/${BINARY_NAME}.1.gz PLIST_DIRS= /var/lib/xkb /var/lib .endif DESCR= ${.CURDIR}/pkg-descr-${FLAVOR} 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 \ -Dxkb_dir=${LOCALBASE}/share/X11/xkb \ -Dxkb_output_dir=/var/lib/xkb \ -D${FLAVOR}=true .for f in ${FLAVORS:N${FLAVOR}} MESON_ARGS+= -D${f}=false .endfor .if ${FLAVOR} == xorg LIB_DEPENDS+= libudev.so:devel/libudev-devd \ libxcvt.so:x11/libxcvt MESON_ARGS+= -Dudev=true \ -Dudev_kms=true \ -Dlog_dir=/var/log \ -Dsuid_wrapper=true .else MESON_ARGS+= -Dudev=false \ -Dudev_kms=false .endif .if ${FLAVOR} == xorg || ${FLAVOR} == xephyr MESON_ARGS+= -Ddrm=true LIB_DEPENDS+= libdrm.so:graphics/libdrm \ libepoxy.so:graphics/libepoxy .endif .if ${FLAVOR} == xephyr LIB_DEPENDS+= libxcb-render-util.so:x11/xcb-util-renderutil \ libxcb-image.so:x11/xcb-util-image \ libxcb-icccm.so:x11/xcb-util-wm \ libxcb-keysyms.so:x11/xcb-util-keysyms .endif 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,} PLIST_SUB+= FONTPATHD="${FONTPATHD:S,^${PREFIX}/,,}" USE_GL+= gl USE_XORG+= pixman xau xdmcp xfont2 xkbfile xorgproto xshmfence xtrans CPE_VENDOR= x.org CPE_PRODUCT= xorg-server .if ${FLAVOR} == xorg USE_GL+= gbm USE_XORG+= pciaccess .endif .include .if ${OPSYS} == FreeBSD MESON_ARGS+= -Dsha1=libmd .endif .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le LIB_DEPENDS+= libunwind.so:devel/libunwind .endif .if ${ARCH} == "sparc64" PLIST_SUB+= SPARC64="" .else PLIST_SUB+= SPARC64="@comment " .endif .if ${FLAVOR} == xorg post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d @${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 ${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}/man/man1/Xserver.1 ${MKDIR} -p ${STAGEDIR}/var/lib/xkb .endif .include diff --git a/x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c b/x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c index 011f3becc26f..09ab0b818b37 100644 --- a/x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c +++ b/x11-servers/xorg-server/files/patch-hw_xfree86_os-support_bsd_bsd__init.c @@ -1,65 +1,83 @@ ---- hw/xfree86/os-support/bsd/bsd_init.c.orig 2022-01-02 23:41:56.000000000 +0100 -+++ hw/xfree86/os-support/bsd/bsd_init.c 2022-06-29 11:57:25.596851000 +0200 +--- hw/xfree86/os-support/bsd/bsd_init.c.orig 2023-03-29 12:55:03 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 @@ -230,6 +232,9 @@ xf86OpenConsole() * Add cases for other *BSD that behave the same. */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if defined(__sparc64__) + pci_system_init_dev_mem(fd); +#endif uname(&uts); i = atof(uts.release) * 100; if (i >= 310) @@ -253,6 +258,7 @@ xf86OpenConsole() #endif acquire_vt: if (!xf86Info.ShareVTs) { + struct termios nTty; /* * now get the VT */ @@ -287,6 +293,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); +@@ -303,7 +329,7 @@ xf86OpenConsole() + else { + /* serverGeneration != 1 */ + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) +- if (!xf86Info.ShareVTs && ++ if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch && + (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)) { + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0) { + xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); @@ -594,6 +620,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 */ +@@ -604,7 +632,7 @@ xf86CloseConsole() + strerror(errno)); + } + #endif +- if (initialVT != -1) ++ if (xf86Info.autoVTSwitch && initialVT != -1) + ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT); + break; + #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */