# Template file for 'wayland'
pkgname=wayland
version=1.26.0
revision=1
build_style=meson
# "Tests must not be built with NDEBUG defined, they rely on assert()."
# documentation introduces build cycle. wayland -> graphviz -> gd -> libheif -> gdk-pixbuf -> tiff -> libwebp -> libfreeglut -> mesa -> wayland-protocols -> wayland
configure_args="-Ddocumentation=false -Db_ndebug=false"
hostmakedepends="flex pkg-config"
makedepends="expat-devel libffi-devel libfl-devel libxml2-devel"
short_desc="Core Wayland window system code and protocol"
maintainer="Érico Nogueira <ericonr@disroot.org>"
license="MIT"
homepage="https://wayland.freedesktop.org/"
distfiles="https://gitlab.freedesktop.org/wayland/wayland/-/releases/${version}/downloads/wayland-${version}.tar.xz"
checksum=64176eaa46e4969903e286f8e5ef8331affc17fdf03ac9b58381d2b23162b7a3

if [ "$XBPS_CHECK_PKGS" ]; then
	configure_args+=" -Dtests=true"
else
	configure_args+=" -Dtests=false"
fi

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" wayland-devel"
fi

post_install() {
	vlicense COPYING
}

wayland-devel_package() {
	depends="libffi-devel ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/bin
		vmove usr/include
		vmove usr/share/aclocal
		vmove usr/share/wayland
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
