# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gpaste
pkgver=45.1
pkgrel=0
pkgdesc="Clipboard managment system"
url="https://github.com/Keruspe/GPaste"
# armhf: limited by gjs
# s390x: limited by gnome-control-center
arch="all !armhf !s390x"
license="BSD-2-Clause"
makedepends="
	appstream-glib-dev
	dbus-dev
	desktop-file-utils
	gcr4-dev
	gjs-dev
	gnome-control-center-dev
	gtk+3.0-dev
	libadwaita-dev
	meson
	vala
	"
subpackages="
	$pkgname-dev
	$pkgname-lang
	$pkgname-doc
	$pkgname-gnome:_gnome:noarch
	$pkgname-bash-completion:bashcomp
	$pkgname-zsh-completion:zshcomp
	"
source="gpaste-$pkgver.tar.gz::https://github.com/Keruspe/GPaste/archive/v$pkgver.tar.gz
	gcc14-32-bit.patch
	"
builddir="$srcdir/GPaste-$pkgver"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsystemd=false \
		-Dintrospection=true \
		-Dvapi=true \
		. output
	meson compile -C output
}

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

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

_gnome() {
	install_if="$pkgname=$pkgver-r$pkgrel gnome-shell gnome-control-center"
	depends="gnome-control-center"

	amove usr/share/gnome-shell
	amove usr/share/gnome-control-center
}

sha512sums="
c6ec0959d70d20239f6b2272bb3ab6d8250ece8f1759cb12b14b5d1a4c2685cbc1dbdac88ad5d0979bc2585c4e66bb4af0e243eda340fcc01b7f2b9c9b21358f  gpaste-45.1.tar.gz
61fcf8a38ccd50ebd59cd933c2fad806eda56af4b57f8e688add8772276f59b62b81a8e448c91a924b8c6789710e643e52391ebc068e5cbf7671b502748c55ab  gcc14-32-bit.patch
"
