description="Run X clients under wayland"
url="https://xorg.freedesktop.org"

license="MIT"

packager="tnut <tnut@nutyx.org>"
contributors="Spiky"

makedepends=(meson xorgproto xorg-xtrans xorg-libxkbfile dbus xorg-font-util
             wayland wayland-protocols mesa xorg-libdrm systemd nettle xorg-pixman
             xorg-server libepoxy libxcvt xorg-libxfont2 libtirpc)
run=()

name=xorg-xwayland
version=24.1.3

source=(https://xorg.freedesktop.org/archive/individual/xserver/xwayland-$version.tar.xz)

prepare() {
    sed -i '/install_man/,$d' \
    xwayland-$version/meson.build
}
build() {
cd xwayland-$version
mkdir build
cd build

meson setup .. \
    --prefix=/usr  \
    -Dipv6=true \
    -Dxvfb=false \
    -Dxdmcp=false \
    -Dxcsecurity=true \
    -Ddri3=true \
    -Dglamor=true \
    -Dxkb_dir=/usr/share/X11/xkb \
    -Dxkb_output_dir=/var/lib/xkb
 
ninja

DESTDIR=$PKG ninja install      

rm -v $PKG/usr/share/man/man1/Xserver.1
rm -r $PKG/usr/lib/xorg

install -Dm644 ../COPYING $PKG/usr/share/licenses/$name/COPYING
}
