# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: stef <l0ls0fo2i@ctrlc.hu>
# Contributor: Eivind Uggedal <eu@eju.no>
# Contributor: Nico Schottelius <nico.schottelius@ungleich.ch>
# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=mu
pkgver=1.12.6
pkgrel=0
pkgdesc="A collection of utilities for indexing and searching Maildirs"
url="https://www.djcbsoftware.nl/code/mu/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	emacs-nox
	glib-dev
	gmime-dev
	meson
	readline-dev
	texinfo
	xapian-core-dev
	"
subpackages="$pkgname-doc mu4e::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/djcb/mu/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	abuild-meson \
		-Dguile=disabled \
		-Dreadline=enabled \
		build
}

build() {
	ninja -C build
}

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

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

mu4e() {
	pkgdesc="Emacs-based e-mail client which uses mu as its back-end"
	depends="$pkgname=$pkgver-r$pkgrel cmd:emacs"

	amove usr/share/emacs
}

sha512sums="
dc491bd70a9d5f0843a969490bbde7c78ccde2cb49ae9b6f161571007762e03f418d70960a39dfb4b109d46128126553cbfb054d20996fa028ac98837de42495  mu-1.12.6.tar.gz
"
