# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=wlroots
pkgver=0.18.2
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
	lcms2-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-static $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 \
		-Dcolor-management=enabled \
		-Ddefault_library=both \
		. build
	meson compile -C build
}

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

sha512sums="
59b0889f65e9cd914273c87a6547fa865577c34e26ddb178974be665721ac77d7146b0f45f341b64a44eb4b0bd689fab16d7972130eac443260181ff2b5a9ef7  wlroots-0.18.2.tar.gz
"
