mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
xorg: upgrade to 21.1.4
Port changes: - flavorize the port - decouple Xwayland as it has been split from Xorg - switch to meson - cleanup non necessary patches anymore - stop butchering the build system to play with Xorg.wrap but do it in post-install - remove dmx (no longer existing) - use libmd for sha1 (remove dependency on open/libre ssl) - always activate RPC security - simplify postinstall/deinstall script and make them cross install friendly - remove the SUID option and make it the default, we cannot startx as user without it - only keep the mesa-dri dependency on xorg-server not others xf86-video-ati: fix build with recent xorg While here incorporate a patch which prevent crash of the driver when xrandr is invoked Update x11/libxcvt to provide cvt(1) and friends which are not provided anymore Xorg Reviewed by: tcberner, manu, jbeich Approved by: tcberner, manu Differential Revision: https://reviews.freebsd.org/D35661
This commit is contained in:
parent
6b5d28d496
commit
88b0ae2bb9
56 changed files with 257 additions and 1705 deletions
5
MOVED
5
MOVED
|
@ -17528,3 +17528,8 @@ deskutils/gnome-documents||2022-08-01|Has expired: Archived upstream
|
|||
deskutils/gnome-search-tool||2022-08-01|Has expired: Did not survive gnome3
|
||||
security/nextcloud-twofactor_u2f|security/nextcloud-twofactor_webauthn|2022-08-01|Has expired: Upstream deprecated this port in favor of twofactor_webauthn. Check https://github.com/nextcloud/twofactor_webauthn#migration-from-two-factor-u2f for migration instructions
|
||||
editors/codelite||2022-08-01|Has expired: Has been broken for over a year.
|
||||
x11-servers/xephyr|x11-servers/xorg@xephyr|2022-08-02|Merged into flavorized version
|
||||
x11-servers/xorg-nestserver|x11-servers/xorg@xnest|2022-08-02|Merged into the flavorized version
|
||||
x11-servers/xorg-nestserver|x11-servers/xorg@xnest|2022-08-02|Merged into the flavorized version
|
||||
x11-servers/xorg-vfbserver|x11-servers/xorg@xvfb|2022-08-02|Merged into the flavorized version
|
||||
x11-servers/xorg-dmx||2022-08-02|Discontinued upstream
|
||||
|
|
|
@ -14,7 +14,7 @@ display_ARGS= install
|
|||
. endif
|
||||
|
||||
. if !defined(DISPLAY)
|
||||
BUILD_DEPENDS+= Xvfb:x11-servers/xorg-vfbserver \
|
||||
BUILD_DEPENDS+= Xvfb:x11-servers/xorg-server@xvfb \
|
||||
${LOCALBASE}/share/fonts/misc/8x13O.pcf.gz:x11-fonts/xorg-fonts-miscbitmaps \
|
||||
${LOCALBASE}/share/fonts/misc/fonts.alias:x11-fonts/font-alias \
|
||||
${LOCALBASE}/share/X11/xkb/rules/base:x11/xkeyboard-config \
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# * proto install .pc file, needs pathfix, most only needed at
|
||||
# build time.
|
||||
# * util no particular notes
|
||||
# * xserver xorg x servers
|
||||
#
|
||||
# These categories has to match upstream categories. Don't invent
|
||||
# your own.
|
||||
|
@ -35,7 +34,7 @@
|
|||
.if !defined(_INCLUDE_USES_XORG_CAT_MK)
|
||||
_INCLUDE_USES_XORG_CAT_MK=yes
|
||||
|
||||
_XORG_CATEGORIES= app data doc driver font lib proto util xserver
|
||||
_XORG_CATEGORIES= app data doc driver font lib proto util
|
||||
_XORG_BUILDSYSTEMS= autotools meson
|
||||
|
||||
_XORG_CAT= # empty
|
||||
|
@ -163,21 +162,6 @@ CONFIGURE_ARGS+=--enable-malloc0returnsnull
|
|||
. elif ${_XORG_CAT} == proto
|
||||
.include "${USESDIR}/pathfix.mk"
|
||||
|
||||
. elif ${_XORG_CAT} == xserver
|
||||
DISTNAME?= xorg-server-${PORTVERSION}
|
||||
CFLAGS+= -Werror=uninitialized
|
||||
.include "${USESDIR}/pathfix.mk"
|
||||
. if ${_XORG_BUILDSYS} == meson
|
||||
# put meson stuff here
|
||||
. else
|
||||
CONFIGURE_ARGS+= --with-xkb-path=${LOCALBASE}/share/X11/xkb \
|
||||
--with-fontrootdir=${LOCALBASE}/share/fonts
|
||||
libtool_ARGS?= # empty
|
||||
.include "${USESDIR}/libtool.mk"
|
||||
. endif
|
||||
LIB_PC_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
|
||||
USE_XORG+= fontutil
|
||||
|
||||
. endif # ${_XORG_CAT} == <category>
|
||||
|
||||
# We only need to include xorg.mk if we want USE_XORG modules
|
||||
|
|
|
@ -32,7 +32,7 @@ RUN_DEPENDS+= vncviewer:net/tightvnc
|
|||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MXNEST}
|
||||
RUN_DEPENDS+= Xnest:x11-servers/xorg-nestserver
|
||||
RUN_DEPENDS+= Xnest:x11-servers/xorg-server@xnest
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
PORTNAME= selenium
|
||||
PORTVERSION= 4.1.3
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= www devel java
|
||||
MASTER_SITES= https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.1.0/
|
||||
DISTNAME= selenium-server-${PORTVERSION}
|
||||
|
|
|
@ -7,7 +7,7 @@ www/chromium
|
|||
|
||||
With one or more of these complementary ports:
|
||||
www/geckodriver
|
||||
x11-servers/xorg-vfbserver
|
||||
x11-servers/xorg-server@xvfb
|
||||
x11-fonts/xorg-fonts
|
||||
x11-fonts/webfonts
|
||||
x11/xauth
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
PORTNAME= xf86-video-ati
|
||||
PORTVERSION= 19.1.0
|
||||
PORTREVISION= 4
|
||||
PORTREVISION= 5
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= x11-drivers
|
||||
|
||||
|
@ -12,6 +12,9 @@ PATCHFILES+= f223035f4ffcff2a9296d1e907a5193f8e8845a3.patch:-p1
|
|||
PATCHFILES+= 4d84cf438e7f1bebf0053035ef0292e9fed257d1.patch:-p1
|
||||
PATCHFILES+= c0eb5dbd9c1db6b6d5b1574bcd8c584170d7ab54.patch:-p1
|
||||
PATCHFILES+= 3845392426e9798c1fb2a6fc5e97bf5dfd5c443d.patch:-p1
|
||||
PATCHFILES+= 8da3e4561ef82bb78c9a17b8cd8bf139b9cfd680.patch:-p1
|
||||
|
||||
EXTRA_PATCHES= ${FILESDIR}/0001_dont_set_sourcevalidate_pointer_to_null.diff:-p1
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
TIMESTAMP = 1586946702
|
||||
TIMESTAMP = 1656682698
|
||||
SHA256 (xorg/driver/xf86-video-ati-19.1.0.tar.bz2) = 659f5a1629eea5f5334d9b39b18e6807a63aa1efa33c1236d9cc53acbb223c49
|
||||
SIZE (xorg/driver/xf86-video-ati-19.1.0.tar.bz2) = 904558
|
||||
SHA256 (xorg/driver/f223035f4ffcff2a9296d1e907a5193f8e8845a3.patch) = 34395b16c7849b342a2db62a08eb41dacbb1878583d47692cb6a798b7fd0a60d
|
||||
|
@ -9,3 +9,5 @@ SHA256 (xorg/driver/c0eb5dbd9c1db6b6d5b1574bcd8c584170d7ab54.patch) = 00c001f873
|
|||
SIZE (xorg/driver/c0eb5dbd9c1db6b6d5b1574bcd8c584170d7ab54.patch) = 3679
|
||||
SHA256 (xorg/driver/3845392426e9798c1fb2a6fc5e97bf5dfd5c443d.patch) = ba978104ed1209a4e4f0a1e6067b5044745786c6f0183ba756e9860faa8ef914
|
||||
SIZE (xorg/driver/3845392426e9798c1fb2a6fc5e97bf5dfd5c443d.patch) = 1867
|
||||
SHA256 (xorg/driver/8da3e4561ef82bb78c9a17b8cd8bf139b9cfd680.patch) = fb3c215b742def4a3a412adbcefe5f4d9f36ce9c56af274dbcf50c389d2cd171
|
||||
SIZE (xorg/driver/8da3e4561ef82bb78c9a17b8cd8bf139b9cfd680.patch) = 14196
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
|
||||
index 62962d61d8ee22a02567b7125b4bb3a7f7230be4..51b00dd9b013d183bf93d7f5578014dc16c80ce8 100644
|
||||
--- a/src/radeon_kms.c
|
||||
+++ b/src/radeon_kms.c
|
||||
@@ -931,6 +931,13 @@ radeon_dirty_update(ScrnInfoPtr scrn)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+radeonSourceValidate(DrawablePtr draw, int x, int y, int w, int h,
|
||||
+ unsigned int subWindowMode)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+
|
||||
|
||||
Bool
|
||||
radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
|
||||
@@ -993,7 +1000,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
|
||||
SetPicturePictFilter(src, xf86_crtc->filter, xf86_crtc->params,
|
||||
xf86_crtc->nparams);
|
||||
|
||||
- pScreen->SourceValidate = NULL;
|
||||
+ pScreen->SourceValidate = radeonSourceValidate;
|
||||
CompositePicture(PictOpSrc,
|
||||
src, NULL, dst,
|
||||
extents.x1, extents.y1, 0, 0, extents.x1,
|
|
@ -4,11 +4,7 @@
|
|||
SUBDIR += x2vnc
|
||||
SUBDIR += x2x
|
||||
SUBDIR += xarcan
|
||||
SUBDIR += xephyr
|
||||
SUBDIR += xorg-dmx
|
||||
SUBDIR += xorg-nestserver
|
||||
SUBDIR += xorg-server
|
||||
SUBDIR += xorg-vfbserver
|
||||
SUBDIR += xwayland
|
||||
SUBDIR += xwayland-devel
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
PORTNAME= xephyr
|
||||
PORTREVISION= 0
|
||||
|
||||
COMMENT= X server from X.Org based on kdrive
|
||||
|
||||
LICENSE= MIT
|
||||
|
||||
LIB_DEPENDS+= libxcb-image.so:x11/xcb-util-image \
|
||||
libxcb-icccm.so:x11/xcb-util-wm \
|
||||
libxcb-keysyms.so:x11/xcb-util-keysyms \
|
||||
libxcb-render-util.so:x11/xcb-util-renderutil \
|
||||
libxcb-util.so:x11/xcb-util
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../xorg-server
|
||||
DESCR= ${.CURDIR}/pkg-descr
|
||||
|
||||
SLAVE_PORT= yes
|
||||
USE_XORG= x11 xcb
|
||||
|
||||
CONFIGURE_ARGS+=--enable-xephyr --disable-dmx --disable-xnest --disable-xvfb \
|
||||
--enable-kdrive --disable-xwayland
|
||||
|
||||
PLIST_FILES= bin/Xephyr man/man1/Xephyr.1.gz
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC}/hw/kdrive/ephyr; DESTDIR=${STAGEDIR} ${MAKE} install
|
||||
|
||||
.include "${MASTERDIR}/Makefile"
|
|
@ -1,20 +0,0 @@
|
|||
PORTNAME= xorg-dmx
|
||||
PORTREVISION= 0
|
||||
|
||||
COMMENT= Distributed Multihead X from X.Org
|
||||
|
||||
LICENSE= MIT
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../xorg-server
|
||||
DESCR= ${.CURDIR}/pkg-descr
|
||||
|
||||
SLAVE_PORT= yes
|
||||
USE_XORG= dmx xorgproto x11 xaw7 xext xfixes xi xmu xpm xrender xres xt xtst
|
||||
|
||||
CONFIGURE_ARGS+=--enable-dmx --disable-xephyr --disable-xnest --disable-xvfb \
|
||||
--disable-xwayland
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC}/hw/dmx; DESTDIR=${STAGEDIR} ${MAKE} install
|
||||
|
||||
.include "${MASTERDIR}/Makefile"
|
|
@ -1,6 +0,0 @@
|
|||
Xdmx is proxy X server that provides multi-head support for multiple displays
|
||||
attached to different machines (each of which is running a typical X server).
|
||||
When Xinerama is used with Xdmx, the multiple displays on multiple machines
|
||||
are presented to the user as a single unified screen.
|
||||
|
||||
WWW: https://www.x.org/
|
|
@ -1,16 +0,0 @@
|
|||
bin/Xdmx
|
||||
bin/dmxaddinput
|
||||
bin/dmxaddscreen
|
||||
bin/dmxinfo
|
||||
bin/dmxreconfig
|
||||
bin/dmxresize
|
||||
bin/dmxrminput
|
||||
bin/dmxrmscreen
|
||||
bin/dmxtodmx
|
||||
bin/dmxwininfo
|
||||
bin/vdltodmx
|
||||
bin/xdmxconfig
|
||||
man/man1/Xdmx.1.gz
|
||||
man/man1/dmxtodmx.1.gz
|
||||
man/man1/vdltodmx.1.gz
|
||||
man/man1/xdmxconfig.1.gz
|
|
@ -1,25 +0,0 @@
|
|||
PORTNAME= xorg-nestserver
|
||||
PORTREVISION= 0
|
||||
PORTEPOCH= 2
|
||||
|
||||
COMMENT= Nesting X server from X.Org
|
||||
|
||||
LICENSE= MIT
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../xorg-server
|
||||
DESCR= ${.CURDIR}/pkg-descr
|
||||
|
||||
RUN_DEPENDS= xkeyboard-config>=2.5:x11/xkeyboard-config
|
||||
|
||||
SLAVE_PORT= yes
|
||||
USE_XORG= x11 xext
|
||||
|
||||
CONFIGURE_ARGS+=--enable-xnest --disable-dmx --disable-xephyr --disable-xvfb \
|
||||
--disable-xwayland
|
||||
|
||||
PLIST_FILES= bin/Xnest man/man1/Xnest.1.gz
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC}/hw/xnest; DESTDIR=${STAGEDIR} ${MAKE} install
|
||||
|
||||
.include "${MASTERDIR}/Makefile"
|
|
@ -1,41 +1,94 @@
|
|||
PORTNAME?= xorg-server
|
||||
PORTVERSION?= 1.20.14
|
||||
PORTREVISION?= 0
|
||||
PORTEPOCH?= 1
|
||||
PORTNAME= xorg
|
||||
PORTVERSION= 21.1.4
|
||||
PORTREVISION= 0
|
||||
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
|
||||
COMMENT= X.Org X server and related programs
|
||||
|
||||
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
|
||||
SUB_FILES= pkg-post-deinstall pkg-post-install
|
||||
PKGPOSTINSTALL= ${WRKDIR}/pkg-post-install
|
||||
PKGPOSTDEINSTALL= ${WRKDIR}/pkg-post-deinstall
|
||||
.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
|
||||
xkbcomp:x11/xkbcomp \
|
||||
${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
|
||||
|
||||
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 \
|
||||
-Dxkb_dir=${LOCALBASE}/share/X11/xkb \
|
||||
-Dxkb_output_dir=/var/lib/xkb \
|
||||
-D${FLAVOR}=true
|
||||
|
||||
OPTIONS_SUB= yes
|
||||
OPTIONS_DEFINE+= SUID
|
||||
OPTIONS_RADIO= CONF
|
||||
OPTIONS_RADIO_CONF= DEVD UDEV
|
||||
OPTIONS_DEFAULT= SUID UDEV
|
||||
OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${OPSYS}_${OSREL:R}}
|
||||
.for f in ${FLAVORS:N${FLAVOR}}
|
||||
MESON_ARGS+= -D${f}=false
|
||||
.endfor
|
||||
|
||||
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
|
||||
.if ${FLAVOR} == xorg
|
||||
LIB_DEPENDS+= libudev.so:devel/libudev-devd \
|
||||
libxcvt.so:x11/libxcvt
|
||||
MESON_ARGS+= -Dudev=true \
|
||||
-Dlog_dir=/var/log \
|
||||
-Dsuid_wrapper=true
|
||||
.else
|
||||
MESON_ARGS+= -Dudev=false
|
||||
.endif
|
||||
|
||||
DEVD_CONFIGURE_ENABLE= config-devd
|
||||
SUID_CONFIGURE_ENABLE= suid-wrapper
|
||||
SUID_CONFIGURE_ON= --libexecdir=${PREFIX}/bin # set SUID_WRAPPER_DIR
|
||||
UDEV_CONFIGURE_ENABLE= config-udev
|
||||
UDEV_CONFIGURE_ON= --disable-config-udev-kms
|
||||
UDEV_LIB_DEPENDS= libudev.so:devel/libudev-devd
|
||||
.if ${FLAVOR} == xorg || ${FLAVOR} == xephyr
|
||||
MESON_ARGS+= -Ddrm=true
|
||||
LIB_DEPENDS+= libdrm.so:graphics/libdrm \
|
||||
libepoxy.so:graphics/libepoxy
|
||||
.endif
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
.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
|
||||
|
@ -47,48 +100,23 @@ DEFAULT_FONTPATH_LIST= \
|
|||
${FONTPATH_ROOT}/100dpi/ \
|
||||
${FONTPATH_ROOT}/75dpi/ \
|
||||
catalogue:${FONTPATHD}
|
||||
MESON_ARGS+= -Ddefault_font_path=${DEFAULT_FONTPATH_LIST:ts,}
|
||||
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_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_PRODUCT= xorg-server
|
||||
|
||||
.if ${SLAVE_PORT} == "no" || ${PORTNAME} == "xephyr" || ${PORTNAME} == "xwayland"
|
||||
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"
|
||||
.if ${FLAVOR} == xorg
|
||||
USE_GL+= gbm
|
||||
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
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${SSL_DEFAULT} == base
|
||||
# The reason why I use this is cause openssl from base doesn't install a .pc file
|
||||
# and configure will fail trying to find it. Setting both of those variables to
|
||||
# a *non-empty* value by-passes the pkg-config check.
|
||||
CONFIGURE_ENV= SHA1_LIB="-L/usr/lib -lcrypto" SHA1_CFLAGS="-I/usr/include"
|
||||
.if ${OPSYS} == FreeBSD
|
||||
MESON_ARGS+= -Dsha1=libmd
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == armv7 || ${ARCH} == i386 || ${ARCH} == powerpc64 || ${ARCH} == powerpc64le
|
||||
|
@ -101,13 +129,9 @@ PLIST_SUB+= SPARC64=""
|
|||
PLIST_SUB+= SPARC64="@comment "
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} 's/test.*-traditional.*;/true;/' \
|
||||
${WRKSRC}/configure
|
||||
|
||||
.if ${SLAVE_PORT} == "no"
|
||||
.if ${FLAVOR} == xorg
|
||||
post-install:
|
||||
# Avoid conflict with nvidia-driver, move libglx.so into .xorg directory
|
||||
# Avoid conflict with nvidia-driver, move libglx.so into .xorg directory
|
||||
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg
|
||||
${MV} ${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/libglx.so \
|
||||
${STAGEDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/
|
||||
|
@ -116,6 +140,13 @@ post-install:
|
|||
@${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
|
||||
@${INSTALL_DATA} ${FILESDIR}/20-evdev-kbd.conf \
|
||||
${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d
|
||||
.endif # ! SLAVE_PORT
|
||||
${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 <bsd.port.post.mk>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
TIMESTAMP = 1639835065
|
||||
SHA256 (xorg/xserver/xorg-server-1.20.14.tar.xz) = 5cc5b70b9be89443e2594b93656c60bd5e82cd7f01deb4ce4faf81dcf546a16b
|
||||
SIZE (xorg/xserver/xorg-server-1.20.14.tar.xz) = 5178288
|
||||
TIMESTAMP = 1659367891
|
||||
SHA256 (xorg-server-21.1.4.tar.xz) = 5cc4be8ee47edb58d4a90e603a59d56b40291ad38371b0bd2471fc3cbee1c587
|
||||
SIZE (xorg-server-21.1.4.tar.xz) = 4940176
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
From 4c03b67d334b05b814239420776f2fdd4c4a98ac Mon Sep 17 00:00:00 2001
|
||||
From: nerdopolis <bluescreen_avenger@verizon.net>
|
||||
Date: Tue, 11 Jan 2022 18:41:42 -0500
|
||||
Subject: [PATCH] xephyr: Don't check for SeatId anymore
|
||||
|
||||
After a change for the xserver to automatically determine the seat
|
||||
based on the XDG_SEAT variable, xephyr stopped working. This was
|
||||
because of an old feature where xephyr used to handle evdev
|
||||
directly. This was dropped some time ago, and now this check is
|
||||
not needed
|
||||
---
|
||||
hw/kdrive/ephyr/ephyrinit.c | 34 ++++++++++++++++------------------
|
||||
1 file changed, 16 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
|
||||
index 020461db2..09cd28cb3 100644
|
||||
--- a/hw/kdrive/ephyr/ephyrinit.c
|
||||
+++ b/hw/kdrive/ephyr/ephyrinit.c
|
||||
@@ -70,25 +70,23 @@ InitInput(int argc, char **argv)
|
||||
KdKeyboardInfo *ki;
|
||||
KdPointerInfo *pi;
|
||||
|
||||
- if (!SeatId) {
|
||||
- KdAddKeyboardDriver(&EphyrKeyboardDriver);
|
||||
- KdAddPointerDriver(&EphyrMouseDriver);
|
||||
-
|
||||
- if (!kdHasKbd) {
|
||||
- ki = KdNewKeyboard();
|
||||
- if (!ki)
|
||||
- FatalError("Couldn't create Xephyr keyboard\n");
|
||||
- ki->driver = &EphyrKeyboardDriver;
|
||||
- KdAddKeyboard(ki);
|
||||
- }
|
||||
+ KdAddKeyboardDriver(&EphyrKeyboardDriver);
|
||||
+ KdAddPointerDriver(&EphyrMouseDriver);
|
||||
+
|
||||
+ if (!kdHasKbd) {
|
||||
+ ki = KdNewKeyboard();
|
||||
+ if (!ki)
|
||||
+ FatalError("Couldn't create Xephyr keyboard\n");
|
||||
+ ki->driver = &EphyrKeyboardDriver;
|
||||
+ KdAddKeyboard(ki);
|
||||
+ }
|
||||
|
||||
- if (!kdHasPointer) {
|
||||
- pi = KdNewPointer();
|
||||
- if (!pi)
|
||||
- FatalError("Couldn't create Xephyr pointer\n");
|
||||
- pi->driver = &EphyrMouseDriver;
|
||||
- KdAddPointer(pi);
|
||||
- }
|
||||
+ if (!kdHasPointer) {
|
||||
+ pi = KdNewPointer();
|
||||
+ if (!pi)
|
||||
+ FatalError("Couldn't create Xephyr pointer\n");
|
||||
+ pi->driver = &EphyrMouseDriver;
|
||||
+ KdAddPointer(pi);
|
||||
}
|
||||
|
||||
KdInitInput();
|
||||
--
|
||||
GitLab
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
* Build the devd config backend if activated
|
||||
*
|
||||
--- config/Makefile.am.orig 2017-03-16 05:24:43 UTC
|
||||
+++ config/Makefile.am
|
||||
@@ -4,6 +4,11 @@ noinst_LTLIBRARIES = libconfig.la
|
||||
libconfig_la_SOURCES = config.c config-backends.h
|
||||
libconfig_la_LIBADD =
|
||||
|
||||
+if CONFIG_DEVD
|
||||
+libconfig_la_SOURCES += devd.c
|
||||
+libconfig_la_LIBADD += -lusbhid
|
||||
+endif
|
||||
+
|
||||
if NEED_DBUS
|
||||
AM_CFLAGS += $(DBUS_CFLAGS)
|
||||
libconfig_la_SOURCES += dbus-core.c
|
|
@ -1,97 +0,0 @@
|
|||
* Plumb the devd config backend into configure
|
||||
*
|
||||
* define USE_DEV_IO for ARM platforms
|
||||
*
|
||||
* Only run pkg-config for udev if it is not disabled to prevent over-linking
|
||||
*
|
||||
* Automatically use systemd/logind only on Linux
|
||||
*
|
||||
--- configure.ac.orig 2017-03-15 18:05:25 UTC
|
||||
+++ configure.ac
|
||||
@@ -266,9 +266,12 @@ case $host_cpu in
|
||||
esac
|
||||
GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
|
||||
;;
|
||||
- arm*)
|
||||
+ arm*|aarch64*|riscv*)
|
||||
ARM_VIDEO=yes
|
||||
DEFAULT_INT10="stub"
|
||||
+ case $host_os in
|
||||
+ *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
|
||||
+ esac
|
||||
;;
|
||||
i*86)
|
||||
I386_VIDEO=yes
|
||||
@@ -565,6 +568,7 @@ AC_ARG_ENABLE(xcsecurity, AS_HELP_ST
|
||||
AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
|
||||
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
|
||||
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
|
||||
+AC_ARG_ENABLE(config-devd, AS_HELP_STRING([--enable-config-devd], [Build devd support (default: auto)]), [CONFIG_DEVD=$enableval], [CONFIG_DEVD=auto])
|
||||
AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
|
||||
AC_ARG_ENABLE(config-udev-kms, AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto])
|
||||
AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
|
||||
@@ -856,10 +860,27 @@ if test "x$CONFIG_UDEV" = xyes && test "
|
||||
AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed])
|
||||
fi
|
||||
|
||||
-PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
|
||||
-if test "x$CONFIG_UDEV" = xauto; then
|
||||
- CONFIG_UDEV="$HAVE_LIBUDEV"
|
||||
- AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.])
|
||||
+if test "x$CONFIG_DEVD" = xauto; then
|
||||
+ case $host_os in
|
||||
+ *freebsd*)
|
||||
+ CONFIG_DEVD=yes
|
||||
+ ;;
|
||||
+ *)
|
||||
+ CONFIG_DEVD=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+fi
|
||||
+AM_CONDITIONAL(CONFIG_DEVD, [test "x$CONFIG_DEVD" = xyes])
|
||||
+if test "x$CONFIG_DEVD" = xyes; then
|
||||
+ AC_DEFINE(CONFIG_DEVD, 1, [Use devd for input auto configuration])
|
||||
+fi
|
||||
+
|
||||
+if test "x$CONFIG_UDEV" != xno; then
|
||||
+ PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
|
||||
+ if test "x$CONFIG_UDEV" = xauto; then
|
||||
+ CONFIG_UDEV="$HAVE_LIBUDEV"
|
||||
+ AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if libudev is available.])
|
||||
+ fi
|
||||
fi
|
||||
AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
|
||||
if test "x$CONFIG_UDEV" = xyes; then
|
||||
@@ -907,7 +928,14 @@ AM_CONDITIONAL(CONFIG_HAL, [test "x$CONF
|
||||
|
||||
if test "x$SYSTEMD_LOGIND" = xauto; then
|
||||
if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
|
||||
- SYSTEMD_LOGIND=yes
|
||||
+ case $host_os in
|
||||
+ *linux*)
|
||||
+ SYSTEMD_LOGIND=yes
|
||||
+ ;;
|
||||
+ *)
|
||||
+ SYSTEMD_LOGIND=no
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
SYSTEMD_LOGIND=no
|
||||
fi
|
||||
@@ -2467,12 +2495,12 @@ AC_SUBST([prefix])
|
||||
|
||||
AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
|
||||
|
||||
-if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
|
||||
+if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno && test "x$CONFIG_DEVD" = xno; then
|
||||
AC_MSG_WARN([
|
||||
- ***********************************************
|
||||
- Neither HAL nor udev backend will be enabled.
|
||||
+ *****************************************************
|
||||
+ Neither HAL, devd, nor udev backend will be enabled.
|
||||
Input device hotplugging will not be available!
|
||||
- ***********************************************])
|
||||
+ *****************************************************])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
|
@ -1,14 +0,0 @@
|
|||
* Don't overwrite Xorg binary with Xorg.sh when SUID_WRAPPER_DIR == bindir
|
||||
* Instead, relink bin/X to Xorg.wrap rather than to Xorg (which isn't Xorg.sh)
|
||||
*
|
||||
--- hw/xfree86/Makefile.am.orig 2017-03-16 05:24:43 UTC
|
||||
+++ hw/xfree86/Makefile.am
|
||||
@@ -114,7 +114,7 @@ endif
|
||||
if SUID_WRAPPER
|
||||
$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
|
||||
mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
|
||||
- ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
|
||||
+ (test ! -f $(DESTDIR)$(bindir)/Xorg && ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg || cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg.wrap$(EXEEXT) X)
|
||||
-chown 0 $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
|
||||
endif
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- hw/xfree86/os-support/misc/Makefile.in.orig 2015-09-23 10:21:18.470900000 +0200
|
||||
+++ hw/xfree86/os-support/misc/Makefile.in 2015-09-23 10:22:34.979974000 +0200
|
||||
@@ -543,7 +543,8 @@
|
||||
|
||||
#AM_LDFLAGS = -r
|
||||
AM_CPPFLAGS = $(XORG_INCS)
|
||||
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
|
||||
+@I386_VIDEO_TRUE@I386_VIDEO_CFLAGS = -mno-sse
|
||||
+AM_CFLAGS = $(I386_VIDEO_CFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS)
|
||||
EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
|
||||
all: all-am
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
* generated from patched Makefile.am; revise and regen instead of editing
|
||||
*
|
||||
* Build the devd config backend if activated
|
||||
*
|
||||
--- config/Makefile.in.orig 2017-03-16 05:24:43 UTC
|
||||
+++ config/Makefile.in
|
||||
@@ -89,16 +89,18 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
-@NEED_DBUS_TRUE@am__append_1 = $(DBUS_CFLAGS)
|
||||
-@NEED_DBUS_TRUE@am__append_2 = dbus-core.c
|
||||
-@NEED_DBUS_TRUE@am__append_3 = $(DBUS_LIBS)
|
||||
-@CONFIG_UDEV_TRUE@am__append_4 = $(UDEV_CFLAGS)
|
||||
-@CONFIG_UDEV_TRUE@am__append_5 = udev.c
|
||||
-@CONFIG_UDEV_TRUE@am__append_6 = $(UDEV_LIBS)
|
||||
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_7 = $(HAL_CFLAGS)
|
||||
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_8 = hal.c
|
||||
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_9 = $(HAL_LIBS)
|
||||
-@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__append_10 = wscons.c
|
||||
+@CONFIG_DEVD_TRUE@am__append_1 = devd.c
|
||||
+@CONFIG_DEVD_TRUE@am__append_2 = -lusbhid
|
||||
+@NEED_DBUS_TRUE@am__append_3 = $(DBUS_CFLAGS)
|
||||
+@NEED_DBUS_TRUE@am__append_4 = dbus-core.c
|
||||
+@NEED_DBUS_TRUE@am__append_5 = $(DBUS_LIBS)
|
||||
+@CONFIG_UDEV_TRUE@am__append_6 = $(UDEV_CFLAGS)
|
||||
+@CONFIG_UDEV_TRUE@am__append_7 = udev.c
|
||||
+@CONFIG_UDEV_TRUE@am__append_8 = $(UDEV_LIBS)
|
||||
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_9 = $(HAL_CFLAGS)
|
||||
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_10 = hal.c
|
||||
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__append_11 = $(HAL_LIBS)
|
||||
+@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__append_12 = wscons.c
|
||||
subdir = config
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
|
||||
@@ -126,16 +128,18 @@ am__DEPENDENCIES_1 =
|
||||
@CONFIG_UDEV_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
|
||||
@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__DEPENDENCIES_4 = \
|
||||
@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@ $(am__DEPENDENCIES_1)
|
||||
-libconfig_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
|
||||
- $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4)
|
||||
-am__libconfig_la_SOURCES_DIST = config.c config-backends.h dbus-core.c \
|
||||
- udev.c hal.c wscons.c
|
||||
-@NEED_DBUS_TRUE@am__objects_1 = dbus-core.lo
|
||||
-@CONFIG_UDEV_TRUE@am__objects_2 = udev.lo
|
||||
-@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__objects_3 = hal.lo
|
||||
-@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__objects_4 = wscons.lo
|
||||
+libconfig_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
||||
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
|
||||
+ $(am__DEPENDENCIES_4)
|
||||
+am__libconfig_la_SOURCES_DIST = config.c config-backends.h devd.c \
|
||||
+ dbus-core.c udev.c hal.c wscons.c
|
||||
+@CONFIG_DEVD_TRUE@am__objects_1 = devd.lo
|
||||
+@NEED_DBUS_TRUE@am__objects_2 = dbus-core.lo
|
||||
+@CONFIG_UDEV_TRUE@am__objects_3 = udev.lo
|
||||
+@CONFIG_HAL_TRUE@@CONFIG_UDEV_FALSE@am__objects_4 = hal.lo
|
||||
+@CONFIG_HAL_FALSE@@CONFIG_UDEV_FALSE@@CONFIG_WSCONS_TRUE@am__objects_5 = wscons.lo
|
||||
am_libconfig_la_OBJECTS = config.lo $(am__objects_1) $(am__objects_2) \
|
||||
- $(am__objects_3) $(am__objects_4)
|
||||
+ $(am__objects_3) $(am__objects_4) $(am__objects_5)
|
||||
libconfig_la_OBJECTS = $(am_libconfig_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
@@ -157,7 +161,7 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/config.Plo ./$(DEPDIR)/dbus-core.Plo \
|
||||
- ./$(DEPDIR)/hal.Plo ./$(DEPDIR)/udev.Plo \
|
||||
+ ./$(DEPDIR)/devd.Plo ./$(DEPDIR)/hal.Plo ./$(DEPDIR)/udev.Plo \
|
||||
./$(DEPDIR)/wscons.Plo
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
@@ -593,12 +597,14 @@ target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
-AM_CFLAGS = $(DIX_CFLAGS) $(am__append_1) $(am__append_4) \
|
||||
- $(am__append_7)
|
||||
+AM_CFLAGS = $(DIX_CFLAGS) $(am__append_3) $(am__append_6) \
|
||||
+ $(am__append_9)
|
||||
noinst_LTLIBRARIES = libconfig.la
|
||||
-libconfig_la_SOURCES = config.c config-backends.h $(am__append_2) \
|
||||
- $(am__append_5) $(am__append_8) $(am__append_10)
|
||||
-libconfig_la_LIBADD = $(am__append_3) $(am__append_6) $(am__append_9)
|
||||
+libconfig_la_SOURCES = config.c config-backends.h $(am__append_1) \
|
||||
+ $(am__append_4) $(am__append_7) $(am__append_10) \
|
||||
+ $(am__append_12)
|
||||
+libconfig_la_LIBADD = $(am__append_2) $(am__append_5) $(am__append_8) \
|
||||
+ $(am__append_11)
|
||||
@CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfddir = $(datadir)/X11/$(XF86CONFIGDIR)
|
||||
@CONFIG_UDEV_TRUE@@XORG_TRUE@xorgconfd_DATA = 10-quirks.conf
|
||||
EXTRA_DIST = x11-input.fdi fdi2iclass.py 10-quirks.conf
|
||||
@@ -658,6 +664,7 @@ distclean-compile:
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-core.Plo@am__quote@ # am--include-marker
|
||||
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devd.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hal.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udev.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wscons.Plo@am__quote@ # am--include-marker
|
|
@ -1,12 +0,0 @@
|
|||
* Define required functions for devd config backend
|
||||
*
|
||||
--- config/config-backends.h.orig 2017-03-15 18:05:25 UTC
|
||||
+++ config/config-backends.h
|
||||
@@ -43,4 +43,7 @@ void config_hal_fini(void);
|
||||
#elif defined(CONFIG_WSCONS)
|
||||
int config_wscons_init(void);
|
||||
void config_wscons_fini(void);
|
||||
+#elif defined(CONFIG_DEVD)
|
||||
+int config_devd_init(void);
|
||||
+void config_devd_fini(void);
|
||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||
* Call the devd config backend functions if activated
|
||||
*
|
||||
--- config/config.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ config/config.c
|
||||
@@ -55,6 +55,9 @@ config_init(void)
|
||||
#elif defined(CONFIG_WSCONS)
|
||||
if (!config_wscons_init())
|
||||
ErrorF("[config] failed to initialise wscons\n");
|
||||
+#elif defined(CONFIG_DEVD)
|
||||
+ if (!config_devd_init())
|
||||
+ ErrorF("[config] failed to initialise devd\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -67,6 +70,8 @@ config_fini(void)
|
||||
config_hal_fini();
|
||||
#elif defined(CONFIG_WSCONS)
|
||||
config_wscons_fini();
|
||||
+#elif defined(CONFIG_DEVD)
|
||||
+ config_devd_fini();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,858 +0,0 @@
|
|||
--- config/devd.c.orig 2017-03-16 05:24:43 UTC
|
||||
+++ config/devd.c
|
||||
@@ -0,0 +1,855 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2012 Baptiste Daroussin
|
||||
+ * Copyright (c) 2013, 2014 Alex Kozlov
|
||||
+ * Copyright (c) 2014 Robert Millan
|
||||
+ * Copyright (c) 2014 Jean-Sebastien Pedron
|
||||
+ * Copyright (c) 2015 Hans Petter Selasky
|
||||
+ * Copyright (c) 2015-2017 Rozhuk Ivan
|
||||
+ * Copyright (c) 2016, 2017 Vladimir Kondratyev
|
||||
+ * Copyright (c) 2017 Matthew Rezny
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a
|
||||
+ * copy of this software and associated documentation files (the "Software"),
|
||||
+ * to deal in the Software without restriction, including without limitation
|
||||
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
+ * and/or sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice (including the next
|
||||
+ * paragraph) shall be included in all copies or substantial portions of the
|
||||
+ * Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
+ * DEALINGS IN THE SOFTWARE.
|
||||
+ *
|
||||
+ * Author: Baptiste Daroussin <bapt@FreeBSD.org>
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_DIX_CONFIG_H
|
||||
+#include <dix-config.h>
|
||||
+#endif
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/kbio.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/sysctl.h>
|
||||
+#include <sys/un.h>
|
||||
+#include <sys/mouse.h>
|
||||
+#include <sys/consio.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <dev/evdev/input.h>
|
||||
+#include <dev/usb/usb_ioctl.h>
|
||||
+#include <dev/usb/usbhid.h>
|
||||
+
|
||||
+#include <ctype.h>
|
||||
+#include <dirent.h>
|
||||
+#include <errno.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdbool.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+#include <paths.h>
|
||||
+#include <usbhid.h>
|
||||
+
|
||||
+#include "input.h"
|
||||
+#include "inputstr.h"
|
||||
+#include "hotplug.h"
|
||||
+#include "config-backends.h"
|
||||
+#include "os.h"
|
||||
+
|
||||
+#define _IOC_READ IOC_OUT
|
||||
+
|
||||
+#define ULONG_BITS (sizeof(unsigned long) * 8)
|
||||
+#define ULONG_CNT(__x) (((__x) + ULONG_BITS - 1) / ULONG_BITS)
|
||||
+#define ULONG_IS_BIT_SET(__x, __bit) (((const unsigned long*)(__x))[(__bit) / ULONG_BITS] & (1UL << (__bit % ULONG_BITS)))
|
||||
+
|
||||
+/* from: <linux/joystick.h> */
|
||||
+#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
|
||||
+
|
||||
+/* WebCamD specific. */
|
||||
+#define WEBCAMD_IOCTL_GET_USB_VENDOR_ID _IOR('q', 250, unsigned short)
|
||||
+#define WEBCAMD_IOCTL_GET_USB_PRODUCT_ID _IOR('q', 251, unsigned short)
|
||||
+#define WEBCAMD_IOCTL_GET_USB_SPEED _IOR('q', 252, unsigned int)
|
||||
+
|
||||
+#ifdef COMPAT_32BIT
|
||||
+ #define hid_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr))
|
||||
+#else
|
||||
+ #define hid_pass_ptr(ptr) (ptr)
|
||||
+#endif
|
||||
+
|
||||
+#define _PATH_DEV_LEN (sizeof(_PATH_DEV) - 1)
|
||||
+#define DEVD_PATH_DEV "devd:" _PATH_DEV
|
||||
+#define DEVD_PATH_DEV_LEN (sizeof(DEVD_PATH_DEV) - 1)
|
||||
+#define DEVD_PATH_LEN (DEVD_PATH_DEV_LEN - _PATH_DEV_LEN)
|
||||
+
|
||||
+#define DEVD_SOCK_PATH _PATH_VARRUN "devd.pipe"
|
||||
+
|
||||
+#define DEVD_EVENT_ADD '+'
|
||||
+#define DEVD_EVENT_REMOVE '-'
|
||||
+#define DEVD_EVENT_NOTIFY '!'
|
||||
+
|
||||
+#define RECONNECT_DELAY (5 * 1000)
|
||||
+
|
||||
+#define is_meuqual(__v1, __v1sz, __v2, __v2sz) \
|
||||
+ ((__v1sz) == (__v2sz) && NULL != (__v1) && NULL != (__v2) && \
|
||||
+ 0 == memcmp((__v1), (__v2), (__v1sz)))
|
||||
+
|
||||
+#define is_meuqual_cstr(__cstr, __v, __vsz) \
|
||||
+ is_meuqual(__cstr, (sizeof(__cstr) - 1), __v, __vsz)
|
||||
+
|
||||
+#define is_de_euqual_cstr(__de, __cstr) \
|
||||
+ (NULL != (__de) && \
|
||||
+ is_meuqual((__de)->d_name, (__de)->d_namlen, __cstr, (sizeof(__cstr) - 1)))
|
||||
+
|
||||
+#define devd_get_val_cstr(__cstr, __buf, __bufsz, __valsz) \
|
||||
+ devd_get_val((__buf), (__bufsz), __cstr, (sizeof(__cstr) - 1), \
|
||||
+ (__valsz))
|
||||
+
|
||||
+static int devd_skt = 0;
|
||||
+static char devd_buf[4096];
|
||||
+static size_t devd_buf_used = 0;
|
||||
+static int is_kbdmux = 0;
|
||||
+static int evdev_support = 0;
|
||||
+static OsTimerPtr rtimer = NULL;
|
||||
+
|
||||
+/* Input devices. */
|
||||
+typedef struct hw_type_s {
|
||||
+ const char *dev_name;
|
||||
+ size_t dev_name_size;
|
||||
+ size_t path_offset;
|
||||
+ int is_hybrid; /* has both evdev and traditional interfaces */
|
||||
+ int flags;
|
||||
+ const char *xdriver;
|
||||
+} hw_type_t, *hw_type_p;
|
||||
+
|
||||
+/* xdriver can be set via config "InputClass" section.
|
||||
+ * Do not set xdriver name if device have more than one
|
||||
+ * xf86-input-* drivers.
|
||||
+ * "input/event" can be handled by: xf86-input-libinput,
|
||||
+ * xf86-input-evdev and xf86-input-wacom, let user choose.
|
||||
+ */
|
||||
+static hw_type_t hw_types[] = {
|
||||
+ { "uhid", 4, 0, 0, 0, NULL },
|
||||
+ { "ukbd", 4, 0, 1, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
|
||||
+ { "atkbd", 5, 0, 1, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
|
||||
+ { "kbdmux", 6, 0, 1, ATTR_KEY | ATTR_KEYBOARD, "kbd" },
|
||||
+ { "sysmouse", 8, 0, 1, ATTR_POINTER, "mouse" },
|
||||
+ { "ums", 3, 0, 1, ATTR_POINTER, "mouse" },
|
||||
+ { "psm", 3, 0, 1, ATTR_POINTER, "mouse" },
|
||||
+ { "vboxguest", 9, 0, 0, ATTR_POINTER, "vboxmouse" },
|
||||
+ { "joy", 3, 0, 0, ATTR_JOYSTICK, NULL },
|
||||
+ { "atp", 3, 0, 0, ATTR_TOUCHPAD, NULL },
|
||||
+ { "uep", 3, 0, 0, ATTR_TOUCHSCREEN, NULL },
|
||||
+ { "input/event",5, 6, 0, 0, NULL },
|
||||
+ { "input/js", 2, 6, 0, ATTR_JOYSTICK, NULL },
|
||||
+ { NULL, 0, 0, 0, NULL },
|
||||
+};
|
||||
+
|
||||
+/* Input devices paths. */
|
||||
+static hw_type_t hw_type_path[] = {
|
||||
+ { "input/", 0, 6, 0, NULL },
|
||||
+ { NULL, 0, 0, 0, NULL },
|
||||
+};
|
||||
+
|
||||
+static size_t
|
||||
+bits_calc(const unsigned long *bits, size_t off_start, size_t off_stop)
|
||||
+{
|
||||
+ size_t count = 0;
|
||||
+
|
||||
+ for (size_t i = off_start; i < off_stop; ++i) {
|
||||
+ if (ULONG_IS_BIT_SET(bits, i)) {
|
||||
+ ++count;
|
||||
+ }
|
||||
+ }
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static hw_type_p
|
||||
+get_dev_type_by_name(const char *dev_name, size_t dev_name_size)
|
||||
+{
|
||||
+ if (!dev_name || !dev_name_size)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (size_t i = 0; hw_types[i].dev_name; ++i) {
|
||||
+ if (dev_name_size >= (hw_types[i].dev_name_size + hw_types[i].path_offset) &&
|
||||
+ !memcmp(dev_name, hw_types[i].dev_name, (hw_types[i].path_offset + hw_types[i].dev_name_size))) {
|
||||
+ return &hw_types[i];
|
||||
+ }
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static hw_type_p
|
||||
+get_dev_type_by_path(const char *dev_name, size_t dev_name_size, hw_type_p hw_type_cust)
|
||||
+{
|
||||
+ if (!dev_name || !dev_name_size || !hw_type_cust)
|
||||
+ return NULL;
|
||||
+
|
||||
+ for (size_t i = 0; hw_type_path[i].dev_name; ++i) {
|
||||
+ if (dev_name_size <= hw_type_path[i].path_offset ||
|
||||
+ memcmp(dev_name, hw_type_path[i].dev_name, hw_type_path[i].path_offset))
|
||||
+ continue;
|
||||
+ /* Path in white list. */
|
||||
+ hw_type_cust->dev_name = dev_name;
|
||||
+ hw_type_cust->flags = hw_type_path[i].flags;
|
||||
+ hw_type_cust->xdriver = hw_type_path[i].xdriver;
|
||||
+ hw_type_cust->path_offset = hw_type_path[i].path_offset;
|
||||
+ size_t name_end = hw_type_cust->path_offset;
|
||||
+ while (name_end < dev_name_size && !isdigit(dev_name[name_end]))
|
||||
+ ++name_end;
|
||||
+ hw_type_cust->dev_name_size = (name_end - hw_type_cust->path_offset);
|
||||
+ return hw_type_cust;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+is_kbdmux_enabled(void)
|
||||
+{
|
||||
+ /* Xorg uses /dev/ttyv0 as a console device */
|
||||
+ /* const char device[]="/dev/console"; */
|
||||
+ static const char *device = _PATH_TTY "v0";
|
||||
+
|
||||
+ int fd = open(device, O_RDONLY);
|
||||
+ if (fd < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ keyboard_info_t info;
|
||||
+ int ret = (ioctl(fd, KDGKBINFO, &info) == -1 ||
|
||||
+ memcmp(info.kb_name, "kbdmux", 6)) ? 0 : 1;
|
||||
+ close(fd);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+/* Derived from EvdevProbe() function of xf86-input-evdev driver */
|
||||
+static int
|
||||
+get_evdev_flags(int fd)
|
||||
+{
|
||||
+ if (fd<0)
|
||||
+ return 0;
|
||||
+
|
||||
+ unsigned long key_bits[ULONG_CNT(KEY_CNT)], rel_bits[ULONG_CNT(REL_CNT)], abs_bits[ULONG_CNT(ABS_CNT)];
|
||||
+ size_t has_keys = 0, has_buttons = 0, has_lmr = 0, has_rel_axes = 0, has_abs_axes = 0, has_mt = 0;
|
||||
+ if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits) != -1) {
|
||||
+ has_keys = bits_calc(key_bits, 0, BTN_MISC);
|
||||
+ has_buttons = bits_calc(key_bits, BTN_MISC, BTN_JOYSTICK);
|
||||
+ has_lmr = bits_calc(key_bits, BTN_LEFT, BTN_MIDDLE + 1);
|
||||
+ }
|
||||
+ if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(rel_bits)), rel_bits) != -1) {
|
||||
+ has_rel_axes = bits_calc(rel_bits, 0, REL_CNT);
|
||||
+ }
|
||||
+ if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits) != -1) {
|
||||
+ has_abs_axes = bits_calc(abs_bits, 0, ABS_CNT);
|
||||
+ has_mt = bits_calc(abs_bits, ABS_MT_SLOT, ABS_CNT);
|
||||
+ }
|
||||
+
|
||||
+ int flags = 0;
|
||||
+ if (has_abs_axes) {
|
||||
+ if (has_mt) {
|
||||
+ if (!has_buttons) {
|
||||
+ /*
|
||||
+ * XXX: I'm not sure that joystick detection is
|
||||
+ * done right. xf86-input-evdev does not support them.
|
||||
+ */
|
||||
+ if (ULONG_IS_BIT_SET(key_bits, BTN_JOYSTICK))
|
||||
+ flags = ATTR_JOYSTICK;
|
||||
+ else
|
||||
+ ++has_buttons;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!flags && ULONG_IS_BIT_SET(abs_bits, ABS_X) && ULONG_IS_BIT_SET(abs_bits, ABS_Y)) {
|
||||
+ if (ULONG_IS_BIT_SET(key_bits, BTN_TOOL_PEN) ||
|
||||
+ ULONG_IS_BIT_SET(key_bits, BTN_STYLUS) ||
|
||||
+ ULONG_IS_BIT_SET(key_bits, BTN_STYLUS2))
|
||||
+ flags = ATTR_TABLET;
|
||||
+ else if (ULONG_IS_BIT_SET(abs_bits, ABS_PRESSURE) ||
|
||||
+ ULONG_IS_BIT_SET(key_bits, BTN_TOUCH)) {
|
||||
+ if (has_lmr || ULONG_IS_BIT_SET(key_bits, BTN_TOOL_FINGER))
|
||||
+ flags = ATTR_TOUCHPAD;
|
||||
+ else
|
||||
+ flags = ATTR_TOUCHSCREEN;
|
||||
+ } else if (!(ULONG_IS_BIT_SET(rel_bits, REL_X) &&
|
||||
+ ULONG_IS_BIT_SET(rel_bits, REL_Y)) &&
|
||||
+ has_lmr) /* some touchscreens use BTN_LEFT rather than BTN_TOUCH */
|
||||
+ flags = ATTR_TOUCHSCREEN;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!flags) {
|
||||
+ if (has_keys)
|
||||
+ flags = ATTR_KEY | ATTR_KEYBOARD;
|
||||
+ else if (has_rel_axes || has_abs_axes || has_buttons)
|
||||
+ flags = ATTR_POINTER;
|
||||
+ }
|
||||
+ return flags;
|
||||
+}
|
||||
+
|
||||
+/* From: sys/dev/usb/usb_hid.c */
|
||||
+static int
|
||||
+hid_is_collection(report_desc_t s, uint32_t usage)
|
||||
+{
|
||||
+ struct hid_data* hd = hid_start_parse(s, ~0, -1);
|
||||
+ if (!hd)
|
||||
+ return 0;
|
||||
+
|
||||
+ struct hid_item hi;
|
||||
+ int rc;
|
||||
+ while ((rc = hid_get_item(hd, &hi))) {
|
||||
+ if (hi.kind == hid_collection && hi.usage == usage)
|
||||
+ break;
|
||||
+ }
|
||||
+ hid_end_parse(hd);
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+hid_is_mouse(report_desc_t s)
|
||||
+{
|
||||
+ struct hid_data* hd = hid_start_parse(s, (1 << hid_input), -1);
|
||||
+ if (!hd)
|
||||
+ return 0;
|
||||
+
|
||||
+ struct hid_item hi;
|
||||
+ int found = 0, mdepth = 0;
|
||||
+ while (hid_get_item(hd, &hi)) {
|
||||
+ switch (hi.kind) {
|
||||
+ case hid_collection:
|
||||
+ if (mdepth != 0)
|
||||
+ ++mdepth;
|
||||
+ else if (hi.collection == 1 &&
|
||||
+ hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))
|
||||
+ ++mdepth;
|
||||
+ break;
|
||||
+ case hid_endcollection:
|
||||
+ if (mdepth)
|
||||
+ --mdepth;
|
||||
+ break;
|
||||
+ case hid_input:
|
||||
+ if (!mdepth)
|
||||
+ break;
|
||||
+ if (hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X) &&
|
||||
+ (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE)
|
||||
+ ++found;
|
||||
+ if (hi.usage == HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y) &&
|
||||
+ (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE)
|
||||
+ ++found;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ hid_end_parse(hd);
|
||||
+ return found;
|
||||
+}
|
||||
+
|
||||
+static char *
|
||||
+sysctl_get_str(const char *sysctlname, size_t *size_ret)
|
||||
+{
|
||||
+ if (!sysctlname)
|
||||
+ return NULL;
|
||||
+
|
||||
+ size_t len = 0;
|
||||
+ if (sysctlbyname(sysctlname, NULL, &len, NULL, 0) || !len)
|
||||
+ return NULL;
|
||||
+
|
||||
+ char* dest = malloc(len + 1);
|
||||
+ if (!dest)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (sysctlbyname(sysctlname, dest, &len, NULL, 0)) {
|
||||
+ free(dest);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ dest[len] = 0;
|
||||
+ if (size_ret)
|
||||
+ *size_ret = len;
|
||||
+ return dest;
|
||||
+}
|
||||
+
|
||||
+static char *
|
||||
+devd_get_val(char *buf, size_t buf_size, const char *val_name, size_t val_name_size, size_t *val_size)
|
||||
+{
|
||||
+ if (!buf || !buf_size || !val_name || !val_name_size)
|
||||
+ return NULL;
|
||||
+
|
||||
+ char *ret = buf, *buf_end = (buf + buf_size);
|
||||
+ while (ret && ret < buf_end) {
|
||||
+ ret = memmem(ret, (buf_end - ret), val_name, val_name_size);
|
||||
+ if (!ret)
|
||||
+ return NULL;
|
||||
+ /* Found. */
|
||||
+ /* Check: space before or buf+1. */
|
||||
+ if ((buf + 1) < ret && ret[-1] != ' ') {
|
||||
+ ret += val_name_size;
|
||||
+ continue;
|
||||
+ }
|
||||
+ /* Check: = after name and size for value. */
|
||||
+ ret += val_name_size;
|
||||
+ if ((ret + 1) >= buf_end)
|
||||
+ return NULL;
|
||||
+ if (ret[0] != '=')
|
||||
+ continue;
|
||||
+ ++ret;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (!ret || !val_size)
|
||||
+ return ret;
|
||||
+ /* Calc value data size. */
|
||||
+ char* ptr = memchr(ret, ' ', (buf_end - ret));
|
||||
+ if (!ptr) /* End of string/last value. */
|
||||
+ ptr = buf_end;
|
||||
+ *val_size = (ptr - ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+device_added(const char *dev_name, size_t dev_name_size, int allow_no_device)
|
||||
+{
|
||||
+ if (!dev_name || !dev_name_size || dev_name_size > PATH_MAX)
|
||||
+ return;
|
||||
+
|
||||
+ char config_info[PATH_MAX + 32];
|
||||
+ /* Make dev_name null ended string. */
|
||||
+ snprintf(config_info, sizeof(config_info), DEVD_PATH_DEV"%.*s", (int)dev_name_size, dev_name);
|
||||
+ /* Set / update pointers to dev_name and dev_path. */
|
||||
+ char* dev_path = (config_info + DEVD_PATH_LEN); /* Skip: "devd:" */
|
||||
+ dev_name = (dev_path + _PATH_DEV_LEN); /* Skip: "/dev/" */
|
||||
+
|
||||
+ /* Is known input device or path? */
|
||||
+ hw_type_t *hwtype = get_dev_type_by_name(dev_name, dev_name_size);
|
||||
+ if (!hwtype) {
|
||||
+ hw_type_t hwtype_cust;
|
||||
+ hwtype = get_dev_type_by_path(dev_name, dev_name_size, &hwtype_cust);
|
||||
+ }
|
||||
+ if (!hwtype) /* Not found in white list. */
|
||||
+ return;
|
||||
+
|
||||
+ /* Skip legacy interfaces if EVDEV_SUPPORT is compiled into kernel */
|
||||
+ if (evdev_support && hwtype->is_hybrid) {
|
||||
+ LogMessage(X_INFO, "config/devd: EVDEV_SUPPORT is enabled, ignoring device %s\n", dev_name);
|
||||
+ return;
|
||||
+ }
|
||||
+ /* Skip keyboard devices if kbdmux is enabled */
|
||||
+ if (is_kbdmux && !allow_no_device && (hwtype->flags & ATTR_KEYBOARD)) {
|
||||
+ LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
|
||||
+ return;
|
||||
+ }
|
||||
+ /* Skip duplicate devices. */
|
||||
+ if (device_is_duplicate(config_info)) {
|
||||
+ LogMessage(X_WARNING, "config/devd: device %s already added. ignoring\n", dev_path);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Init and set attributes. */
|
||||
+ char pnp_usb_id[PATH_MAX], product[PATH_MAX], vendor[PATH_MAX];
|
||||
+ InputAttributes attrs;
|
||||
+ memset(&attrs, 0, sizeof(attrs));
|
||||
+ attrs.device = dev_path;
|
||||
+ attrs.flags = hwtype->flags;
|
||||
+
|
||||
+ /* Try to open device. */
|
||||
+ int fd = open(dev_path, O_RDONLY);
|
||||
+ if (fd < 0) {
|
||||
+ if (!(hwtype->flags & (ATTR_KEY | ATTR_KEYBOARD))) {
|
||||
+ /*
|
||||
+ * Fail if cannot open device, it breaks AllowMouseOpenFail,
|
||||
+ * but it should not matter when config/devd is enabled
|
||||
+ */
|
||||
+ LogMessage(X_WARNING, "config/devd: device %s already opened\n", dev_path);
|
||||
+ return;
|
||||
+ }
|
||||
+ if (!allow_no_device) {
|
||||
+ /*
|
||||
+ * There can be only one keyboard attached to console and
|
||||
+ * it is already added.
|
||||
+ */
|
||||
+ LogMessage(X_WARNING, "config/devd: console keyboard is already added, ignoring %s\n", dev_path);
|
||||
+ return;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* Try to get device info via ioctl(). */
|
||||
+ keyboard_info_t kbdi;
|
||||
+ mousehw_t mshw;
|
||||
+ struct input_id iid;
|
||||
+ report_desc_t rep_desc;
|
||||
+
|
||||
+ if (ioctl(fd, KDGKBINFO, &kbdi) != -1) { /* Is this keyboard? */
|
||||
+ memcpy(product, kbdi.kb_name, sizeof(kbdi.kb_name));
|
||||
+ attrs.product = product;
|
||||
+ attrs.flags = ATTR_KEY | ATTR_KEYBOARD;
|
||||
+ LogMessage(X_INFO, "config/devd: detected keyboard: %s, kb_index=%i, kb_unit=%i, kb_type=%i, kb_config=%i\n",
|
||||
+ kbdi.kb_name, kbdi.kb_index, kbdi.kb_unit, kbdi.kb_type, kbdi.kb_config);
|
||||
+ } else if (ioctl(fd, MOUSE_GETHWINFO, &mshw) != -1) { /* Is this mouse? */
|
||||
+ /* FreeBSD mouse drivers does not return real vid+pid. */
|
||||
+ /* construct USB ID in lowercase hex - "0000:ffff" */
|
||||
+ if (mshw.iftype != MOUSE_IF_USB && mshw.model > 0) {
|
||||
+ snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", mshw.hwid, mshw.model);
|
||||
+ attrs.usb_id = pnp_usb_id;
|
||||
+ }
|
||||
+ if (mshw.type == MOUSE_PAD)
|
||||
+ attrs.flags = ATTR_TOUCHPAD;
|
||||
+ else
|
||||
+ attrs.flags = ATTR_POINTER;
|
||||
+ LogMessage(X_INFO, "config/devd: detected mouse: hwid=%04x, model=%04x, type=%04x, iftype=%04x, buttons=%d\n",
|
||||
+ mshw.hwid, mshw.model, mshw.type, mshw.iftype, mshw.buttons);
|
||||
+ } else if (ioctl(fd, JSIOCGNAME((sizeof(product) - 1)), product) != -1) { /* Is this joystick? */
|
||||
+ attrs.product = product;
|
||||
+ attrs.flags = ATTR_JOYSTICK;
|
||||
+ LogMessage(X_INFO, "config/devd: detected joystick: %s\n", product);
|
||||
+ } else if (ioctl(fd, EVIOCGID, &iid) != -1 &&
|
||||
+ ioctl(fd, EVIOCGNAME((sizeof(product) - 1)), product) != -1) { /* Is this event? */
|
||||
+ /* construct USB ID in lowercase hex - "0000:ffff" */
|
||||
+ snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", iid.vendor, iid.product);
|
||||
+ attrs.usb_id = pnp_usb_id;
|
||||
+ attrs.product = product;
|
||||
+ /* Detect device type. */
|
||||
+ attrs.flags = get_evdev_flags(fd);
|
||||
+ /* Skip keyboard devices if kbdmux is enabled and EVDEV_SUPPORT is not compiled into kernel*/
|
||||
+ if (is_kbdmux && !evdev_support && (attrs.flags & ATTR_KEYBOARD)) {
|
||||
+ close(fd);
|
||||
+ LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
|
||||
+ return;
|
||||
+ }
|
||||
+ LogMessage(X_INFO, "config/devd: detected event input: %s, bustype=%04x, vendor=%04x, product=%04x, version=%04x\n",
|
||||
+ product, iid.bustype, iid.vendor, iid.product, iid.version);
|
||||
+ } else if ((rep_desc = hid_get_report_desc(fd))) { /* Is USB HID? */
|
||||
+ if (hid_is_mouse(rep_desc)) {
|
||||
+ attrs.flags = ATTR_POINTER;
|
||||
+ LogMessage(X_INFO, "config/devd: detected USB HID mouse\n");
|
||||
+ } else if (hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) {
|
||||
+ /* Skip keyboard devices if kbdmux is enabled */
|
||||
+ if (is_kbdmux) {
|
||||
+ hid_dispose_report_desc(rep_desc);
|
||||
+ close(fd);
|
||||
+ LogMessage(X_INFO, "config/devd: kbdmux is enabled, ignoring device %s\n", dev_name);
|
||||
+ return;
|
||||
+ }
|
||||
+ attrs.flags = ATTR_KEY | ATTR_KEYBOARD;
|
||||
+ LogMessage(X_INFO, "config/devd: detected USB HID keyboard\n");
|
||||
+ } else if (hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_JOYSTICK)) ||
|
||||
+ hid_is_collection(rep_desc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_GAME_PAD))) {
|
||||
+ attrs.flags = ATTR_JOYSTICK;
|
||||
+ LogMessage(X_INFO, "config/devd: detected USB HID joystick\n");
|
||||
+ } else
|
||||
+ LogMessage(X_INFO, "config/devd: detected USB HID of unknown type\n");
|
||||
+ hid_dispose_report_desc(rep_desc);
|
||||
+ }
|
||||
+
|
||||
+ if (!attrs.usb_id) { /* Is this webcamd device? */
|
||||
+ unsigned short vid, pid;
|
||||
+ if (ioctl(fd, WEBCAMD_IOCTL_GET_USB_VENDOR_ID, &vid) != -1 &&
|
||||
+ ioctl(fd, WEBCAMD_IOCTL_GET_USB_PRODUCT_ID, &pid) != -1) {
|
||||
+ snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%04x:%04x", vid, pid);
|
||||
+ attrs.usb_id = pnp_usb_id;
|
||||
+ LogMessage(X_INFO, "config/devd: webcamd device: %s\n", pnp_usb_id);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ /* Try to get device info via sysctl(). */
|
||||
+ if (!attrs.usb_id && !attrs.pnp_id) {
|
||||
+ char sysctlname[PATH_MAX];
|
||||
+ snprintf(sysctlname, sizeof(sysctlname), "dev.%.*s.%s.%%pnpinfo",
|
||||
+ (int)hwtype->dev_name_size,
|
||||
+ (hwtype->dev_name + hwtype->path_offset),
|
||||
+ (dev_name + hwtype->path_offset + hwtype->dev_name_size));
|
||||
+ size_t sdata_size;
|
||||
+ char* sdata = sysctl_get_str(sysctlname, &sdata_size);
|
||||
+ if (sdata) {
|
||||
+ size_t pid_size, vid_size;
|
||||
+ char* ptr_vid = devd_get_val_cstr("vendor", sdata, sdata_size, &vid_size);
|
||||
+ char* ptr_pid = devd_get_val_cstr("product", sdata, sdata_size, &pid_size);
|
||||
+ if (ptr_vid && ptr_pid) { /* usb_id */
|
||||
+ ptr_vid[vid_size] = 0;
|
||||
+ ptr_pid[pid_size] = 0;
|
||||
+ snprintf(pnp_usb_id, sizeof(pnp_usb_id), "%s:%s", ptr_vid, ptr_pid);
|
||||
+ attrs.usb_id = pnp_usb_id;
|
||||
+ LogMessage(X_INFO, "config/devd: [sysctl] usb_id: %s\n", pnp_usb_id);
|
||||
+ } else { /* pnp_id */
|
||||
+ strlcpy(pnp_usb_id, sdata, sizeof(pnp_usb_id));
|
||||
+ attrs.pnp_id = pnp_usb_id;
|
||||
+ }
|
||||
+ free(sdata);
|
||||
+ }
|
||||
+ }
|
||||
+ if (!attrs.vendor || !attrs.product) {
|
||||
+ char sysctlname[PATH_MAX];
|
||||
+ snprintf(sysctlname, sizeof(sysctlname), "dev.%.*s.%s.%%desc",
|
||||
+ (int)hwtype->dev_name_size,
|
||||
+ (hwtype->dev_name + hwtype->path_offset),
|
||||
+ (dev_name + hwtype->path_offset + hwtype->dev_name_size));
|
||||
+ size_t sdata_size;
|
||||
+ char* sdata = sysctl_get_str(sysctlname, &sdata_size);
|
||||
+ if (sdata) {
|
||||
+ /* Vendor. */
|
||||
+ char* ptr_pid = memchr(sdata, ' ', sdata_size);
|
||||
+ if (ptr_pid)
|
||||
+ ptr_pid[0] = 0;
|
||||
+ strlcpy(vendor, sdata, sizeof(vendor));
|
||||
+ attrs.vendor = vendor;
|
||||
+ /* Product. */
|
||||
+ if (!attrs.product && ptr_pid) {
|
||||
+ ++ptr_pid;
|
||||
+ char* ptr_vid = memchr(ptr_pid, ',', (sdata_size - (ptr_pid - sdata)));
|
||||
+ if (ptr_vid)
|
||||
+ ptr_vid[0] = 0;
|
||||
+ strlcpy(product, ptr_pid, sizeof(product));
|
||||
+ attrs.product = product;
|
||||
+ } else
|
||||
+ product[0] = 0;
|
||||
+ free(sdata);
|
||||
+ LogMessage(X_INFO, "config/devd: [sysctl] vendor: %s, product: %s\n", vendor, product);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Init options. */
|
||||
+ InputOption *option = NULL, *options = NULL;
|
||||
+ if ((option = input_option_new(options, "_source", "server/devd")))
|
||||
+ options = option;
|
||||
+ if (option && (option = input_option_new(options, "config_info", config_info)))
|
||||
+ options = option;
|
||||
+ if (option && (option = input_option_new(options, "name", (attrs.product ? attrs.product : dev_name))))
|
||||
+ options = option;
|
||||
+ if (option && hwtype->xdriver && (option = input_option_new(options, "driver", hwtype->xdriver)))
|
||||
+ options = option;
|
||||
+ /*
|
||||
+ * Don't pass "device" option if the keyboard is already attached to the console (ie. open() failed)
|
||||
+ * 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.
|
||||
+ */
|
||||
+ if (option && fd >= 0 && (option = input_option_new(options, "device", dev_path)))
|
||||
+ options = option;
|
||||
+ /* Most drivers just use "device" but evdev also uses "path" so populate both */
|
||||
+ if (option && (option = input_option_new(options, "path", dev_path)))
|
||||
+ options = option;
|
||||
+ if (option) {
|
||||
+ LogMessage(X_INFO, "config/devd: adding input device %s\n", dev_path);
|
||||
+ DeviceIntPtr dev_iptr = NULL;
|
||||
+ int rc;
|
||||
+ if ((rc = NewInputDeviceRequest(options, &attrs, &dev_iptr)) != Success)
|
||||
+ LogMessage(X_ERROR, "config/devd: error %d adding device %s\n", rc, dev_path);
|
||||
+ } else
|
||||
+ LogMessage(X_ERROR, "config/devd: error adding device %s\n", dev_path);
|
||||
+ if (options)
|
||||
+ input_option_free_list(&options);
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+device_removed(const char *dev_name, size_t dev_name_size)
|
||||
+{
|
||||
+
|
||||
+ if (!dev_name || !dev_name_size || dev_name_size > PATH_MAX)
|
||||
+ return;
|
||||
+
|
||||
+ hw_type_t hwtype_cust;
|
||||
+ if (!get_dev_type_by_name(dev_name, dev_name_size) &&
|
||||
+ !get_dev_type_by_path(dev_name, dev_name_size, &hwtype_cust))
|
||||
+ return; /* Device not in list - unknown. */
|
||||
+
|
||||
+ char config_info[PATH_MAX + 32];
|
||||
+ snprintf(config_info, sizeof(config_info), DEVD_PATH_DEV"%.*s", (int)dev_name_size, dev_name);
|
||||
+ if (device_is_duplicate(config_info))
|
||||
+ LogMessage(X_INFO, "config/devd: removing input device %s\n", (config_info + DEVD_PATH_LEN));
|
||||
+ else
|
||||
+ LogMessage(X_INFO, "config/devd: removing nonexistent device %s\n", (config_info + DEVD_PATH_LEN));
|
||||
+ remove_devices("devd", config_info);
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void socket_handler(int fd, int ready, void *data);
|
||||
+
|
||||
+static int
|
||||
+connect_devd(void)
|
||||
+{
|
||||
+ int sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
+ if (sock < 0) {
|
||||
+ LogMessage(X_ERROR, "config/devd: failed opening stream socket: %s\n", strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ struct sockaddr_un devd;
|
||||
+ devd.sun_family = AF_UNIX;
|
||||
+ memcpy(devd.sun_path, DEVD_SOCK_PATH, sizeof(DEVD_SOCK_PATH));
|
||||
+ if (connect(sock, (struct sockaddr*)&devd, sizeof(devd)) < 0) {
|
||||
+ int error = errno;
|
||||
+ close(sock);
|
||||
+ LogMessage(X_ERROR, "config/devd: failed to connect to devd: %s)\n", strerror(error));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ SetNotifyFd(sock, socket_handler, X_NOTIFY_READ, NULL);
|
||||
+ return sock;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+disconnect_devd(int sock)
|
||||
+{
|
||||
+ if (sock < 0)
|
||||
+ return;
|
||||
+ RemoveNotifyFd(sock);
|
||||
+ close(sock);
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static CARD32
|
||||
+reconnect_handler(OsTimerPtr timer, CARD32 time, void *arg)
|
||||
+{
|
||||
+ devd_buf_used = 0;
|
||||
+ devd_skt = connect_devd();
|
||||
+ if (devd_skt < 0) /* Try again after RECONNECT_DELAY */
|
||||
+ return RECONNECT_DELAY;
|
||||
+ TimerFree(rtimer);
|
||||
+ rtimer = NULL;
|
||||
+ LogMessage(X_INFO, "config/devd: reopened devd socket\n");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+socket_handler(int fd, int ready, void *data)
|
||||
+{
|
||||
+ /* Read new data. */
|
||||
+ while (1) {
|
||||
+ ssize_t ios = recv(devd_skt, (devd_buf + devd_buf_used), (sizeof(devd_buf) - devd_buf_used), MSG_DONTWAIT);
|
||||
+ if (ios > 0) { /* Read OK. */
|
||||
+ devd_buf_used += ios;
|
||||
+ continue; /* Try to read more. */
|
||||
+ }
|
||||
+ /* Something wrong. */
|
||||
+ int error = errno;
|
||||
+ if (error == EAGAIN)
|
||||
+ break; /* All available data read. */
|
||||
+ if (error == EINTR)
|
||||
+ continue;
|
||||
+ if (devd_buf_used >= sizeof(devd_buf)) {
|
||||
+ devd_buf_used = 0; /* Message too long, reset buf. */
|
||||
+ continue;
|
||||
+ }
|
||||
+ /* devd socket is lost */
|
||||
+ disconnect_devd(devd_skt);
|
||||
+ rtimer = TimerSet(NULL, 0, 1, reconnect_handler, NULL);
|
||||
+ LogMessage(X_WARNING, "config/devd: devd socket read error: %s\n", strerror(error));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* Process data. */
|
||||
+ char *ptr, *line = (devd_buf + 1);
|
||||
+ size_t line_size = 0;
|
||||
+ while((ptr = memchr(line, '\n', (devd_buf_used - line_size)))) {
|
||||
+ line_size = (ptr - line);
|
||||
+ do {
|
||||
+ if (*(line - 1) != DEVD_EVENT_NOTIFY)
|
||||
+ break; /* Handle only notify. */
|
||||
+ /* Check: is system=DEVFS. */
|
||||
+ size_t val_size;
|
||||
+ char* val = devd_get_val_cstr("system", line, line_size, &val_size);
|
||||
+ if (!is_meuqual_cstr("DEVFS", val, val_size))
|
||||
+ break;
|
||||
+ /* Check: is subsystem=CDEV. */
|
||||
+ val = devd_get_val_cstr("subsystem", line, line_size, &val_size);
|
||||
+ if (!is_meuqual_cstr("CDEV", val, val_size))
|
||||
+ break;
|
||||
+ /* Get device name. */
|
||||
+ size_t cdev_size;
|
||||
+ char* cdev = devd_get_val_cstr("cdev", line, line_size, &cdev_size);
|
||||
+ if (!cdev)
|
||||
+ break;
|
||||
+ /* Get event type. */
|
||||
+ val = devd_get_val_cstr("type", line, line_size, &val_size);
|
||||
+ if (is_meuqual_cstr("CREATE", val, val_size)) {
|
||||
+ device_added(cdev, cdev_size, 0);
|
||||
+ } else if (is_meuqual_cstr("DESTROY", val, val_size)) {
|
||||
+ device_removed(cdev, cdev_size);
|
||||
+ }
|
||||
+ } while(0);
|
||||
+
|
||||
+ line += (line_size + 2); /* Skip '\n' and event type byte. */
|
||||
+ line_size = (line - devd_buf);
|
||||
+ if (devd_buf_used <= line_size) {
|
||||
+ devd_buf_used = 0;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ /* Save line without end marker. */
|
||||
+ if (line_size) {
|
||||
+ devd_buf_used -= (line_size - 1);
|
||||
+ memmove(devd_buf, (line - 1), devd_buf_used);
|
||||
+ }
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+config_devd_init(void)
|
||||
+{
|
||||
+ LogMessage(X_INFO, "config/devd: probing input devices...\n");
|
||||
+
|
||||
+ /* Check if kernel is compiled with evdev support in hybrid drivers */
|
||||
+ evdev_support = feature_present("evdev_support");
|
||||
+
|
||||
+ /*
|
||||
+ * Add fake keyboard and give up on keyboards management
|
||||
+ * if kbdmux is enabled and not exported through evdev
|
||||
+ */
|
||||
+ is_kbdmux = is_kbdmux_enabled();
|
||||
+ if (is_kbdmux && !evdev_support)
|
||||
+ device_added("kbdmux0", 7, 1);
|
||||
+
|
||||
+ /* Scan /dev/ for devices. */
|
||||
+ struct dirent** namelist;
|
||||
+ size_t dir_cnt = scandir(_PATH_DEV, &namelist, 0, alphasort);
|
||||
+ for (size_t i = 0; i < dir_cnt; ++i) {
|
||||
+ struct dirent* de = namelist[i];
|
||||
+ if (is_de_euqual_cstr(de, ".") ||
|
||||
+ is_de_euqual_cstr(de, "..")) {
|
||||
+ free(de);
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (de->d_type != DT_DIR) {
|
||||
+ device_added(de->d_name, de->d_namlen, 0);
|
||||
+ } else { /* Sub folder. */
|
||||
+ char devicename[PATH_MAX];
|
||||
+ snprintf(devicename, sizeof(devicename), _PATH_DEV "%s", de->d_name);
|
||||
+ struct dirent** snamelist;
|
||||
+ size_t sdir_cnt = scandir(devicename, &snamelist, 0, alphasort);
|
||||
+ for (size_t j = 0; j < sdir_cnt; ++j) {
|
||||
+ struct dirent* sde = snamelist[j];
|
||||
+ if (!is_de_euqual_cstr(sde, ".") &&
|
||||
+ !is_de_euqual_cstr(sde, "..") &&
|
||||
+ sde->d_type != DT_DIR) {
|
||||
+ size_t tm = snprintf(devicename, sizeof(devicename), "%s/%s", de->d_name, sde->d_name);
|
||||
+ device_added(devicename, tm, 0);
|
||||
+ }
|
||||
+ free(sde);
|
||||
+ }
|
||||
+ free(snamelist);
|
||||
+ }
|
||||
+ free(de);
|
||||
+ }
|
||||
+ free(namelist);
|
||||
+
|
||||
+ devd_buf_used = 0;
|
||||
+ devd_skt = connect_devd();
|
||||
+ return (devd_skt < 0) ? 0 : 1;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+config_devd_fini(void)
|
||||
+{
|
||||
+ LogMessage(X_INFO, "config/devd: terminating backend...\n");
|
||||
+
|
||||
+ if (rtimer) {
|
||||
+ TimerFree(rtimer);
|
||||
+ rtimer = NULL;
|
||||
+ }
|
||||
+
|
||||
+ disconnect_devd(devd_skt);
|
||||
+ return;
|
||||
+}
|
|
@ -1,165 +0,0 @@
|
|||
* generated from patched configure.ac; revise and regen instead of editing
|
||||
*
|
||||
* Plumb the devd config backend into configure
|
||||
*
|
||||
* define USE_DEV_IO for ARM platforms
|
||||
*
|
||||
* Only run pkg-config for udev if it is not disabled to prevent over-linking
|
||||
*
|
||||
* Automatically use systemd/logind only on Linux
|
||||
*
|
||||
--- configure.orig 2017-03-15 18:05:39 UTC
|
||||
+++ configure
|
||||
@@ -1032,6 +1032,8 @@ CONFIG_UDEV_FALSE
|
||||
CONFIG_UDEV_TRUE
|
||||
UDEV_LIBS
|
||||
UDEV_CFLAGS
|
||||
+CONFIG_DEVD_FALSE
|
||||
+CONFIG_DEVD_TRUE
|
||||
HAVE_SYSTEMD_DAEMON_FALSE
|
||||
HAVE_SYSTEMD_DAEMON_TRUE
|
||||
SYSTEMD_DAEMON_LIBS
|
||||
@@ -1367,6 +1369,7 @@ enable_tslib
|
||||
enable_dbe
|
||||
enable_xf86bigfont
|
||||
enable_dpms
|
||||
+enable_config_devd
|
||||
enable_config_udev
|
||||
enable_config_udev_kms
|
||||
enable_config_hal
|
||||
@@ -2191,6 +2194,7 @@ Optional Features:
|
||||
--disable-dbe Build DBE extension (default: enabled)
|
||||
--enable-xf86bigfont Build XF86 Big Font extension (default: disabled)
|
||||
--disable-dpms Build DPMS extension (default: enabled)
|
||||
+ --enable-config-devd Build devd support (default: auto)
|
||||
--enable-config-udev Build udev support (default: auto)
|
||||
--enable-config-udev-kms
|
||||
Build udev kms support (default: auto)
|
||||
@@ -23280,9 +23284,13 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con
|
||||
esac
|
||||
GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
|
||||
;;
|
||||
- arm*)
|
||||
+ arm*|aarch64*|riscv*)
|
||||
ARM_VIDEO=yes
|
||||
DEFAULT_INT10="stub"
|
||||
+ case $host_os in
|
||||
+ *freebsd*) $as_echo "#define USE_DEV_IO 1" >>confdefs.h
|
||||
+ ;;
|
||||
+ esac
|
||||
;;
|
||||
i*86)
|
||||
I386_VIDEO=yes
|
||||
@@ -24053,6 +24061,13 @@ else
|
||||
DPMSExtension=yes
|
||||
fi
|
||||
|
||||
+# Check whether --enable-config-devd was given.
|
||||
+if test "${enable_config_devd+set}" = set; then :
|
||||
+ enableval=$enable_config_devd; CONFIG_DEVD=$enableval
|
||||
+else
|
||||
+ CONFIG_DEVD=auto
|
||||
+fi
|
||||
+
|
||||
# Check whether --enable-config-udev was given.
|
||||
if test "${enable_config_udev+set}" = set; then :
|
||||
enableval=$enable_config_udev; CONFIG_UDEV=$enableval
|
||||
@@ -25813,6 +25828,31 @@ if test "x$CONFIG_UDEV" = xyes && test "
|
||||
as_fn_error $? "Hotplugging through both libudev and hal not allowed" "$LINENO" 5
|
||||
fi
|
||||
|
||||
+if test "x$CONFIG_DEVD" = xauto; then
|
||||
+ case $host_os in
|
||||
+ *freebsd*)
|
||||
+ CONFIG_DEVD=yes
|
||||
+ ;;
|
||||
+ *)
|
||||
+ CONFIG_DEVD=no
|
||||
+ ;;
|
||||
+ esac
|
||||
+fi
|
||||
+ if test "x$CONFIG_DEVD" = xyes; then
|
||||
+ CONFIG_DEVD_TRUE=
|
||||
+ CONFIG_DEVD_FALSE='#'
|
||||
+else
|
||||
+ CONFIG_DEVD_TRUE='#'
|
||||
+ CONFIG_DEVD_FALSE=
|
||||
+fi
|
||||
+
|
||||
+if test "x$CONFIG_DEVD" = xyes; then
|
||||
+
|
||||
+$as_echo "#define CONFIG_DEVD 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
+if test "x$CONFIG_UDEV" != xno; then
|
||||
|
||||
pkg_failed=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5
|
||||
@@ -25884,11 +25924,12 @@ else
|
||||
printf "%s\n" "yes" >&6; }
|
||||
HAVE_LIBUDEV=yes
|
||||
fi
|
||||
-if test "x$CONFIG_UDEV" = xauto; then
|
||||
- CONFIG_UDEV="$HAVE_LIBUDEV"
|
||||
+ if test "x$CONFIG_UDEV" = xauto; then
|
||||
+ CONFIG_UDEV="$HAVE_LIBUDEV"
|
||||
|
||||
printf "%s\n" "#define HAVE_LIBUDEV 1" >>confdefs.h
|
||||
|
||||
+ fi
|
||||
fi
|
||||
if test "x$CONFIG_UDEV" = xyes; then
|
||||
CONFIG_UDEV_TRUE=
|
||||
@@ -26132,7 +26173,14 @@ fi
|
||||
|
||||
if test "x$SYSTEMD_LOGIND" = xauto; then
|
||||
if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
|
||||
- SYSTEMD_LOGIND=yes
|
||||
+ case $host_os in
|
||||
+ *linux*)
|
||||
+ SYSTEMD_LOGIND=yes
|
||||
+ ;;
|
||||
+ *)
|
||||
+ SYSTEMD_LOGIND=no
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
SYSTEMD_LOGIND=no
|
||||
fi
|
||||
@@ -32849,17 +32897,17 @@ DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER
|
||||
ac_config_commands="$ac_config_commands sdksyms"
|
||||
|
||||
|
||||
-if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
|
||||
+if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno && test "x$CONFIG_DEVD" = xno; then
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING:
|
||||
- ***********************************************
|
||||
- Neither HAL nor udev backend will be enabled.
|
||||
+ *****************************************************
|
||||
+ Neither HAL, devd, nor udev backend will be enabled.
|
||||
Input device hotplugging will not be available!
|
||||
- ***********************************************" >&5
|
||||
+ *****************************************************" >&5
|
||||
printf "%s\n" "$as_me: WARNING:
|
||||
- ***********************************************
|
||||
- Neither HAL nor udev backend will be enabled.
|
||||
+ *****************************************************
|
||||
+ Neither HAL, devd, nor udev backend will be enabled.
|
||||
Input device hotplugging will not be available!
|
||||
- ***********************************************" >&2;}
|
||||
+ *****************************************************" >&2;}
|
||||
fi
|
||||
|
||||
ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile glamor/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile pseudoramiX/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile dri3/Makefile present/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/Xorg.sh hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/dri2/pci_ids/Makefile hw/xfree86/drivers/Makefile hw/xfree86/drivers/modesetting/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/glamor_egl/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/dri/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xwin/winclipboard/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/src/Makefile hw/xwayland/Makefile test/Makefile test/xi1/Makefile test/xi2/Makefile xserver.ent xorg-server.pc"
|
||||
@@ -33122,6 +33170,10 @@ if test -z "${HAVE_SYSTEMD_DAEMON_TRUE}"
|
||||
as_fn_error $? "conditional \"HAVE_SYSTEMD_DAEMON\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
+if test -z "${CONFIG_DEVD_TRUE}" && test -z "${CONFIG_DEVD_FALSE}"; then
|
||||
+ as_fn_error $? "conditional \"CONFIG_DEVD\" was never defined.
|
||||
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
+fi
|
||||
if test -z "${CONFIG_UDEV_TRUE}" && test -z "${CONFIG_UDEV_FALSE}"; then
|
||||
as_fn_error $? "conditional \"CONFIG_UDEV\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
|
@ -1,14 +0,0 @@
|
|||
* Don't overwrite Xorg binary with Xorg.sh when SUID_WRAPPER_DIR == bindir
|
||||
* Instead, relink bin/X to Xorg.wrap rather than to Xorg (which isn't Xorg.sh)
|
||||
*
|
||||
--- hw/xfree86/Makefile.in.orig 2017-03-16 05:24:43 UTC
|
||||
+++ hw/xfree86/Makefile.in
|
||||
@@ -1156,7 +1156,7 @@ install-exec-hook:
|
||||
@INSTALL_SETUID_TRUE@ chmod u+s $(DESTDIR)$(bindir)/Xorg
|
||||
@SUID_WRAPPER_TRUE@ $(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
|
||||
@SUID_WRAPPER_TRUE@ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
|
||||
-@SUID_WRAPPER_TRUE@ ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
|
||||
+@SUID_WRAPPER_TRUE@ (test ! -f $(DESTDIR)$(bindir)/Xorg && ${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg || cd $(DESTDIR)$(bindir) && rm -f X && $(LN_S) Xorg.wrap$(EXEEXT) X)
|
||||
@SUID_WRAPPER_TRUE@ -chown 0 $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
|
||||
|
||||
uninstall-local:
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* Use our scfb driver as fallback instead of Linux's fbdev
|
||||
*
|
||||
--- hw/xfree86/common/xf86AutoConfig.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/common/xf86AutoConfig.c
|
||||
@@ -294,7 +294,7 @@ listPossibleVideoDrivers(XF86MatchedDriv
|
||||
--- hw/xfree86/common/xf86AutoConfig.c.orig 2022-01-02 23:41:56.000000000 +0100
|
||||
+++ hw/xfree86/common/xf86AutoConfig.c 2022-06-29 11:57:25.400030000 +0200
|
||||
@@ -294,7 +294,7 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md)
|
||||
xf86PciMatchDriver(md);
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
|||
xf86AddMatchedDriver(md, "modesetting");
|
||||
#endif
|
||||
|
||||
@@ -302,8 +302,10 @@ listPossibleVideoDrivers(XF86MatchedDriv
|
||||
@@ -302,8 +302,10 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md)
|
||||
/* Fallback to platform default frame buffer driver */
|
||||
#if !defined(__linux__) && defined(__sparc__)
|
||||
xf86AddMatchedDriver(md, "wsfb");
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
* Select the devd config backend if it is activated
|
||||
*
|
||||
--- hw/xfree86/common/xf86Config.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/common/xf86Config.c
|
||||
@@ -1375,13 +1375,16 @@ checkCoreInputDevices(serverLayoutPtr se
|
||||
}
|
||||
|
||||
if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
|
||||
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
|
||||
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
|
||||
+ defined(CONFIG_DEVD)
|
||||
const char *config_backend;
|
||||
|
||||
#if defined(CONFIG_HAL)
|
||||
config_backend = "HAL";
|
||||
#elif defined(CONFIG_UDEV)
|
||||
config_backend = "udev";
|
||||
+#elif defined(CONFIG_DEVD)
|
||||
+ config_backend = "devd";
|
||||
#else
|
||||
config_backend = "wscons";
|
||||
#endif
|
|
@ -1,14 +0,0 @@
|
|||
* Include devd in the set of config backends
|
||||
*
|
||||
--- hw/xfree86/common/xf86Globals.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/common/xf86Globals.c
|
||||
@@ -119,7 +119,8 @@ xf86InfoRec xf86Info = {
|
||||
.miscModInDevEnabled = TRUE,
|
||||
.miscModInDevAllowNonLocal = FALSE,
|
||||
.pmFlag = TRUE,
|
||||
-#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
|
||||
+#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) || \
|
||||
+ defined(CONFIG_DEVD)
|
||||
.forceInputDevices = FALSE,
|
||||
.autoAddDevices = TRUE,
|
||||
.autoEnableDevices = TRUE,
|
|
@ -1,21 +0,0 @@
|
|||
* Recognize devd backend as a source of auto-configured devices
|
||||
*
|
||||
--- hw/xfree86/common/xf86Xinput.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/common/xf86Xinput.c
|
||||
@@ -871,7 +871,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, D
|
||||
{
|
||||
InputDriverPtr drv = NULL;
|
||||
DeviceIntPtr dev = NULL;
|
||||
- Bool paused;
|
||||
+ Bool paused = 0;
|
||||
int rval;
|
||||
char *path = NULL;
|
||||
|
||||
@@ -1034,6 +1034,7 @@ NewInputDeviceRequest(InputOption *optio
|
||||
if (strcmp(key, "_source") == 0 &&
|
||||
(strcmp(value, "server/hal") == 0 ||
|
||||
strcmp(value, "server/udev") == 0 ||
|
||||
+ strcmp(value, "server/devd") == 0 ||
|
||||
strcmp(value, "server/wscons") == 0)) {
|
||||
is_auto = 1;
|
||||
if (!xf86Info.autoAddDevices) {
|
|
@ -1,5 +1,5 @@
|
|||
--- hw/xfree86/common/xf86str.h.orig 2020-02-23 17:34:26 UTC
|
||||
+++ hw/xfree86/common/xf86str.h
|
||||
--- hw/xfree86/common/xf86str.h.orig 2022-01-02 23:41:56.000000000 +0100
|
||||
+++ hw/xfree86/common/xf86str.h 2022-06-29 11:57:25.502421000 +0200
|
||||
@@ -249,7 +249,7 @@ typedef struct _DriverRec {
|
||||
*/
|
||||
|
||||
|
|
11
x11-servers/xorg-server/files/patch-hw_xfree86_meson.build
Normal file
11
x11-servers/xorg-server/files/patch-hw_xfree86_meson.build
Normal file
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
--- hw/xfree86/os-support/bsd/bsd_init.c.orig 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/os-support/bsd/bsd_init.c
|
||||
@@ -48,6 +48,8 @@ static int devConsoleFd = -1;
|
||||
--- 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
|
||||
@@ -48,6 +48,8 @@ static int initialVT = -1;
|
||||
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
|
||||
static int VTnum = -1;
|
||||
static int initialVT = -1;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--- hw/xfree86/os-support/bsd/ppc_video.c.orig 2016-07-15 16:18:11 UTC
|
||||
+++ hw/xfree86/os-support/bsd/ppc_video.c
|
||||
--- hw/xfree86/os-support/bsd/ppc_video.c.orig 2022-01-02 23:41:56.000000000 +0100
|
||||
+++ hw/xfree86/os-support/bsd/ppc_video.c 2022-06-29 11:57:25.691481000 +0200
|
||||
@@ -79,7 +79,11 @@ xf86DisableIO()
|
||||
{
|
||||
|
||||
|
|
|
@ -1,27 +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 2017-03-15 18:05:25 UTC
|
||||
+++ hw/xfree86/xorg-wrapper.c
|
||||
@@ -188,9 +188,6 @@ static int on_console(int fd)
|
||||
--- 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
|
||||
- struct drm_mode_card_res res;
|
||||
-#endif
|
||||
+#if defined(WITH_LIBDRM) && defined(__linux__)
|
||||
struct drm_mode_card_res res;
|
||||
#endif
|
||||
char buf[PATH_MAX];
|
||||
int i, r, fd;
|
||||
int kms_cards = 0;
|
||||
@@ -227,9 +224,10 @@ int main(int argc, char *argv[])
|
||||
@@ -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 overriden by the config */
|
||||
/* Detect if we need root rights, except when overridden by the config */
|
||||
if (needs_root_rights == -1) {
|
||||
+ struct drm_mode_card_res res;
|
||||
for (i = 0; i < 16; i++) {
|
||||
snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, i);
|
||||
fd = open(buf, O_RDWR);
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
* Add a define which will be toggled by configure when devd backend is activated
|
||||
*
|
||||
--- include/dix-config.h.in.orig 2017-03-15 18:05:25 UTC
|
||||
+++ include/dix-config.h.in
|
||||
@@ -433,6 +433,9 @@
|
||||
/* Support D-Bus */
|
||||
#undef HAVE_DBUS
|
||||
|
||||
+/* Use devd for input hotplug */
|
||||
+#undef CONFIG_DEVD
|
||||
+
|
||||
/* Use libudev for input hotplug */
|
||||
#undef CONFIG_UDEV
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
--- test/xtest.c.orig 2019-04-30 16:40:02.828913000 -0700
|
||||
+++ test/xtest.c 2019-04-30 16:40:42.769713000 -0700
|
||||
@@ -59,10 +59,10 @@
|
||||
static void
|
||||
xtest_init_devices(void)
|
||||
{
|
||||
- ScreenRec screen = {0};
|
||||
- ClientRec server_client = {0};
|
||||
- WindowRec root = {0};
|
||||
- WindowOptRec optional = {0};
|
||||
+ ScreenRec screen = {{0}};
|
||||
+ ClientRec server_client = {{0}};
|
||||
+ WindowRec root = {{0}};
|
||||
+ WindowOptRec optional = {{0}};
|
||||
|
||||
/* random stuff that needs initialization */
|
||||
root.drawable.id = 0xab;
|
|
@ -1,16 +0,0 @@
|
|||
* Skip installing a README into a directory which is actually a symlink created
|
||||
* by another port. If this file is installed, then upon uninstall pkg will
|
||||
* delete the directory under the symlink, which would cause a reinstall to fail
|
||||
* as the target directory is not remade until reinstalling the other port
|
||||
*
|
||||
--- xkb/Makefile.in.orig 2017-03-16 05:24:43 UTC
|
||||
+++ xkb/Makefile.in
|
||||
@@ -886,7 +886,7 @@ info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
-install-data-am: install-dist_xkbcompiledDATA
|
||||
+install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PREFIX="${PKG_PREFIX-/usr/local}"
|
||||
|
||||
case $2 in
|
||||
DEINSTALL)
|
||||
/bin/rm -rf ${PREFIX}/lib/xorg/modules/extensions/libglx.so*
|
||||
;;
|
||||
esac
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
PREFIX="${PKG_PREFIX-/usr/local}"
|
||||
|
||||
case $2 in
|
||||
POST-INSTALL)
|
||||
if [ -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 ]; then
|
||||
/bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 \
|
||||
${PREFIX}/lib/xorg/modules/extensions/libglx.so
|
||||
/bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.nvidia/libglx.so.1 \
|
||||
${PREFIX}/lib/xorg/modules/extensions/libglx.so.1
|
||||
else
|
||||
/bin/ln -f ${PREFIX}/lib/xorg/modules/extensions/.xorg/libglx.so \
|
||||
${PREFIX}/lib/xorg/modules/extensions/libglx.so
|
||||
fi
|
||||
;;
|
||||
esac
|
1
x11-servers/xorg-server/files/pkg-post-deinstall.in
Normal file
1
x11-servers/xorg-server/files/pkg-post-deinstall.in
Normal file
|
@ -0,0 +1 @@
|
|||
rm -f ${PKG_ROOTDIR}${PKG_PREFIX}/lib/xorg/modules/extensions/libglx.so
|
6
x11-servers/xorg-server/files/pkg-post-install.in
Normal file
6
x11-servers/xorg-server/files/pkg-post-install.in
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
PREFIX=${PKG_PREFIX-/usr/local}
|
||||
|
||||
install -l rs ${PKG_ROOTDIR}${PREFIX}/lib/xorg/modules/extensions/.xorg/libglx.so \
|
||||
${PKG_ROOTDIR}${PREFIX}/lib/xorg/modules/extensions/libglx.so
|
|
@ -1,13 +0,0 @@
|
|||
* Skip installing a README into a directory which is actually a symlink created
|
||||
* by another port. If this file is installed, then upon uninstall pkg will
|
||||
* delete the directory under the symlink, which would cause a reinstall to fail
|
||||
* as the target directory is not remade until reinstalling the other port
|
||||
*
|
||||
--- xkb/Makefile.am.orig 2017-03-16 05:24:43 UTC
|
||||
+++ xkb/Makefile.am
|
||||
@@ -39,4 +39,4 @@ libxkbstubs_la_SOURCES = ddxVT.c ddxPriv
|
||||
EXTRA_DIST = xkbDflts.h xkbgeom.h xkb.h
|
||||
|
||||
xkbcompileddir = $(XKB_COMPILED_DIR)
|
||||
-dist_xkbcompiled_DATA = README.compiled
|
||||
+#dist_xkbcompiled_DATA = README.compiled
|
|
@ -1,11 +1,6 @@
|
|||
bin/X
|
||||
bin/Xorg
|
||||
%%SUID%%@(,,4555) bin/Xorg.wrap
|
||||
bin/cvt
|
||||
bin/gtf
|
||||
include/xorg/BT.h
|
||||
include/xorg/IBM.h
|
||||
include/xorg/TI.h
|
||||
include/xorg/XIstubs.h
|
||||
include/xorg/Xprintf.h
|
||||
include/xorg/callback.h
|
||||
|
@ -109,7 +104,6 @@ include/xorg/servermd.h
|
|||
include/xorg/shadow.h
|
||||
include/xorg/shadowfb.h
|
||||
include/xorg/shmint.h
|
||||
include/xorg/site.h
|
||||
include/xorg/syncsdk.h
|
||||
include/xorg/validate.h
|
||||
include/xorg/vbe.h
|
||||
|
@ -137,7 +131,6 @@ include/xorg/xf86Pci.h
|
|||
include/xorg/xf86PciInfo.h
|
||||
include/xorg/xf86Priv.h
|
||||
include/xorg/xf86Privstr.h
|
||||
include/xorg/xf86RamDac.h
|
||||
include/xorg/xf86RandR12.h
|
||||
%%SPARC64%%include/xorg/xf86Sbus.h
|
||||
include/xorg/xf86VGAarbiter.h
|
||||
|
@ -165,33 +158,37 @@ include/xorg/xserver-properties.h
|
|||
include/xorg/xserver_poll.h
|
||||
include/xorg/xvdix.h
|
||||
include/xorg/xvmcext.h
|
||||
include/xorg/xf86-input-inputtest-protocol.h
|
||||
lib/xorg/modules/drivers/modesetting_drv.so
|
||||
lib/xorg/modules/extensions/.xorg/libglx.so
|
||||
lib/xorg/modules/input/inputtest_drv.so
|
||||
lib/xorg/modules/libexa.so
|
||||
lib/xorg/modules/libfb.so
|
||||
lib/xorg/modules/libfbdevhw.so
|
||||
lib/xorg/modules/libglamoregl.so
|
||||
lib/xorg/modules/libint10.so
|
||||
lib/xorg/modules/libshadow.so
|
||||
lib/xorg/modules/libshadowfb.so
|
||||
lib/xorg/modules/libvbe.so
|
||||
lib/xorg/modules/libfbdevhw.so
|
||||
lib/xorg/modules/libvgahw.so
|
||||
lib/xorg/modules/libwfb.so
|
||||
lib/xorg/protocol.txt
|
||||
libdata/pkgconfig/xorg-server.pc
|
||||
libexec/Xorg
|
||||
@(,,4555) libexec/Xorg.wrap
|
||||
man/man1/Xorg.1.gz
|
||||
%%SUID%%man/man1/Xorg.wrap.1.gz
|
||||
man/man1/Xorg.wrap.1.gz
|
||||
man/man1/Xserver.1.gz
|
||||
man/man1/cvt.1.gz
|
||||
man/man1/gtf.1.gz
|
||||
man/man4/exa.4.gz
|
||||
man/man4/fbdevhw.4.gz
|
||||
man/man4/inputtestdrv.4.gz
|
||||
man/man4/modesetting.4.gz
|
||||
%%SUID%%man/man5/Xwrapper.config.5.gz
|
||||
man/man5/Xwrapper.config.5.gz
|
||||
man/man5/xorg.conf.5.gz
|
||||
man/man5/xorg.conf.d.5.gz
|
||||
%%UDEV%%share/X11/xorg.conf.d/10-quirks.conf
|
||||
share/X11/xorg.conf.d/10-quirks.conf
|
||||
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
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
PORTNAME= xorg-vfbserver
|
||||
PORTREVISION= 0
|
||||
PORTEPOCH= 1
|
||||
|
||||
COMMENT= X virtual framebuffer server from X.Org
|
||||
|
||||
LICENSE= MIT
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../xorg-server
|
||||
DESCR= ${.CURDIR}/pkg-descr
|
||||
|
||||
SLAVE_PORT= yes
|
||||
|
||||
CONFIGURE_ARGS+=--enable-xvfb --disable-dmx --disable-xephyr --disable-xnest \
|
||||
--disable-xwayland
|
||||
|
||||
PLIST_FILES= bin/Xvfb man/man1/Xvfb.1.gz
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC}/hw/vfb; DESTDIR=${STAGEDIR} ${MAKE} install
|
||||
|
||||
.include "${MASTERDIR}/Makefile"
|
|
@ -1,6 +1,7 @@
|
|||
PORTNAME= libxcvt
|
||||
DISTVERSIONPREFIX= ${PORTNAME}-
|
||||
DISTVERSION= 0.1.2
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= x11
|
||||
|
||||
MAINTAINER= jbeich@FreeBSD.org
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
@comment bin/cvt
|
||||
bin/cvt
|
||||
include/libxcvt/libxcvt.h
|
||||
include/libxcvt/libxcvt_mode.h
|
||||
lib/libxcvt.so
|
||||
lib/libxcvt.so.0
|
||||
lib/libxcvt.so.0.1.2
|
||||
libdata/pkgconfig/libxcvt.pc
|
||||
@comment man/man1/cvt.1.gz
|
||||
man/man1/cvt.1.gz
|
||||
|
|
|
@ -31,8 +31,8 @@ XVFB_DESC= Install Xvfb backend
|
|||
XEPHYR_DESC= Install Xephyr backend
|
||||
XVNC_DESC= Install Xvnc backend
|
||||
|
||||
XVFB_RUN_DEPENDS= xorg-vfbserver>0:x11-servers/xorg-vfbserver
|
||||
XEPHYR_RUN_DEPENDS= xephyr>=0:x11-servers/xephyr
|
||||
XVFB_RUN_DEPENDS= Xvfb:x11-servers/xorg-server@xvfb
|
||||
XEPHYR_RUN_DEPENDS= Xephyr>=0:x11-servers/xorg-server@xvfb
|
||||
XVNC_RUN_DEPENDS= tightvnc>=0:net/tightvnc
|
||||
|
||||
NO_ARCH= yes
|
||||
|
|
|
@ -25,9 +25,8 @@ RUN_DEPENDS+= xorg-apps>0:x11/xorg-apps \
|
|||
xorg-drivers>0:x11-drivers/xorg-drivers
|
||||
|
||||
.if defined(XORG_COMPLETE)
|
||||
RUN_DEPENDS+= Xnest:x11-servers/xorg-nestserver \
|
||||
Xdmx:x11-servers/xorg-dmx \
|
||||
Xvfb:x11-servers/xorg-vfbserver
|
||||
RUN_DEPENDS+= Xnest:x11-servers/xorg-server@xnest \
|
||||
Xvfb:x11-servers/xorg-server@xvfb
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -30,7 +30,7 @@ RUN_DEPENDS= ${PY_PILLOW} \
|
|||
ssh-askpass:security/openssh-askpass \
|
||||
xauth:x11/xauth \
|
||||
xkbcomp:x11/xkbcomp \
|
||||
Xvfb:x11-servers/xorg-vfbserver
|
||||
Xvfb:x11-servers/xorg-server@xvfb
|
||||
|
||||
USES= desktop-file-utils gettext-runtime gnome pkgconfig \
|
||||
python:3.6+ shared-mime-info shebangfix tar:xz xorg
|
||||
|
|
Loading…
Add table
Reference in a new issue