# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=polari
pkgver=46.0
pkgrel=1
pkgdesc="Polari is a simple IRC Client that is designed to integrate seamlessly with the GNOME graphical environment"
url="https://wiki.gnome.org/Apps/Polari"
arch="all !armhf !s390x" # limited by gjs
license="GPL-2.0-or-later"
# gtk+3.0 needed by thumbnailer, see https://gitlab.gnome.org/GNOME/polari/-/issues/223
# drop once that's handled
depends="libsecret libsoup3 gtk+3.0 dbus-glib telepathy-mission-control telepathy-idle"
makedepends="
	desktop-file-utils
	gjs-dev
	gobject-introspection-dev
	itstool
	libadwaita-dev
	meson
	telepathy-glib-dev
	tracker-dev
	"
checkdepends="appstream-glib tracker-testutils"
subpackages="$pkgname-lang $pkgname-doc"
source="https://gitlab.gnome.org/GNOME/polari/-/archive/$pkgver/polari-$pkgver.tar.gz"

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

check() {
	meson test --no-rebuild --print-errorlogs -C output
	LD_LIBRARY_PATH="$PWD/output/src" \
		meson devenv -C output polari --version # check for runtime dependencies
}

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

sha512sums="
2888adab7c8c696bcdd8cfd200475f2b0310c03dae91a63206e9492ef10316f3abf2d7233eff9f2355975b3d5e46db639a223b6fea8483258f7a18eb76cbd757  polari-46.0.tar.gz
"