diff --git a/0001-present-Check-for-NULL-to-prevent-crash.patch b/0001-present-Check-for-NULL-to-prevent-crash.patch new file mode 100644 index 0000000000000000000000000000000000000000..894ad0eb1d47791e2f66601131a792921f37b29a --- /dev/null +++ b/0001-present-Check-for-NULL-to-prevent-crash.patch @@ -0,0 +1,43 @@ +From 94b4a3d45451d29e9539ea234ce8b5e9ed58546c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= +Date: Thu, 13 Jan 2022 00:47:27 +0100 +Subject: [PATCH xserver] present: Check for NULL to prevent crash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1275 +Signed-off-by: Błażej Szczygieł +Tested-by: Aaron Plattner +(cherry picked from commit 22d5818851967408bb7c903cb345b7ca8766094c) +--- + present/present_scmd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/present/present_scmd.c b/present/present_scmd.c +index 3c68e690b..11391adbb 100644 +--- a/present/present_scmd.c ++++ b/present/present_scmd.c +@@ -168,6 +168,9 @@ present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window) + if (!screen_priv->info) + return NULL; + ++ if (!screen_priv->info->get_crtc) ++ return NULL; ++ + return (*screen_priv->info->get_crtc)(window); + } + +@@ -206,6 +209,9 @@ present_flush(WindowPtr window) + if (!screen_priv->info) + return; + ++ if (!screen_priv->info->flush) ++ return; ++ + (*screen_priv->info->flush) (window); + } + +-- +2.34.1 + diff --git a/0001-render-Fix-build-with-gcc-12.patch b/0001-render-Fix-build-with-gcc-12.patch new file mode 100644 index 0000000000000000000000000000000000000000..22f2e5a724dca9d0fc1d40cfe9f76e9ff440de09 --- /dev/null +++ b/0001-render-Fix-build-with-gcc-12.patch @@ -0,0 +1,90 @@ +From 53173fdab492f0f638f6616fcf01af0b9ea6338d Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Thu, 20 Jan 2022 10:20:38 +0100 +Subject: [PATCH xserver] render: Fix build with gcc 12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The xserver fails to compile with the latest gcc 12: + + render/picture.c: In function ‘CreateSolidPicture’: + render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] + 874 | pPicture->pSourcePict->type = SourcePictTypeSolidFill; + | ^~ + render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’ + 868 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateLinearGradientPicture’: + render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 906 | pPicture->pSourcePict->linear.type = SourcePictTypeLinear; + | ^~ + render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’ + 899 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render/picture.c: In function ‘CreateConicalGradientPicture’: + render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] + 989 | pPicture->pSourcePict->conical.type = SourcePictTypeConical; + | ^~ + render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’ + 982 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cc1: some warnings being treated as errors + ninja: build stopped: subcommand failed. + +This is because gcc 12 has become stricter and raises a warning now. + +Fix the warning/error by allocating enough memory to store the union +struct. + +Signed-off-by: Olivier Fourdan +Acked-by: Michel Dänzer +Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256 +(cherry picked from commit c6b0dcb82d4db07a2f32c09a8c09c85a5f57248e) +--- + render/picture.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/render/picture.c b/render/picture.c +index afa0d258f..2be4b1954 100644 +--- a/render/picture.c ++++ b/render/picture.c +@@ -865,7 +865,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -896,7 +896,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -936,7 +936,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -979,7 +979,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +-- +2.34.1 + diff --git a/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch b/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch new file mode 100644 index 0000000000000000000000000000000000000000..3dc57966ade9b9e446aba28e0219aa1395a98b71 --- /dev/null +++ b/0001-xf86-Accept-devices-with-the-simpledrm-driver.patch @@ -0,0 +1,34 @@ +From b9218fadf3c09d83566549279d68886d8258f79c Mon Sep 17 00:00:00 2001 +From: nerdopolis +Date: Thu, 30 Sep 2021 08:51:18 -0400 +Subject: [PATCH] xf86: Accept devices with the 'simpledrm' driver. + +SimpleDRM 'devices' are a fallback device, and do not have a busid +so they are getting skipped. This will allow simpledrm to work +with the modesetting driver +--- + hw/xfree86/common/xf86platformBus.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 0e0a995ac..45028f7a6 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -557,8 +557,13 @@ xf86platformProbeDev(DriverPtr drvp) + } + else { + /* for non-seat0 servers assume first device is the master */ +- if (ServerIsNotSeat0()) ++ if (ServerIsNotSeat0()) { + break; ++ } else { ++ /* Accept the device if the driver is simpledrm */ ++ if (strcmp(xf86_platform_devices[j].attribs->driver, "simpledrm") == 0) ++ break; ++ } + + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; +-- +2.35.1 + diff --git a/10-quirks.conf b/10-quirks.conf new file mode 100644 index 0000000000000000000000000000000000000000..47907d82de3d2f8e6d5d284f31de9e35bbb1ac3d --- /dev/null +++ b/10-quirks.conf @@ -0,0 +1,38 @@ +# Collection of quirks and blacklist/whitelists for specific devices. + + +# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable +# http://bugs.freedesktop.org/show_bug.cgi?id=22442 +Section "InputClass" + Identifier "ThinkPad HDAPS accelerometer blacklist" + MatchProduct "ThinkPad HDAPS accelerometer data" + Option "Ignore" "on" +EndSection + +# https://bugzilla.redhat.com/show_bug.cgi?id=523914 +# Mouse does not move in PV Xen guest +# Explicitly tell evdev to not ignore the absolute axes. +Section "InputClass" + Identifier "Xen Virtual Pointer axis blacklist" + MatchProduct "Xen Virtual Pointer" + Option "IgnoreAbsoluteAxes" "off" + Option "IgnoreRelativeAxes" "off" +EndSection + +# https://bugs.freedesktop.org/show_bug.cgi?id=55867 +# Bug 55867 - Doesn't know how to tag XI_TRACKBALL +Section "InputClass" + Identifier "Tag trackballs as XI_TRACKBALL" + MatchProduct "trackball" + MatchDriver "evdev" + Option "TypeName" "TRACKBALL" +EndSection + +# https://bugs.freedesktop.org/show_bug.cgi?id=62831 +# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly +Section "InputClass" + Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE" + MatchProduct "La-VIEW Technology Naos 5000 Mouse" + MatchDriver "evdev" + Option "TypeName" "MOUSE" +EndSection diff --git a/backport-rename-bool-to-boolean.patch b/backport-rename-bool-to-boolean.patch new file mode 100644 index 0000000000000000000000000000000000000000..a4c0c40c0dca40a7fd22748c79682e3e3cfa7547 --- /dev/null +++ b/backport-rename-bool-to-boolean.patch @@ -0,0 +1,152 @@ +From 454b3a826edb5fc6d0fea3a9cfd1a5e8fc568747 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Mon, 22 Jul 2019 13:51:06 -0400 +Subject: [PATCH] hw: Rename boolean config value field from bool to boolean + +"bool" conflicts with C++ (meh) and stdbool.h (ngh alright fine). This +is a driver-visible change and will likely break the build for mach64, +but it can be fixed by simply using xf86ReturnOptValBool like every +other driver. + +Signed-off-by: Adam Jackson +--- + hw/xfree86/common/xf86Opt.h | 2 +- + hw/xfree86/common/xf86Option.c | 10 +++++----- + hw/xwin/winconfig.c | 22 +++++++++++----------- + hw/xwin/winconfig.h | 2 +- + 4 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h +index 3be2a0fc7..3046fbd41 100644 +--- a/hw/xfree86/common/xf86Opt.h ++++ b/hw/xfree86/common/xf86Opt.h +@@ -41,7 +41,7 @@ typedef union { + unsigned long num; + const char *str; + double realnum; +- Bool bool; ++ Bool boolean; + OptFrequency freq; + } ValueUnion; + +diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c +index 06973bca3..ca538cc57 100644 +--- a/hw/xfree86/common/xf86Option.c ++++ b/hw/xfree86/common/xf86Option.c +@@ -213,7 +213,7 @@ LookupBoolOption(XF86OptionPtr optlist, const char *name, int deflt, + o.name = name; + o.type = OPTV_BOOLEAN; + if (ParseOptionValue(-1, optlist, &o, markUsed)) +- deflt = o.value.bool; ++ deflt = o.value.boolean; + return deflt; + } + +@@ -474,7 +474,7 @@ xf86ShowUnusedOptions(int scrnIndex, XF86OptionPtr opt) + static Bool + GetBoolValue(OptionInfoPtr p, const char *s) + { +- return xf86getBoolValue(&p->value.bool, s); ++ return xf86getBoolValue(&p->value.boolean, s); + } + + static Bool +@@ -678,7 +678,7 @@ ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, + if (markUsed) + xf86MarkOptionUsedByName(options, newn); + if (GetBoolValue(&opt, s)) { +- p->value.bool = !opt.value.bool; ++ p->value.boolean = !opt.value.boolean; + p->found = TRUE; + } + else { +@@ -869,7 +869,7 @@ xf86GetOptValBool(const OptionInfoRec * table, int token, Bool *value) + + p = xf86TokenToOptinfo(table, token); + if (p && p->found) { +- *value = p->value.bool; ++ *value = p->value.boolean; + return TRUE; + } + else +@@ -883,7 +883,7 @@ xf86ReturnOptValBool(const OptionInfoRec * table, int token, Bool def) + + p = xf86TokenToOptinfo(table, token); + if (p && p->found) { +- return p->value.bool; ++ return p->value.boolean; + } + else + return def; +diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c +index 31894d2fb..646d69006 100644 +--- a/hw/xwin/winconfig.c ++++ b/hw/xwin/winconfig.c +@@ -623,7 +623,7 @@ winSetBoolOption(void *optlist, const char *name, int deflt) + o.name = name; + o.type = OPTV_BOOLEAN; + if (ParseOptionValue(-1, optlist, &o)) +- deflt = o.value.bool; ++ deflt = o.value.boolean; + return deflt; + } + +@@ -918,7 +918,7 @@ ParseOptionValue(int scrnIndex, void *options, OptionInfoPtr p) + } + if ((s = winFindOptionValue(options, newn)) != NULL) { + if (GetBoolValue(&opt, s)) { +- p->value.bool = !opt.value.bool; ++ p->value.boolean = !opt.value.boolean; + p->found = TRUE; + } + else { +@@ -968,25 +968,25 @@ static Bool + GetBoolValue(OptionInfoPtr p, const char *s) + { + if (*s == 0) { +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + } + else { + if (winNameCompare(s, "1") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "on") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "true") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "yes") == 0) +- p->value.bool = TRUE; ++ p->value.boolean = TRUE; + else if (winNameCompare(s, "0") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "off") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "false") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + else if (winNameCompare(s, "no") == 0) +- p->value.bool = FALSE; ++ p->value.boolean = FALSE; + } + return TRUE; + } +diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h +index f079368c7..bd1f59650 100644 +--- a/hw/xwin/winconfig.h ++++ b/hw/xwin/winconfig.h +@@ -199,7 +199,7 @@ typedef union { + unsigned long num; + char *str; + double realnum; +- Bool bool; ++ Bool boolean; + OptFrequency freq; + } ValueUnion; + +-- +GitLab diff --git a/driver-abi-rebuild.sh b/driver-abi-rebuild.sh new file mode 100755 index 0000000000000000000000000000000000000000..693297b96606e88cab395a1a13c59f84653a0874 --- /dev/null +++ b/driver-abi-rebuild.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# +# Trivial script to rebuild drivers for ABI changes in the server +# Run me after a new xserver has hit the buildroot + +builddir="abi-rebuild" + +if [ -e "$builddir" ]; then + echo "Path '$builddir' exists. Move out of the way first" + exit 1 +fi + +mkdir -p $builddir +pushd $builddir + +if git config --get remote.origin.url | grep -q redhat.com ; then + pkg=rhpkg +else + pkg=fedpkg +fi + +# figure out the branch we're on +branch=$(git branch | awk '/^\*/ { print $2 }' | grep -v '^master$') +if [ $branch ]; then + branch="-b $branch" +fi + +$pkg co $branch xorg-x11-drivers +pushd xorg-x11-drivers +driverlist=$(grep ^Requires *.spec | awk '{ print $2 }') +popd + +# Things not in -drivers for whatever reason... +extradrivers="xorg-x11-drv-ivtv" + +rm -rf xorg-x11-drivers +echo $driverlist $extradrivers | xargs -n1 $pkg co $branch + +for i in xorg-x11-drv-*/ ; do + [ -e $i/dead.package ] && continue + pushd $i + rpmdev-bumpspec -c "- 1.15 ABI rebuild" *.spec + $pkg commit -c -p && $pkg build --nowait + #$pkg mockbuild + #$pkg srpm + #mockchain -r fedora-20-x86_64 -l $OLDPWD + #mockchain -r rhel-7.0-candidate-x86_64 -l $OLDPWD + + popd +done + +popd + + diff --git a/xorg-server-1.20.14.tar.xz b/xorg-server-1.20.14.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..d3b4b4e757671e790efe4ddfdbc08eda9a94b97f Binary files /dev/null and b/xorg-server-1.20.14.tar.xz differ diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec new file mode 100644 index 0000000000000000000000000000000000000000..8a941f08028e2045b9f795445363d5a0ba65753e --- /dev/null +++ b/xorg-x11-server.spec @@ -0,0 +1,408 @@ +%define anolis_release 1 +# X.org requires lazy relocations to work. +%undefine _hardened_build +%undefine _strict_symbol_defs_build +%global pkgname xorg-server +%global stable_abi 1 + +%global ansic_major 0 +%global ansic_minor 4 +%global videodrv_major 24 +%global videodrv_minor 1 +%global xinput_major 24 +%global xinput_minor 1 +%global extension_major 10 +%global extension_minor 0 + +Summary: X.Org X11 X server +Name: xorg-x11-server +Epoch: 1 +Version: 1.20.14 +Release: %{anolis_release}%{?dist} +URL: http://www.x.org +License: MIT + +Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz +Source4: 10-quirks.conf +Source10: xserver.pamd +Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh +# for requires generation in drivers +Source30: xserver-sdk-abi-requires.release +# maintainer convenience script +Source40: driver-abi-rebuild.sh + +# Backports from "master" upstream: +Patch100: 0001-present-Check-for-NULL-to-prevent-crash.patch +Patch101: 0001-render-Fix-build-with-gcc-12.patch +Patch102: 0001-xf86-Accept-devices-with-the-simpledrm-driver.patch +Patch103: backport-rename-bool-to-boolean.patch + + +BuildRequires: make +BuildRequires: systemtap-sdt-devel +BuildRequires: git-core +BuildRequires: automake autoconf libtool pkgconfig +BuildRequires: xorg-x11-util-macros >= 1.17 + +BuildRequires: xorg-x11-proto-devel >= 7.7 +BuildRequires: xorg-x11-font-utils >= 7.2 + +BuildRequires: dbus-devel libepoxy-devel systemd-devel +BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 +BuildRequires: libXfont2-devel libXau-devel libxkbfile-devel libXres-devel +BuildRequires: libfontenc-devel libXtst-devel libXdmcp-devel +BuildRequires: libX11-devel libXext-devel +BuildRequires: libXinerama-devel libXi-devel + +# DMX config utils buildreqs. +BuildRequires: libXt-devel libdmx-devel libXmu-devel libXrender-devel +BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel + +BuildRequires: pkgconfig(epoxy) +BuildRequires: pkgconfig(xshmfence) >= 1.1 +BuildRequires: libXv-devel +BuildRequires: pixman-devel >= 0.30.0 +BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex +BuildRequires: mesa-libGL-devel >= 9.2 +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libgbm-devel +# XXX silly... +BuildRequires: libdrm-devel >= 2.4.0 kernel-headers + +BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86 +BuildRequires: libudev-devel +BuildRequires: libunwind-devel + +BuildRequires: pkgconfig(xcb-aux) pkgconfig(xcb-image) pkgconfig(xcb-icccm) +BuildRequires: pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) + +%description +X.Org X11 X server + + +%package common +Summary: Xorg server common files +Requires: pixman >= 0.30.0 +Requires: xkeyboard-config xkbcomp + +%description common +Common files shared among all X servers. + + +%package Xorg +Summary: Xorg X server +Provides: Xorg = %{version}-%{release} +Provides: Xserver +# HdG: This should be moved to the wrapper package once the wrapper gets +# its own sub-package: +Provides: xorg-x11-server-wrapper = %{version}-%{release} +%if %{stable_abi} +Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} +Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} +Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} +Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} +%endif +Obsoletes: xorg-x11-glamor < %{version}-%{release} +Provides: xorg-x11-glamor = %{version}-%{release} +Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} +Provides: xorg-x11-drv-modesetting = %{version}-%{release} +Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 + +Requires: xorg-x11-server-common >= %{version}-%{release} +Requires: system-setup-keyboard +Requires: xorg-x11-drv-libinput +Requires: libEGL + +%description Xorg +X.org X11 is an open source implementation of the X Window System. It +provides the basic low level functionality which full fledged +graphical user interfaces (GUIs) such as GNOME and KDE are designed +upon. + + +%package Xnest +Summary: A nested server +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xnest + +%description Xnest +Xnest is an X server which has been implemented as an ordinary +X application. It runs in a window just like other X applications, +but it is an X server itself in which you can run other software. It +is a very useful tool for developers who wish to test their +applications without running them on their real X server. + + +%package Xdmx +Summary: Distributed Multihead X Server and utilities +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xdmx + +%description Xdmx +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. A simple application +for Xdmx would be to provide multi-head support using two desktop machines, +each of which has a single display device attached to it. A complex +application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays +(each attached to one of 16 computers) into a unified 5120x4096 display. + + +%package Xvfb +Summary: A X Windows System virtual framebuffer X server +# xvfb-run is GPLv2, rest is MIT +License: MIT and GPLv2 +Requires: xorg-x11-server-common >= %{version}-%{release} +# required for xvfb-run +Requires: xorg-x11-xauth +Provides: Xvfb + +%description Xvfb +Xvfb (X Virtual Frame Buffer) is an X server that is able to run on +machines with no display hardware and no physical input devices. +Xvfb simulates a dumb framebuffer using virtual memory. Xvfb does +not open any devices, but behaves otherwise as an X display. Xvfb +is normally used for testing servers. + + +%package Xephyr +Summary: A nested server +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xephyr + +%description Xephyr +Xephyr is an X server which has been implemented as an ordinary +X application. It runs in a window just like other X applications, +but it is an X server itself in which you can run other software. It +is a very useful tool for developers who wish to test their +applications without running them on their real X server. Unlike +Xnest, Xephyr renders to an X image rather than relaying the +X protocol, and therefore supports the newer X extensions like +Render and Composite. + + +%package devel +Summary: SDK for X server driver module development +Requires: xorg-x11-util-macros +Requires: xorg-x11-proto-devel +Requires: libXfont2-devel +Requires: pkgconfig pixman-devel libpciaccess-devel +Provides: xorg-x11-server-static +Obsoletes: xorg-x11-glamor-devel < %{version}-%{release} +Provides: xorg-x11-glamor-devel = %{version}-%{release} + +%description devel +The SDK package provides the developmental files which are necessary for +developing X server driver modules, and for compiling driver modules +outside of the standard X11 source code tree. Developers writing video +drivers, input drivers, or other X modules should install this package. + + +%package source +Summary: Xserver source code required to build VNC server (Xvnc) +BuildArch: noarch + +%description source +Xserver source code needed to build VNC server (Xvnc) + +%prep +%autosetup -n %{pkgname}-%{version} -p1 + +%build +export CFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/anolis/anolis-hardened-ld" +export CXXFLAGS="$RPM_OPT_FLAGS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1" +export LDFLAGS="$RPM_LD_FLAGS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1" + +%ifarch x86_64 +%global int10_arch 1 +%endif + +%if %{undefined int10_arch} +%global no_int10 --disable-vbe --disable-int10-module +%endif + +%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev +%global xservers --enable-xvfb --enable-xnest %{kdrive} --enable-xorg +%global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins" +%global dri_flags --disable-dri --enable-dri2 --enable-dri3 --enable-suid-wrapper --enable-glamor + +autoreconf -f -v --install || exit 1 + +%configure %{xservers} \ + --enable-dependency-tracking \ + --disable-static \ + --with-pic \ + %{?no_int10} \ + --with-default-font-path=%{default_font_path} \ + --with-module-dir=%{_libdir}/xorg/modules \ + --with-builderstring="Build ID: %{name} %{version}-%{release}" \ + --with-os-name="$(hostname -s) $(uname -r)" \ + --with-xkb-output=%{_localstatedir}/lib/xkb \ + --without-dtrace \ + --disable-linux-acpi --disable-linux-apm \ + --enable-xselinux --enable-record --enable-present \ + --enable-xcsecurity \ + --enable-config-udev \ + --disable-unit-tests \ + --enable-dmx \ + --disable-xwayland \ + %{dri_flags} \ + ${CONFIGURE} + +make V=1 %{?_smp_mflags} + + +%install +%make_install + +mkdir -p $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,input} + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d +install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver + +mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d +install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d + +# make sure the (empty) /etc/X11/xorg.conf.d is there, system-setup-keyboard +# relies on it more or less. +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d + +%if %{stable_abi} +install -m 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires +%endif + +install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run + +# Make the source package +%global xserver_source_dir %{_datadir}/xorg-x11-server-source +%global inst_srcdir %{buildroot}/%{xserver_source_dir} + +mkdir -p %{inst_srcdir}/{Xext,xkb,GL,hw/{xquartz/bundle,xfree86/common}} +mkdir -p %{inst_srcdir}/{hw/dmx/doc,man,doc,hw/dmx/doxygen} +cp {,%{inst_srcdir}/}hw/xquartz/bundle/cpprules.in +cp {,%{inst_srcdir}/}man/Xserver.man +cp {,%{inst_srcdir}/}doc/smartsched +cp {,%{inst_srcdir}/}hw/dmx/doxygen/doxygen.conf.in +cp {,%{inst_srcdir}/}xserver.ent.in +cp {,%{inst_srcdir}/}hw/xfree86/Xorg.sh.in +cp xkb/README.compiled %{inst_srcdir}/xkb +cp hw/xfree86/xorgconf.cpp %{inst_srcdir}/hw/xfree86 + +find . -type f | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | +xargs tar cf - | (cd %{inst_srcdir} && tar xf -) +find %{inst_srcdir}/hw/xfree86 -name \*.c -delete + +# Remove unwanted files/dirs +{ + find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -f -- || : +# wtf +%ifnarch x86_64 + rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/lib{int10,vbe}.so +%endif +} + + +%files common +%doc COPYING +%{_mandir}/man1/Xserver.1* +%{_libdir}/xorg/protocol.txt +%dir %{_localstatedir}/lib/xkb +%{_localstatedir}/lib/xkb/README.compiled + +%if 1 +%global Xorgperms %attr(4755, root, root) +%else +# disable until module loading is audited +%global Xorgperms %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) +%endif + +%files Xorg +%config %attr(0644,root,root) %{_sysconfdir}/pam.d/xserver +%{_bindir}/X +%{_bindir}/Xorg +%{_libexecdir}/Xorg +%{Xorgperms} %{_libexecdir}/Xorg.wrap +%{_bindir}/cvt +%{_bindir}/gtf +%dir %{_libdir}/xorg +%dir %{_libdir}/xorg/modules +%dir %{_libdir}/xorg/modules/drivers +%{_libdir}/xorg/modules/drivers/modesetting_drv.so +%dir %{_libdir}/xorg/modules/extensions +%{_libdir}/xorg/modules/extensions/libglx.so +%dir %{_libdir}/xorg/modules/input +%{_libdir}/xorg/modules/libfbdevhw.so +%{_libdir}/xorg/modules/libexa.so +%{_libdir}/xorg/modules/libfb.so +%{_libdir}/xorg/modules/libglamoregl.so +%{_libdir}/xorg/modules/libshadow.so +%{_libdir}/xorg/modules/libshadowfb.so +%{_libdir}/xorg/modules/libvgahw.so +%{_libdir}/xorg/modules/libwfb.so +%if %{defined int10_arch} +%{_libdir}/xorg/modules/libint10.so +%{_libdir}/xorg/modules/libvbe.so +%endif +%{_mandir}/man1/gtf.1* +%{_mandir}/man1/Xorg.1* +%{_mandir}/man1/Xorg.wrap.1* +%{_mandir}/man1/cvt.1* +%{_mandir}/man4/fbdevhw.4* +%{_mandir}/man4/exa.4* +%{_mandir}/man4/modesetting.4* +%{_mandir}/man5/Xwrapper.config.5* +%{_mandir}/man5/xorg.conf.5* +%{_mandir}/man5/xorg.conf.d.5* +%dir %{_sysconfdir}/X11/xorg.conf.d +%dir %{_datadir}/X11/xorg.conf.d +%{_datadir}/X11/xorg.conf.d/10-quirks.conf + +%files Xnest +%{_bindir}/Xnest +%{_mandir}/man1/Xnest.1* + +%files Xdmx +%{_bindir}/Xdmx +%{_bindir}/dmxaddinput +%{_bindir}/dmxaddscreen +%{_bindir}/dmxreconfig +%{_bindir}/dmxresize +%{_bindir}/dmxrminput +%{_bindir}/dmxrmscreen +%{_bindir}/dmxtodmx +%{_bindir}/dmxwininfo +%{_bindir}/vdltodmx +%{_bindir}/dmxinfo +%{_bindir}/xdmxconfig +%{_mandir}/man1/Xdmx.1* +%{_mandir}/man1/dmxtodmx.1* +%{_mandir}/man1/vdltodmx.1* +%{_mandir}/man1/xdmxconfig.1* + +%files Xvfb +%{_bindir}/Xvfb +%{_bindir}/xvfb-run +%{_mandir}/man1/Xvfb.1* + +%files Xephyr +%{_bindir}/Xephyr +%{_mandir}/man1/Xephyr.1* + +%files devel +%doc COPYING +#{_docdir}/xorg-server +%{_bindir}/xserver-sdk-abi-requires +%{_libdir}/pkgconfig/xorg-server.pc +%dir %{_includedir}/xorg +%{_includedir}/xorg/*.h +%{_datadir}/aclocal/xorg-server.m4 + +%files source +%{xserver_source_dir} + + +%changelog +* Fri Apr 22 2022 Jocelyn Falempe - 1:1.20.14-1 +- Init from upstream version 1.20.14 + diff --git a/xserver-sdk-abi-requires.release b/xserver-sdk-abi-requires.release new file mode 100755 index 0000000000000000000000000000000000000000..30d77bf1bb08e9e6ad1d70c74f5761b32f1f22d1 --- /dev/null +++ b/xserver-sdk-abi-requires.release @@ -0,0 +1,19 @@ +#!/bin/sh +# +# The X server provides capabilities of the form: +# +# Provides: xserver-abi(ansic-0) = 4 +# +# for an ABI version of 0.4. The major number is encoded into the name so +# that major number changes force upgrades. If we didn't, then +# +# Requires: xserver-abi(ansic) >= 0.4 +# +# would also match 1.0, which is wrong since major numbers mean an ABI break. + +ver=$(pkg-config --variable abi_$1 xorg-server) + +major=$(echo $ver | cut -f 1 -d .) +minor=$(echo $ver | cut -f 2 -d .) + +echo "xserver-abi($1-$major) >= $minor" diff --git a/xserver.pamd b/xserver.pamd new file mode 100644 index 0000000000000000000000000000000000000000..bf799304b6c401e1e92e389c3b95ecc10ed007e2 --- /dev/null +++ b/xserver.pamd @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +auth required pam_console.so +account required pam_permit.so +session optional pam_keyinit.so force revoke diff --git a/xvfb-run.sh b/xvfb-run.sh new file mode 100644 index 0000000000000000000000000000000000000000..9d088c1c28ec13649eaef4deb24b75a0039c19a1 --- /dev/null +++ b/xvfb-run.sh @@ -0,0 +1,200 @@ +#!/bin/sh +# --- T2-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# T2 SDE: package/.../xorg-server/xvfb-run.sh +# Copyright (C) 2005 The T2 SDE Project +# Copyright (C) XXXX - 2005 Debian +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- T2-COPYRIGHT-NOTE-END --- + +# $Id$ +# from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run + +# This script starts an instance of Xvfb, the "fake" X server, runs a command +# with that server available, and kills the X server when done. The return +# value of the command becomes the return value of this script. +# +# If anyone is using this to build a Debian package, make sure the package +# Build-Depends on xvfb, xbase-clients, and xfonts-base. + +set -e + +PROGNAME=xvfb-run +SERVERNUM=99 +AUTHFILE= +ERRORFILE=/dev/null +STARTWAIT=3 +XVFBARGS="-screen 0 640x480x24" +LISTENTCP="-nolisten tcp" +XAUTHPROTO=. + +# Query the terminal to establish a default number of columns to use for +# displaying messages to the user. This is used only as a fallback in the event +# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the +# script is running, and this cannot, only being calculated once.) +DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true +if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then + DEFCOLUMNS=80 +fi + +# Display a message, wrapping lines at the terminal width. +message () { + echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} +} + +# Display an error message. +error () { + message "error: $*" >&2 +} + +# Display a usage message. +usage () { + if [ -n "$*" ]; then + message "usage error: $*" + fi + cat <&2 + exit 2 +fi + +if ! type xauth >/dev/null; then + error "xauth command not found" + exit 3 +fi + +# Set up the temp dir for the pid and X authorization file +XVFB_RUN_TMPDIR="$(mktemp --directory --tmpdir $PROGNAME.XXXXXX)" +# If the user did not specify an X authorization file to use, set up a temporary +# directory to house one. +if [ -z "$AUTHFILE" ]; then + AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXX) +fi + +# Start Xvfb. +MCOOKIE=$(mcookie) + +if [ -z "$AUTO_DISPLAY" ]; then + # Old style using a pre-computed SERVERNUM + XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >>"$ERRORFILE" \ + 2>&1 & + XVFBPID=$! +else + # New style using Xvfb to provide a free display + PIDFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" pid.XXXXXX) + SERVERNUM=$(XAUTHORITY=$AUTHFILE Xvfb -displayfd 1 $XVFBARGS $LISTENTCP \ + 2>"$ERRORFILE" & echo $! > $PIDFILE) + XVFBPID=$(cat $PIDFILE) +fi +sleep "$STARTWAIT" + +XAUTHORITY=$AUTHFILE xauth source - << EOF >>"$ERRORFILE" 2>&1 +add :$SERVERNUM $XAUTHPROTO $MCOOKIE +EOF + +# Start the command and save its exit status. +set +e +DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 +RETVAL=$? +set -e + +# Kill Xvfb now that the command has exited. +kill $XVFBPID + +# Clean up. +XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1 +if [ -n "$XVFB_RUN_TMPDIR" ]; then + if ! rm -r "$XVFB_RUN_TMPDIR"; then + error "problem while cleaning up temporary directory" + exit 5 + fi +fi + +# Return the executed command's exit status. +exit $RETVAL + +# vim:set ai et sts=4 sw=4 tw=80: