# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=glycin-loaders
pkgver=1.1.6
pkgrel=0
pkgdesc="Sandboxed and extendable image decoding"
url="https://gitlab.gnome.org/sophie-h/glycin"
# s390x: https://github.com/nix-rust/nix/issues/1968
# loongarch64: libc crate fails to build
arch="all !s390x !loongarch64"
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 --no-rebuild --print-errorlogs -C output
}

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

sha512sums="
a554b4e6ef7a7ddce0802ec92450d441ff52b8986f5bec1d28157f7ea32e1594f19c5c036059a5f6f39a2d7228712702cf237a30816d6fac4b2257a9a74fbbca  glycin-1.1.6.tar.gz
"
