# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=wlroots
pkgver=0.18.0
pkgrel=1
pkgdesc="Modular Wayland compositor library"
url="https://gitlab.freedesktop.org/wlroots/wlroots"
license="MIT"
arch="all"
makedepends="
	eudev-dev
	glslang-dev
	hwdata-dev
	libcap-dev
	libdisplay-info-dev
	libinput-dev
	libseat-dev
	libxcb-dev
	libxkbcommon-dev
	mesa-dev
	meson
	ninja
	pixman-dev
	vulkan-loader-dev
	wayland-dev
	wayland-protocols
	xcb-util-image-dev
	xcb-util-renderutil-dev
	xcb-util-wm-dev
	xkeyboard-config-dev
	xwayland-dev
	"
# wlroots >= 0.18.0 does no longer ship a libwlroots.so symlink in the -dev
# subpackage. Hence, abuild's dependency tracing fails to identify that the
# -dev subpackage depends on the origin package and we need to add that
# manually. Otherwise, the wlroots shared object is not installed with -dev.
depends_dev="$pkgname=$pkgver-r$pkgrel"
subpackages="$pkgname-dbg $pkgname-dev"
source="https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/$pkgver/wlroots-$pkgver.tar.gz"
options="!check" # no test suite

build() {
	abuild-meson \
		-Db_lto=true \
		-Dexamples=false \
		. build
	meson compile -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
48140ddb0d41c1a056ce2fb7a5c7699433bd996010ed5cbefc4f6933cf727a85ba5eef68d7ea1904f3a5205a65519f30d051237b7c98e4754ab2eb09abf5b8f0  wlroots-0.18.0.tar.gz
"
