# $Id$ PNAME="xorg-server" PVER="1.20.5" PBUILD="r1" SPLIT_PACKAGES="xorg-server xephyr xdmx xnest xvfb" PCAT="x11-base" HOMEPAGE="http://xorg.freedesktop.org" # mesa sources are needed to compile opengl extensions MESA_PVER="19.2.1" MESA_SRCFILE="mesa-${MESA_PVER/_/-}.tar.xz" MESA_SRCDIR="${BUILDDIR}/mesa-${MESA_PVER/_/-}" PROVIDE="virtual/x11" # see hw/xfree86/common/xf86Module.h for ABI versions # or installed pkg-config file XORG_SERVER_PROVIDE="virtual/X-ABI-VIDEODRV-24.0 virtual/X-ABI-XINPUT-24.1 virtual/X-ABI-EXTENSION-10.0" # common depends COMMON_DEPEND=">= x11-libs/libXfont2-2.0 >= x11-libs/libXau-1.0.9 >= x11-libs/libXdmcp-1.1 >= x11-libs/pixman-0.38 >= media-libs/freetype-2.9 >= media-fonts/font-misc-misc-1 >= media-fonts/font-cursor-misc-1 >= app-crypt/libgcrypt-1.8 >= app-crypt/libgpg-error-1.36 >= sys-libs/libsystemd-242 >= sys-fs/udev-242 >= sys-apps/dbus-x11-1.10 >= sys-libs/libunwind-1.3 >= x11-libs/xcb-util-0.4.0 >= x11-libs/xcb-util-image-0.4.0 >= x11-libs/xcb-util-renderutil-0.3.9 >= x11-libs/xcb-util-keysyms-0.4.0 >= x11-libs/xcb-util-wm-0.4.1" LIBXEXT_DEPEND=">= x11-libs/libXext-1.3" LIBX11_DEPEND=">= x11-libs/libX11-1.6" LIBXI_DEPEND=">= x11-libs/libXi-1.7" MESA_DEPEND="== media-libs/mesa-${MESA_PVER}" EPOXY_DEPEND=">= media-libs/libepoxy-1.4" XORG_DEPEND="${COMMON_DEPEND} ${MESA_DEPEND} ${EPOXY_DEPEND} >= x11-libs/libxshmfence-1.3 >= x11-misc/xkeyboard-config-2.27 >= x11-apps/iceauth-1.0.8 >= x11-apps/rgb-1.0.6 >= x11-apps/xauth-1.1 >= x11-apps/xinit-1.4 >= x11-libs/libpciaccess-0.16" XEPHYR_DEPEND="${COMMON_DEPEND} ${LIBXEXT_DEPEND} ${LIBX11_DEPEND} ${LIBXI_DEPEND} ${MESA_DEPEND} ${EPOXY_DEPEND} >= x11-libs/libXv-1.0.11 >= x11-libs/libXmu-1.1" XNEST_DEPEND="${COMMON_DEPEND} ${LIBXEXT_DEPEND} ${LIBX11_DEPEND}" XDMX_DEPEND="${COMMON_DEPEND} ${LIBXEXT_DEPEND} ${LIBX11_DEPEND} ${LIBXI_DEPEND} >= x11-libs/libdmx-1.1.4 >= x11-libs/libXaw-1.0.13 >= x11-libs/libXfixes-5 >= x11-libs/libXrender-0.9.10" XVFB_DEPEND="${COMMON_DEPEND}" SDEPEND="${XORG_DEPEND} ${KDRIVE_DEPEND} ${XEPHYR_DEPEND} ${XNEST_DEPEND} ${XDMX_DEPEND} ${XVFB_DEPEND} >= media-fonts/font-util-1.3 == x11-proto/xorg-protos-7.7.${PVER} >= x11-libs/libdrm-2.4.100 >= x11-libs/libXtst-1.2 >= x11-libs/libXres-1.2 >= x11-libs/xcb-util-image-0.4 >= x11-libs/xcb-util-keysyms-0.4 >= x11-libs/xcb-util-wm-0.3.9 >= x11-libs/libxkbfile-1.1" SPECIAL_FUNCTIONS="preinstall_complain_about_deprecated_packages" UP2SUBDIR="xserver" sminclude xorg mtools SRC_URI=( ${SRC_URI[*]} mirror://${PNAME}/${SRCFILE} ftp://ftp.freedesktop.org/pub/mesa/${MESA_PVER}/${MESA_SRCFILE} ftp://ftp.freedesktop.org/pub/mesa/${MESA_SRCFILE} mirror://mesa/${MESA_SRCFILE} mirror://${PNAME}/xvfb-run mirror://${PNAME}/xvfb-run.1 mirror://${PNAME}/${PNAME}-1.12.3-die-ugly-pattern-die-die-die.patch ) split_info_xorg-server() { DESCRIPTION="Modular X.Org X Server." DEPEND="${XORG_DEPEND}" PROVIDE+=" ${XORG_SERVER_PROVIDE}" } split_info_xephyr() { DESCRIPTION="A nested X11 server with opengl support." DEPEND="${XEPHYR_DEPEND}" } split_info_xnest() { DESCRIPTION="A nested X11 server." DEPEND="${XNEST_DEPEND}" } split_info_xdmx() { DESCRIPTION="A distributed multihead X11 Server." DEPEND="${XDMX_DEPEND}" } split_info_xvfb() { DESCRIPTION="A virtual framebuffer X11 server." DEPEND="${XVFB_DEPEND}" } preinstall_complain_about_deprecated_packages() { if [[ ! -z $(magequery -n glamor-egl) ]] then echo -e ${COLRED} echo -e "Error: x11-libs/glamor-egl is installed!!" echo -e "glamor-egl is now provided by xorg-server and doesn't need an extra package anymore." echo -e "Please uninstall x11-libs/glamor-egl first!" echo -e ${COLDEFAULT} die "x11-libs/glamor-egl found!" fi if [[ ! -z $(magequery -n xf86-video-modesetting) ]] then echo -e ${COLRED} echo -e "Error: x11-drivers/xf86-video-modesetting is installed!!" echo -e "xf86-video-modesetting is now provided by xorg-server and doesn't need an extra package anymore." echo -e "Please uninstall x11-drivers/xf86-video-modesetting first!" echo -e ${COLDEFAULT} die "x11-drivers/xf86-video-modesetting found!" fi } pkg_setup() { preinstall_complain_about_deprecated_packages } src_prepare() { munpack ${SRCFILE} || die munpack ${MESA_SRCFILE} || die cd ${SRCDIR} # adopted from redhat; use a black background mpatch ${PNAME}-1.12.3-die-ugly-pattern-die-die-die.patch || die # fix build issues, some wrapper files which should be generated # at build time exist and the makefile doesn't whipe them. we patch # the makefile to clean them and whipe these wrapper files rm -f ${SRCDIR}/hw/xprint/*-wrapper.c || die # fix xorg.conf.d location sed -i 's:^\(@CONFIG_UDEV_TRUE@xorgconfddir =\).*:\1 $(sysconfdir)/X11/$(XF86CONFIGDIR):' config/Makefile.in || die sed -i 's:^\(xorgconfddir =\).*: \1$(sysconfdir)/X11/$(XF86CONFIGDIR):' config/Makefile.am || die # fix build with libglvnd, which provides the api version (1.2) # see: https://gitlab.freedesktop.org/xorg/xserver/commit/e6ef2b12404dfec7f23592a3524d2a63d9d25802?merge_request_iid=292 sed -i 's:\(LIBGL=\).*:\1"1.2":g' configure.ac || die mautoreconf || die } src_compile() { cd ${SRCDIR} xorg_src_configure \ --with-mesa-source=${MESA_SRCDIR} \ --sysconfdir=/etc \ --localstatedir=/var \ --libexecdir=/usr/$(mlibdir)/${PNAME} \ --with-xkb-output=/var/lib/xkb \ --with-default-font-path=/usr/share/fonts/misc,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/TTF,/usr/share/fonts/Type1 \ --disable-install-setuid \ --enable-suid-wrapper \ --enable-ipv6 \ --enable-xorg \ --enable-kdrive \ --enable-xephyr \ --enable-dmx \ --enable-xvfb \ --enable-xnest \ --enable-dri \ --enable-dri2 \ --enable-dri3 \ --enable-glamor \ --enable-xtrap \ --enable-xevie \ --enable-xcsecurity \ --enable-libunwind \ --disable-xprint \ --enable-glx-tls \ --disable-static \ --disable-config-dbus \ --disable-config-hal \ --enable-config-udev \ --enable-kdrive-kbd \ --enable-kdrive-mouse \ --enable-kdrive-evdev \ --enable-systemd-logind \ --with-sha1=libgcrypt \ || die mmake || die } src_install_xorg-server() { xorg_src_install || die # needed directories minstalldir /usr/bin || die # missing symlink mlink Xorg /usr/bin/X || die # remove stuff included in other packages # xephyr mdelete /usr/bin/Xephyr || die mdelete /usr/share/man/man1/Xephyr.1 || die # xnest mdelete /usr/bin/Xnest || die mdelete /usr/share/man/man1/Xnest.1 || die # xdmx mdelete /usr/bin/Xdmx || die mdelete /usr/share/man/man1/Xdmx.1 || die mdelete /usr/bin/dmxaddinput || die mdelete /usr/bin/dmxaddscreen || die mdelete /usr/bin/dmxreconfig || die mdelete /usr/bin/dmxresize || die mdelete /usr/bin/dmxrminput || die mdelete /usr/bin/dmxrmscreen || die mdelete /usr/bin/dmxwininfo || die mdelete /usr/bin/dmxinfo || die mdelete /usr/bin/dmxtodmx || die mdelete /usr/share/man/man1/dmxtodmx.1 || die mdelete /usr/bin/vdltodmx || die mdelete /usr/share/man/man1/vdltodmx.1 || die mdelete /usr/bin/xdmxconfig || die mdelete /usr/share/man/man1/xdmxconfig.1 || die # xvfb mdelete /usr/bin/Xvfb || die mdelete /usr/share/man/man1/Xvfb.1 || die } src_install_xephyr() { cd ${SRCDIR} minstallexec hw/kdrive/ephyr/Xephyr || die minstallman hw/kdrive/ephyr/man/Xephyr.1 || die # # suid all tinyX servers # mchmod 4755 /usr/bin/X\* || die # needed directory mkeepdir /usr/share/X11/xkb/compiled || die } src_install_xnest() { cd ${SRCDIR} minstallexec hw/xnest/Xnest || die minstallman hw/xnest/man/Xnest.1 || die # needed directory mkeepdir /usr/share/X11/xkb/compiled || die } src_install_xdmx() { cd ${SRCDIR} minstallexec hw/dmx/Xdmx || die minstallman hw/dmx/man/Xdmx.1 || die minstallexec hw/dmx/examples/dmxaddinput || die minstallexec hw/dmx/examples/dmxaddscreen || die minstallexec hw/dmx/examples/dmxreconfig || die minstallexec hw/dmx/examples/dmxresize || die minstallexec hw/dmx/examples/dmxrminput || die minstallexec hw/dmx/examples/dmxrmscreen || die minstallexec hw/dmx/examples/dmxwininfo || die minstallexec hw/dmx/examples/dmxinfo || die minstallexec hw/dmx/config/dmxtodmx || die minstallman hw/dmx/config/man/dmxtodmx.1 || die minstallexec hw/dmx/config/vdltodmx || die minstallman hw/dmx/config/man/vdltodmx.1 || die minstallexec hw/dmx/config/xdmxconfig || die minstallman hw/dmx/config/man/xdmxconfig.1 || die # needed directory mkeepdir /usr/share/X11/xkb/compiled || die } src_install_xvfb() { cd ${SRCDIR} minstallexec hw/vfb/Xvfb || die minstallman hw/vfb/man/Xvfb.1 || die # xvfb-run script to ease things minstallexec -s xvfb-run || die minstallman ${SOURCEDIR}/$(mpname)/xvfb-run.1 || die # needed directory mkeepdir /usr/share/X11/xkb/compiled || die } preinstall_xorg-server() { preinstall_complain_about_deprecated_packages # fix some deprecated symlinks from ancient xorg-1.5 servers # or deprecated dynamic opengl symlinks in favor of libglvnd if [ -L ${MROOT}/usr/$(mlibdir)/xorg/modules/extensions/libdri.so ] then rm ${MROOT}/usr/$(mlibdir)/xorg/modules/extensions/libdri.so fi if [ -f ${MROOT}/usr/$(mlibdir)/opengl/xorg/extensions/libdri.so ] then rm ${MROOT}/usr/$(mlibdir)/opengl/xorg/extensions/libdri.so fi if [ -L ${MROOT}/usr/$(mlibdir)/xorg/modules/extensions/libglx.so ] then rm ${MROOT}/usr/$(mlibdir)/xorg/modules/extensions/libglx.so fi if [ -f ${MROOT}/usr/$(mlibdir)/opengl/xorg/extensions/libglx.so ] then rm ${MROOT}/usr/$(mlibdir)/opengl/xorg/extensions/libglx.so fi } postinstall_xorg-server() { # provided by xf86-input-evdev now if [ -f ${MROOT}/etc/X11/xorg.conf.d/10-evdev.conf ] then rm ${MROOT}/etc/X11/xorg.conf.d/10-evdev.conf fi echo "Searching deprecated package 'opengl-update'..." if [[ ! -z $(magequery -n opengl-update) ]] then echo "Uninstalling deprecated package 'opengl-update'..." mage uninstall opengl-update fi }