# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=glycin-loaders
pkgver=1.2.2
pkgrel=0
pkgdesc="Sandboxed and extendable image decoding"
url="https://gitlab.gnome.org/sophie-h/glycin"
# s390x: libjxl (previously: https://github.com/nix-rust/nix/issues/1968)
arch="all !s390x"
license="MPL-2.0 OR LGPL-2.0-or-later"
depends="bubblewrap"
makedepends="
	cargo
	clang19-dev
	cmake
	gobject-introspection-dev
	gtk4.0-dev
	lcms2-dev
	libheif-dev
	libjxl-dev
	librsvg-dev
	libseccomp-dev
	meson
	vala
	"
subpackages="$pkgname-dev"
source="https://gitlab.gnome.org/sophie-h/glycin/-/archive/$pkgver/glycin-$pkgver.tar.gz"
builddir="$srcdir/glycin-$pkgver"
# !check: tests hang
# net: cargo crates
options="!check net"

provides="glycin=$pkgver-r$pkgrel" # for backward compatibility
replaces="glycin" # for backward compatibility

build() {
	abuild-meson \
		-Dtest_skip_install=true \
		. output
	meson compile -C output
}

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

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

sha512sums="
5239e12ab812e3bcd795da5cd1a5d63f7181362640688523b2372199777950248ec5fd003618fe1d725774f6ad51c827e5c59f6a7c1d08c1ecc68afcb23916d7  glycin-1.2.2.tar.gz
"
