PKGNAME=xorg-server
PKGSEC=x11
PKGDEP="xkeyboard-config x11-app x11-lib libdrm pixman mesa libgcrypt \
        libepoxy xcb-util-renderutil x11-proto xcb-util-image \
        xcb-util-keysyms xcb-util-wm x11-app x11-font libunwind libxcvt"
PKGDEP__RISCV64="${PKGDEP/libunwind/}"
PKGDEP__ARM64="${PKGDEP/libunwind/}"
BUILDDEP="wayland"
PKGDES="X.Org display server"

ABTYPE=meson
MESON_AFTER=(
    '-Dipv6=true'
    '-Ddri1=true'
    '-Ddri3=true'
    '-Dxvfb=true'
    '-Dxnest=true'
    '-Dxcsecurity=true'
    '-Dxorg=true'
    '-Dxephyr=true'
    '-Dglamor=true'
    '-Dudev=true'
    '-Dsystemd_logind=true'
    '-Dlibunwind=true'
    '-Dsuid_wrapper=true'
    '-Dsha1=libgcrypt'
    '-Dxkb_dir=/usr/share/X11/xkb'
    '-Dxkb_output_dir=/var/lib/xkb'
    '-Ddefault_font_path=/usr/share/fonts'
)
MESON_AFTER__RISCV64=(
    "${MESON_AFTER[@]}"
    '-Dlibunwind=false'
)
MESON_AFTER__ARM64=(
    "${MESON_AFTER[@]}"
    '-Dlibunwind=false'
)

PKGDEP__RETRO="xkeyboard-config x11-app x11-lib libdrm pixman \
               xcb-util-renderutil xcb-util-image xcb-util-keysyms \
               xcb-util-wm libgcrypt libepoxy mesa libxcvt"
PKGDEP__ARMV4="${PKGDEP__RETRO} libepoxy"
PKGDEP__ARMV6HF="${PKGDEP__RETRO} libepoxy"
PKGDEP__ARMV7HF="${PKGDEP__RETRO} libepoxy"
PKGDEP__I486="${PKGDEP__RETRO} libepoxy libunwind"
BUILDDEP__RETRO="x11-font mesa"

MESON_AFTER__RETRO=(
    '-Dipv6=false'
    '-Ddri1=true'
    '-Ddri2=true'
    '-Ddri3=true'
    '-Dxvfb=false'
    '-Dxnest=false'
    '-Dxcsecurity=true'
    '-Dxorg=true'
    '-Dxephyr=false'
    '-Dglamor=false'
    '-Dudev=true'
    '-Dsystemd_logind=false'
    '-Dsuid_wrapper=true'
    '-Dsha1=libgcrypt'
    '-Dxkb_dir=/usr/share/X11/xkb'
    '-Dxkb_output_dir=/var/lib/xkb'
    '-Ddefault_font_path=/usr/share/fonts'
)
MESON_AFTER__ARMV4=(
    "${MESON_AFTER__RETRO[@]}"
)
MESON_AFTER__ARMV6HF=(
    "${MESON_AFTER__RETRO[@]}"
    '-Dglamor=true'
)
MESON_AFTER__ARMV7HF=(
    "${MESON_AFTER__RETRO[@]}"
    '-Dglamor=true'
)

PKGBREAK="nvidia<=375.10 virtualbox<=6.1.30 xf86-input-acecad<=1.5.0-6 \
          xf86-input-elographics<=1.4.2 xf86-input-evdev<=2.10.6-1 \
          xf86-input-joystick<=1.6.3-1 xf86-input-keyboard<=1.9.0-1 \
          xf86-input-libinput<=0.30.0 xf86-input-mouse<=1.9.3-1 \
          xf86-input-synaptics<=1.9.1-2 xf86-input-vmmouse<=13.1.0-3 \
          xf86-input-wacom<=0.40.0 xf86-video-amdgpu<=19.1.0-1 \
          xf86-video-armsoc<=1.4.1-3 \
          xf86-video-chips<=1.4.0-1 \
          xf86-video-ati<=19.1.0-3 \
          xf86-video-dummy<=0.3.8-1 \
          xf86-video-fbdev<=0.5.0-3 xf86-video-fbturbo<=20151006-3 \
          xf86-video-mach64<=6.9.6-1 \
          xf86-video-neomagic<=1.3.0-1 \
          xf86-video-intel<=1:20191127-2 \
          xf86-video-nouveau<=1.0.16-1 \
          xf86-video-qxl<=0.1.5-2 \
          xf86-video-siliconmotion<=1.7.9-8 \
          xf86-video-vboxvideo<=1.0.0-1 \
          xf86-video-vesa<=2.4.0-2 \
          xf86-video-vmware<=13.3.0-1"
PKGCONFL="xf86-video-modesetting<=0.9.0-1"
PKGREP="xf86-video-modesetting<=0.9.0-1"

AB_FLAGS_RRO=0
AB_FLAGS_NOW=0
AB_FLAGS_O3=1

RECONF=0

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
