# $Id$ PNAME="xorg-server" PVER="1.20.0" PBUILD="r1" SPLIT_PACKAGES="xorg-server kdrive xephyr xdmx xnest xvfb" PCAT="x11-base" HOMEPAGE="http://xorg.freedesktop.org" # mesa sources are needed to compile opengl extensions MESA_PVER="18.1.0" 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-23 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.8 >= x11-libs/libXdmcp-1.1 >= x11-libs/pixman-0.34 >= 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.21 >= sys-libs/libsystemd-238 >= sys-fs/udev-238 >= sys-apps/dbus-x11-1.10 >= sys-libs/libunwind-1.1 >= 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.23 >= x11-apps/iceauth-1.0.8 >= x11-apps/rgb-1.0.6 >= x11-apps/xauth-1.0.10 >= x11-apps/xinit-1.4 >= x11-base/opengl-update-2.3.12 >= x11-libs/libpciaccess-0.14" KDRIVE_DEPEND="${COMMON_DEPEND}" 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.92 >= 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" 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} #sourceforge://mesa3d/${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 mirror://${PNAME}/${PNAME}-1.12.3-kdrive-default-mode.patch #mirror://${PNAME}/${PNAME}-1.12.3-kdrive-evdev-with-valid-mouse-devices.patch ) split_info_xorg-server() { DESCRIPTION="Modular X.Org X Server." DEPEND="${XORG_DEPEND}" PROVIDE+=" ${XORG_SERVER_PROVIDE}" } split_info_kdrive() { DESCRIPTION="Tiny X.Org X Server." DEPEND="${KDRIVE_DEPEND}" } 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 # must use mesa as opengl-headers! if [[ $(opengl-update --get-implementation) != xorg ]] then die "please change to xorg opengl-headers: opengl-update xorg" fi } 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 kdrive default mode -> use 640x480@60hz instead of 800x600@75hz mpatch ${PNAME}-1.12.3-kdrive-default-mode.patch || die # fix new evdev event devices (event4 and event5) #mpatch ${PNAME}-1.12.3-kdrive-evdev-with-valid-mouse-devices.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 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 minstalldir /usr/$(mlibdir)/opengl/xorg/extensions || die # dynamic opengl setup local i for i in ${BINDIR}/usr/$(mlibdir)/xorg/modules/libglx* \ ${BINDIR}/usr/$(mlibdir)/xorg/modules/libdri* do if [ -f ${i} -o -L ${i} ] then mv -f ${i} ${BINDIR}/usr/$(mlibdir)/opengl/xorg/extensions || die "${i}" fi done # missing symlink mlink Xorg /usr/bin/X || die # remove stuff included in other packages # xfbdev mdelete /usr/bin/Xfbdev || die # 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_kdrive() { cd ${SRCDIR} minstallexec hw/kdrive/fbdev/Xfbdev || die #minstallman hw/kdrive/fbdev/Xfbdev.1 || die # # suid all tinyX servers # mchmod 4755 /usr/bin/X\* || die # needed directory mkeepdir /usr/share/X11/xkb/compiled || 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 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 ${MROOT}/usr/sbin/opengl-update --use-old xorg } postremove_xorg-server() { # get rid of module dir to ensure opengl-update works properly if [ -e ${MROOT}/usr/$(mlibdir)/xorg/modules ] then if [[ -z $(magequery -n xorg-server) ]] then rm -rf ${MROOT}/usr/$(mlibdir)/xorg/modules fi fi }