# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: team/gnome <knuxify@gmail.com>
pkgname=xdg-desktop-portal-gnome
pkgver=48.0
pkgrel=0
pkgdesc="backend implementation for xdg-desktop-portal for the GNOME desktop environment"
url="https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome"
arch="all"
license="LGPL-2.1-or-later"
depends="
	nautilus
	xdg-desktop-portal
	xdg-desktop-portal-gtk
	"
makedepends="
	gnome-desktop-dev
	gsettings-desktop-schemas-dev
	gtk4.0-dev
	libadwaita-dev
	meson
	xdg-desktop-portal-dev
	"
subpackages="$pkgname-lang"
source="https://download.gnome.org/sources/xdg-desktop-portal-gnome/${pkgver%.*}/xdg-desktop-portal-gnome-$pkgver.tar.xz
	gsettings-desktop-schemas-dep.patch
	"
options="!check"  # no tests

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsystemduserunitdir=/DELETEME \
	.  output
	meson compile -C output
}

check() {
	meson test --print-errorlogs -C output
}

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

sha512sums="
82efcee0799ece8a5bc7bdf1fcfeed46757a42e4d009fc7a6e8615707f698294708bac411d7651c8e387716d5ad8791565a796936bf231f9b55b3d720dae522a  xdg-desktop-portal-gnome-48.0.tar.xz
5414b5b647d78d4a5d2f97483902dc7f54e1f4c5b9f5a73a3113aa0a7f235a32e0c0a3f0577bd31e82246f1106b30972229b7e15440946aaee641e3c8f6ae017  gsettings-desktop-schemas-dep.patch
"
