Files
BMLFS/build-scripts/xorg-server.build
2024-02-01 21:35:45 -06:00

111 lines
4.4 KiB
Bash

#! /bin/bash
# Xorg-Server
# Source: https://www.x.org/pub/individual/xserver/xorg-server-21.1.11.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: Pixman, Xorg-Fonts, xkeyboard-config, libtirpc
# Recommended: elogind, libepoxy, polkit, wayland, wayland-protocols
# Optional: acpid, Doxygen,fop, nettle, libgcrypt, xcb-util-keysyms,
# Optional: xcb-util-image, xcb-util-renderutil, xcb-util-wm,
# Optional: xmlto, libunwind, xorg-sgml-doctools
# Add libseat support
patch -Np1 -i ../patches/xorg-server-21.1.11-chimera/0001-Support-libseat.patch
patch -Np1 -i ../patches/xorg-server-21.1.11-chimera/libseat-dep.patch
patch -Np1 -i ../patches/xorg-server-21.1.11-chimera/06_use-intel-only-on-pre-gen4.patch
patch -Np1 -i ../patches/xorg-server-21.1.11-chimera/07_use-modesetting-driver-by-default-on-GeForce.patch
patch -Np1 -i ../patches/xorg-server-21.1.11-chimera/fix-libshadow-2.patch
sed -i -e 's/termio.h/termios.h/' hw/xfree86/os-support/xf86_OSlib.h
# xorg modules does not work with the -z now and it seems like we
# cannot pass over the linker flag to .so files. so we tweak the
# gcc spec
export CFLAGS="$CFLAGS -D_GNU_SOURCE -D__gid_t=gid_t -D__uid_t=uid_t"
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
# Enable & disable specific options
export MARGS="-Dxephyr=true "
export MARGS+="-Dglamor=true "
export MARGS+="-Dxnest=true "
export MARGS+="-Dxvfb=true "
export MARGS+="-Dglx=true "
export MARGS+="-Dxdmcp=true "
export MARGS+="-Dxdm-auth-1=true "
export MARGS+="-Dxcsecurity=true "
export MARGS+="-Dipv6=true "
export MARGS+="-Dlisten_unix=true "
export MARGS+="-Dlisten_local=true "
export MARGS+="-Dsuid_wrapper=true "
export MARGS+="-Dpciaccess=true "
export MARGS+="-Dudev=true "
export MARGS+="-Ddpms=true "
export MARGS+="-Ddri1=true "
export MARGS+="-Ddri2=true "
export MARGS+="-Ddri3=true "
export MARGS+="-Dsecure-rpc=false "
export MARGS+="-Dhal=false "
export MARGS+="-Dxwin=false "
export MARGS+="-Dlisten_tcp=false "
# Configure source
meson setup \
--prefix=$XORG_PREFIX \
-Dxorg=true \
-Dxkb_dir=/usr/share/X11/xkb \
-Dxkb_output_dir=/var/lib/xkb \
-Dsystemd_logind=false \
-Dseatd_libseat=true \
$MARGS OUTPUT
read -p "Compile?" && ninja -j2 -C OUTPUT &&
unset CFLAGS LDFLAGS MARGS
sudo -SE DESTDIR=$BUILD ninja -C OUTPUT install && \
sudo -S mkdir -pv /BMAN/install /BMAN/$XORG_PREFIX/share && \
sudo -S mv $BUILD/$XORG_PREFIX/share/man /BMAN/$XORG_PREFIX/share/ && \
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
xorg-server: xorg-server (The Xorg server, the core of the X Window System)
xorg-server:
xorg-server: Xorg is a full featured X server that was originally designed for UNIX
xorg-server: and UNIX-like operating systems running on Intel x86 hardware. It now
xorg-server: runs on a wider range of hardware and OS platforms. This work was
xorg-server: derived by the X.Org Foundation from the XFree86 Project's XFree86
xorg-server: 4.4rc2 release. The XFree86 release was originally derived from X386
xorg-server: 1.2 by Thomas Roell which was contributed to X11R5 by Snitily Graphics
xorg-server: Consulting Service.
xorg-server:
xorg-server: The home page for the X project is: http://www.x.org
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
#sudo -S ln -sv Xorg $BUILD/$XORG_PREFIX/bin/X &&
sudo -S makepkg -l y -c n $PKGS/xorg-server-21.1.11-$PSUFFIX && \
cd /BMAN && \
cat > /tmp/slack-desc << "EOF"
xorg-server-doc: Manuals for xorg-server ( X11 core of the X Window System)
xorg-server-doc:
xorg-server-doc: A full featured X server that was originally designed for UNIX and
xorg-server-doc: UNIX-like operating systems running on Intel x86 hardware.
xorg-server-doc:
xorg-server-doc: http://www.x.org
xorg-server-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ && \
sudo -S makepkg -l y -c n $PKGS/xorg-server-doc-21.1.11-$NOPSUFFIX && \
sudo -S rm -rf ${BUILD}/* /BMAN/*