# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: team/gnome <pabloyoyoista@postmarketos.org>
pkgname=gnome-clocks
pkgver=48.0
pkgrel=0
pkgdesc="Clock application designed for GNOME 3"
url="https://apps.gnome.org/Clocks"
arch="all"
license="GPL-2.0-or-later"
depends="gsettings-desktop-schemas waked"
makedepends="
	desktop-file-utils
	geoclue-dev
	geocode-glib-dev>=3.26.4-r1
	gettext-dev
	glib-dev
	gnome-desktop-dev
	gsound-dev
	gtk4.0-dev
	itstool
	libgweather4-dev
	libadwaita-dev
	meson
	vala
	"
checkdepends="appstream-glib"
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/gnome-clocks/${pkgver%.*}/gnome-clocks-$pkgver.tar.xz
	0001-waked-support.patch
	0002-Add-argument-to-start-initial-instance-in-the-backgr.patch
	gnome-clocks.desktop
	"

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

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

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

	install -Dm644 "$srcdir"/gnome-clocks.desktop \
		"$pkgdir"/etc/xdg/autostart/gnome-clocks.desktop
}

sha512sums="
6bf6c4c4b8827ccf04df8bf899098145566eeb9bcd5d4df437ef2193fa7c56d7309ab9447cecdd7bec56c2a247b7ed93b1ae4b7a2d099f8fcf34151b4eb11ecb  gnome-clocks-48.0.tar.xz
3d15cbb38c749fc9d2731043346f450f7829244704157a02f5c0fb7131a9aaf90b57fab5a35dba0023bc1b774d2cb109629cb7c3fef25fe554a94162178bb4a9  0001-waked-support.patch
ffb93c5e5ff4f888c3e1308142af332f15293b84018b262398f7a41216bc1b91eb1c02bd551db079b4e35cca184c70462d8fa900a94f3afeadb033ff41046b55  0002-Add-argument-to-start-initial-instance-in-the-backgr.patch
c8439890965b8c81f61381559282935eafc86fcb6d3c537048ab9366249a3daabc50bce96218e2724e5740c06b029e3f9484977f615b0620117d333b0b010790  gnome-clocks.desktop
"
