# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=desktop-file-utils
pkgver=0.27
pkgrel=0
pkgdesc="Command line utilities for working with desktop entries"
url="https://www.freedesktop.org/wiki/Software/desktop-file-utils"
arch="all"
license="GPL-2.0-or-later"
makedepends="glib-dev gettext-dev meson"
subpackages="$pkgname-doc $pkgname-emacs::noarch"
triggers="$pkgname.trigger=/usr/share/applications"
source="https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-$pkgver.tar.xz"

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

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

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

emacs() {
	pkgdesc="Emacs mode for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel emacs"

	amove usr/share/emacs
}

sha512sums="
81356239a92fb17885aa85a5192c84c2757ebb2e540920d0d41d07035795f08f4162f41b1a87bb2bfcf70ec61f19f1f158e4395a359f46b46f68cb9e24f259a8  desktop-file-utils-0.27.tar.xz
"
