# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=file-roller
pkgver=44.5
pkgrel=0
pkgdesc="File Roller is an archive manager for the GNOME desktop "
url="https://wiki.gnome.org/Apps/FileRoller"
arch="all"
license="GPL-2.0-or-later"
depends="cpio"
depends_doc="yelp"
makedepends="
	desktop-file-utils
	glib-dev
	itstool
	json-glib-dev
	libadwaita-dev
	libarchive-dev
	libportal-dev
	meson
	nautilus-dev
	"
subpackages="$pkgname-lang $pkgname-doc $pkgname-nautilus"
source="https://download.gnome.org/sources/file-roller/${pkgver%.*}/file-roller-$pkgver.tar.xz"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dpackagekit=false \
		-Dcpio=/usr/bin/cpio \
		. output
	meson compile -C output
}

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

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

nautilus() {
	pkgdesc="File Roller nautilus extension"
	install_if="$pkgname=$pkgver-r$pkgrel nautilus",
	amove usr/lib/nautilus/extensions-4/libnautilus-fileroller.so
}

sha512sums="
a35aaf475ed86e23c6693eaccd21aa8e216e5996d4110c808e773e114f0db3db70678b3b96b27bce083beaa1bd527c52bd5841eb21ba7b195c4015f97aceeaf3  file-roller-44.5.tar.xz
"
