# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: team/gnome <pabloyoyoista@postmarketos.org>
pkgname=mutter
pkgver=48.4
pkgrel=0
pkgdesc="clutter-based window manager and compositor"
url="https://wiki.gnome.org/Projects/Mutter/"
arch="all"
license="GPL-2.0-or-later"
depends="
	gnome-settings-daemon
	gsettings-desktop-schemas
	mutter-schemas
	xkeyboard-config
	"
makedepends="
	at-spi2-core-dev
	cairo-dev
	dbus-dev
	elogind-dev
	eudev-dev
	fribidi-dev
	gdk-pixbuf-dev
	glib-dev
	gnome-desktop-dev
	gnome-settings-daemon-dev
	gobject-introspection-dev
	graphene-dev
	gtk4.0-dev
	json-glib-dev
	lcms2-dev
	libcanberra-dev
	libdisplay-info-dev
	libdrm-dev
	libei-dev
	libgudev-dev
	libice-dev
	libinput-dev
	libsm-dev
	libwacom-dev
	libx11-dev
	libxau-dev
	libxcb-dev
	libxcomposite-dev
	libxcursor-dev
	libxdamage-dev
	libxext-dev
	libxfixes-dev
	libxi-dev
	libxinerama-dev
	libxkbcommon-dev
	libxkbfile-dev
	libxrandr-dev
	libxrender-dev
	libxtst-dev
	mesa-dev
	meson
	pango-dev
	pipewire-dev
	py3-argcomplete
	py3-docutils
	startup-notification-dev
	wayland-dev
	wayland-protocols
	xkeyboard-config-dev
	xwayland-dev
	"
options="!check" # Can't be run with release builds
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-lang $pkgname-schemas::noarch"
source="https://download.gnome.org/sources/mutter/${pkgver%%.*}/mutter-$pkgver.tar.xz
	fixudev-req.patch
	pcversion.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dudev=true \
		-Dnative_backend=true \
		-Dintrospection=true \
		-Dremote_desktop=true \
		-Dprofiler=false \
		-Dtests="$(want_check && echo enabled || echo disabled)" \
		. output
	meson compile -C output
}

schemas() {
	pkgdesc="Mutter schemas related files"
	depends=""

	amove usr/share/glib-2.0/schemas
	amove usr/share/GConf/gsettings
	amove usr/share/gnome-control-center/keybindings
}

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

sha512sums="
4275fc424240dd661766bf184b8ec4ec05f00d8637bdf3f745ccb5137d73fcc394696c06ae97f9ac95102a24c8910a4e67d09844db106779acfd89cbde226d79  mutter-48.4.tar.xz
60eb075a88ca301470130d17371c1410220be0c7d5a929f6b528ec838a1133ebccf46d29f448060043e94c2edf4615ae431927911bede1972ac37f04ff9f29b4  fixudev-req.patch
ec94fdecb7a3213903d013c1e6f48e02f8a1972ded16c3604627984cfce0936a0276d284c20e746eb91bf97249785bcf827f6fa55f1629e5290e19423d554e4d  pcversion.patch
"
