Changeset View
Standalone View
x11-servers/xorg-server/Makefile
# Created by: Eric Anholt <anholt@FreeBSD.org> | # Created by: Eric Anholt <anholt@FreeBSD.org> | ||||
PORTNAME?= xorg-server | PORTNAME?= xorg | ||||
PORTVERSION?= 1.20.14 | PORTVERSION?= 21.1.3 | ||||
PORTREVISION?= 0 | PORTREVISION?= 0 | ||||
PORTEPOCH?= 1 | PORTEPOCH?= 1 | ||||
CATEGORIES= x11-servers | CATEGORIES= x11-servers | ||||
jbeich: 21.1.3 (unlike 21.1.4) is vulnerable to CVE-2022-2319 + CVE-2022-2320 | |||||
MASTER_SITES= XORG/individual/xserver | MASTER_SITES= XORG/individual/xserver | ||||
DISTNAME= xorg-server-${PORTVERSION} | DISTNAME= xorg-server-${PORTVERSION} | ||||
MAINTAINER= x11@FreeBSD.org | MAINTAINER= x11@FreeBSD.org | ||||
COMMENT?= X.Org X server and related programs | COMMENT?= X.Org X server and related programs | ||||
LICENSE= MIT | LICENSE= MIT | ||||
FLAVORS= xorg Xnest Xephyr Xvfb | |||||
Done Inline Actionscheck-sanity balks at the capitalised flavours, had to lowercase them when testporting or bulk -t vishwin: `check-sanity` balks at the capitalised flavours, had to lowercase them when `testport`ing or… | |||||
FLAVOR?= ${FLAVORS:[1]} | |||||
EXTRA_PATCHES= ${FILESDIR}/0001-xkb-fix-XkbSetMap-when-changing-a-keysym-without-cha.patch:-p1 \ | |||||
${FILESDIR}/0003-dix_Correctly_save_replayed_event_into_GrabInfoRec.patch:-p1 \ | |||||
${FILESDIR}/0002-xephyr_Dont_check_for_SeatId_anymore.patch:-p1 \ | |||||
${FILESDIR}/0004-present_Check_for_NULL_to_prevent_crash.patch:-p1 | |||||
USES= compiler:c11 cpe gl meson pkgconfig ssl tar:xz xorg | |||||
USE_GL+= gl | |||||
.if ${FLAVOR} == Xephyr | |||||
Done Inline Actions^ below you have xephyr not Xephyr (line 87) tcberner: ^ below you have `xephyr` not `Xephyr` (line 87) | |||||
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= | |||||
PLIST_FILES= bin/${FLAVOR} \ | |||||
man/man1/${FLAVOR}.1.gz | |||||
PLIST_DIRS= /var/db/xkb | |||||
.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 \ | RUN_DEPENDS+= xkeyboard-config>=2.5:x11/xkeyboard-config \ | ||||
xkbcomp:x11/xkbcomp | xkbcomp:x11/xkbcomp | ||||
SLAVE_PORT?= no | MESON_ARGS+= -Dxwin=false \ | ||||
-Dxquartz=false \ | |||||
-Ddtrace=false \ | |||||
-Dhal=false \ | |||||
-Dsystemd_logind=false \ | |||||
-Dxselinux=false \ | |||||
-Dfallback_input_driver=libinput \ | |||||
-Ddocs=false \ | |||||
-Dudev_kms=false \ | |||||
-Dxcsecurity=true \ | |||||
-Dsha1=libmd \ | |||||
-Dxkb_dir=${LOCALBASE}/share/X11/xkb \ | |||||
-Dxkb_output_dir=/var/db/xkb \ | |||||
-D${FLAVOR:tl}=true | |||||
.for f in ${FLAVORS:N${FLAVOR}} | |||||
MESON_ARGS+= -D${f:tl}=false | |||||
.endfor | |||||
.if ${FLAVOR} == xorg | |||||
LIB_DEPENDS+= libudev.so:devel/libudev-devd \ | |||||
libxcvt.so:x11/libxcvt | |||||
MESON_ARGS+= -Dudev=true | |||||
Done Inline ActionsNeed to add a -Dlog_dir=/var/log else the default system log location is /var/local/log vishwin: Need to add a `-Dlog_dir=/var/log` else the default system log location is `/var/local/log` | |||||
Done Inline Actionsping, because we don't have /var/local/log vishwin: ping, because we don't have `/var/local/log` | |||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
OPTIONS_DEFINE+= SUID | OPTIONS_DEFINE+= SUID | ||||
OPTIONS_RADIO= CONF | |||||
OPTIONS_RADIO_CONF= DEVD UDEV | |||||
OPTIONS_DEFAULT= SUID UDEV | |||||
OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}} | |||||
SUID_DESC= Install setuid wrapper to allow startx as non-root | SUID_DESC= Install setuid wrapper to allow startx as non-root | ||||
CONF_DESC= Backend to use for input device configuration | |||||
DEVD_DESC= Use devd for autoconfiguration of input devices | |||||
UDEV_DESC= Use udev via libudev-devd for autoconfiguration of input devices | |||||
DEVD_CONFIGURE_ENABLE= config-devd | SUID_MESON_TRUE= suid_wrapper | ||||
SUID_CONFIGURE_ENABLE= suid-wrapper | .else | ||||
SUID_CONFIGURE_ON= --libexecdir=${PREFIX}/bin # set SUID_WRAPPER_DIR | MESON_ARGS+= -Dudev=false | ||||
UDEV_CONFIGURE_ENABLE= config-udev | .endif | ||||
UDEV_CONFIGURE_ON= --disable-config-udev-kms | |||||
UDEV_LIB_DEPENDS= libudev.so:devel/libudev-devd | |||||
.include <bsd.port.options.mk> | .if ${FLAVOR} == xorg || ${FLAVOR} == Xephyr | ||||
MESON_ARGS+= -Ddrm=true | |||||
LIB_DEPENDS+= libdrm.so:graphics/libdrm \ | |||||
libepoxy.so:graphics/libepoxy | |||||
.endif | |||||
FONTPATH_ROOT?= ${LOCALBASE}/share/fonts | FONTPATH_ROOT?= ${LOCALBASE}/share/fonts | ||||
FONTPATHD?= ${PREFIX}/etc/X11/fontpath.d | FONTPATHD?= ${PREFIX}/etc/X11/fontpath.d | ||||
DEFAULT_FONTPATH_LIST= \ | DEFAULT_FONTPATH_LIST= \ | ||||
${FONTPATH_ROOT}/misc/ \ | ${FONTPATH_ROOT}/misc/ \ | ||||
${FONTPATH_ROOT}/TTF/ \ | ${FONTPATH_ROOT}/TTF/ \ | ||||
${FONTPATH_ROOT}/OTF/ \ | ${FONTPATH_ROOT}/OTF/ \ | ||||
${FONTPATH_ROOT}/Type1/ \ | ${FONTPATH_ROOT}/Type1/ \ | ||||
${FONTPATH_ROOT}/100dpi/ \ | ${FONTPATH_ROOT}/100dpi/ \ | ||||
${FONTPATH_ROOT}/75dpi/ \ | ${FONTPATH_ROOT}/75dpi/ \ | ||||
catalogue:${FONTPATHD} | catalogue:${FONTPATHD} | ||||
MESON_ARGS+= -Ddefault_font_path=${DEFAULT_FONTPATH_LIST:ts,} | |||||
PLIST_SUB+= FONTPATHD="${FONTPATHD:S,^${PREFIX}/,,}" | PLIST_SUB+= FONTPATHD="${FONTPATHD:S,^${PREFIX}/,,}" | ||||
USES= compiler:c11 cpe gl gmake perl5 ssl tar:xz xorg xorg-cat:xserver | |||||
USE_PERL5= build | |||||
USE_GL+= gl | USE_GL+= gl | ||||
USE_XORG+= pixman xau xdmcp xfont2 xkbfile xorgproto xshmfence xtrans | USE_XORG+= pixman xau xdmcp xfont2 xkbfile xorgproto xshmfence xtrans | ||||
CONFIGURE_ARGS+=--without-doxygen --without-xmlto --without-fop \ | |||||
--with-default-font-path="${DEFAULT_FONTPATH_LIST:ts,}" \ | |||||
--without-dtrace --disable-config-hal \ | |||||
--disable-install-setuid --disable-unit-tests \ | |||||
--with-fallback-input-driver=libinput | |||||
INSTALL_TARGET= install-strip | |||||
CPE_VENDOR= x.org | CPE_VENDOR= x.org | ||||
CPE_PRODUCT= xorg-server | CPE_PRODUCT= xorg-server | ||||
.if ${SLAVE_PORT} == "no" || ${PORTNAME} == "xephyr" || ${PORTNAME} == "xwayland" | .if ${FLAVOR} == xorg | ||||
LIB_DEPENDS+= libdrm.so:graphics/libdrm \ | |||||
libepoxy.so:graphics/libepoxy | |||||
.else | |||||
BUILD_DEPENDS+= libepoxy>0:graphics/libepoxy # only for configure | |||||
.endif | |||||
.if ${SLAVE_PORT} == "no" | |||||
USE_GL+= gbm | USE_GL+= gbm | ||||
USE_XORG+= pciaccess | USE_XORG+= pciaccess | ||||
CONFIGURE_ARGS+=--disable-dmx --disable-xephyr --disable-xnest --disable-xvfb \ | |||||
--disable-xwayland --enable-xcsecurity | |||||
SUB_FILES= pkg-install pkg-deinstall | |||||
.else | |||||
CONFIGURE_ARGS+= --disable-xorg | |||||
OPTIONS_EXCLUDE= DEVD UDEV SUID | |||||
# Set PLIST for slave ports so they only need to set PLIST_FILES | |||||
PLIST= ${.CURDIR}/pkg-plist | |||||
.endif | .endif | ||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if ${SSL_DEFAULT} == base | .if ${SSL_DEFAULT} == base | ||||
# The reason why I use this is cause openssl from base doesn't install a .pc file | # The reason why I use this is cause openssl from base doesn't install a .pc file | ||||
Done Inline ActionsMaybe also drop USES+=ssl with .if ${SSL_DEFAULT} == base block. $ poudriere testport -j 130amd64 x11-servers/xorg-server [...] ====> Running Q/A tests (stage-qa) Warning: you may not need USES=ssl jbeich: Maybe also drop `USES+=ssl` with `.if ${SSL_DEFAULT} == base` block.
```
$ poudriere testport… | |||||
# and configure will fail trying to find it. Setting both of those variables to | # and configure will fail trying to find it. Setting both of those variables to | ||||
# a *non-empty* value by-passes the pkg-config check. | # a *non-empty* value by-passes the pkg-config check. | ||||
CONFIGURE_ENV= SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include" | CONFIGURE_ENV= SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include" | ||||
.endif | .endif | ||||
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le | .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le | ||||
LIB_DEPENDS+= libunwind.so:devel/libunwind | LIB_DEPENDS+= libunwind.so:devel/libunwind | ||||
.endif | .endif | ||||
.if ${ARCH} == "sparc64" | .if ${ARCH} == "sparc64" | ||||
PLIST_SUB+= SPARC64="" | PLIST_SUB+= SPARC64="" | ||||
.else | .else | ||||
PLIST_SUB+= SPARC64="@comment " | PLIST_SUB+= SPARC64="@comment " | ||||
.endif | .endif | ||||
post-patch: | .if ${FLAVOR} == xorg | ||||
@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \ | |||||
${WRKSRC}/configure | |||||
.if ${SLAVE_PORT} == "no" | |||||
post-install: | post-install: | ||||
# Avoid conflict with nvidia-driver, move libglx.so into .xorg directory | # Avoid conflict with nvidia-driver, move libglx.so into .xorg directory | ||||
Done Inline ActionsDid you forget to restore the comment after D35661#816592 ("Readd the glx danse necessary to play nicely with nvidia")? jbeich: Did you forget to restore the comment after D35661#816592 ("Readd the glx danse necessary to… | |||||
Done Inline ActionsThis can probably get dispensed of as well. libglvnd already handles moderating between the different implementations in principle, and nvidia-driver doesn't install to the same target. In any case, glx actually fails to load during startup because it is not in the correct extensions directory: [265216.865] (II) LoadModule: "glx" [265216.866] (WW) Warning, couldn't open module glx [265216.866] (EE) Failed to load module "glx" (module does not exist, 0) multimedia/obs-studio fails to launch probably due to this. vishwin: This can probably get dispensed of as well. `libglvnd` already handles moderating between the… | |||||
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg | @${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg | ||||
${MV} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/libglx.so \ | ${MV} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/libglx.so \ | ||||
${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/ | ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/ | ||||
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d | @${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d | ||||
@${MKDIR} ${STAGEDIR}${FONTPATHD} | @${MKDIR} ${STAGEDIR}${FONTPATHD} | ||||
@${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d | @${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d | ||||
@${INSTALL_DATA} ${FILESDIR}/20-evdev-kbd.conf \ | @${INSTALL_DATA} ${FILESDIR}/20-evdev-kbd.conf \ | ||||
${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d | ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d | ||||
.endif # ! SLAVE_PORT | ${MKDIR} -p ${STAGEDIR}/var/db/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/db/xkb | |||||
.endif | |||||
post-install-SUID-on: | |||||
Done Inline ActionsThis is not needed, meson does this part correctly. The only file that needs suid set is libexec/Xorg vishwin: This is not needed, meson does this part correctly. The only file that needs suid set is… | |||||
${RM} ${STAGEDIR}${PREFIX}/bin/X | |||||
${RLN} ${STAGEDIR}${PREFIX}/libexec/Xorg.wrap ${STAGEDIR}${PREFIX}/bin/X | |||||
${MV} -f ${STAGEDIR}${PREFIX}/libexec/Xorg ${STAGEDIR}${PREFIX}/bin/Xorg | |||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |
21.1.3 (unlike 21.1.4) is vulnerable to CVE-2022-2319 + CVE-2022-2320