# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnotify
pkgver=0.8.3
pkgrel=1
pkgdesc="Desktop notification library"
url="https://gitlab.gnome.org/GNOME/libnotify"
arch="all"
options="!check" # No tests defined when building with meson.
license="LGPL-2.1-or-later"
makedepends="
	dbus-dev
	docbook-xsl
	gdk-pixbuf-dev
	gobject-introspection-dev
	gtk+3.0-dev
	meson
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://download.gnome.org/sources/libnotify/${pkgver%.*}/libnotify-$pkgver.tar.xz
	docbook-url.patch
	"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dtests="$(want_check && echo true || echo false)"\
		-Dintrospection=enabled \
		-Dgtk_doc=false \
		-Dman=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="
e55073fdf418a4c04375825221edc92ab6a01201b83db2a1f1530f8f91f7da9da32327452b0785251790553517dcc717cfe623142450691b7dd247ec9164cffb  libnotify-0.8.3.tar.xz
0df7aeb5aa6688cc2272e5f1bb39f5ef2644d245c9d7bbbf54c0e1ecfe9621f08e6fc6f3489bafe5feff5452df00bd230bc457404390df242ee0a2a686005a5b  docbook-url.patch
"
