aboutsummaryrefslogtreecommitdiffstats
path: root/community/notmuch/APKBUILD
blob: 8cd37832151b8b0f0feb174ac09b6394662474f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
# Maintainer: Stefan Wagner <stw@bit-strickerei.de>
pkgname=notmuch
pkgver=0.24.1
pkgrel=4
pkgdesc="E-Mail index, search and tagging"
url="https://notmuchmail.org/"
arch="all"
license="GPL3"
makedepends="gzip xapian-core-dev gmime-dev talloc-dev py-sphinx
	py-requests bash-completion"
checkdepends="sed coreutils diffutils bash tar mdocml grep"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-libs
	$pkgname-vim:vim:noarch
	$pkgname-emacs:emacs:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
source="https://notmuchmail.org/releases/$pkgname-$pkgver.tar.gz
	fix-tests.patch"

builddir="$srcdir/$pkgname-$pkgver"
build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--bashcompletiondir=/usr/share/bash-completion/completions \
		--zshcompletiondir=/usr/share/zsh/site-functions
	make PREFIX=/usr DESTDIR="$pkgdir"
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" \
		-C "$builddir" install
}

check() {
	cd "$builddir"/test
	make test-binaries

	local test=
	for test in T*.sh; do
		name="$(basename "$test")"
		case "${name%%.*}" in
		# Requires dtach ↦ doesn't work on the builders
		*emacs*|T355-smime|T350-crypto) continue ;;

		# XXX: Doesn't pass on the builders for some reason
		T140-excludes) continue ;;

		# FIXME: These should pass but currently don't
		T050-new|T150-tagging) continue ;;
		esac

		./${test}
	done
}

vim() {
	depends="vim notmuch"
	pkgdesc="Vim plugins for $pkgname"

	make -C "$builddir/vim" DESTDIR="$subpkgdir" \
		prefix="/usr/share/vim/vimfiles" install
}

emacs() {
	depends="emacs notmuch"
	pkgdesc="Emacs plugins for $pkgname"

	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/share/emacs/ "$subpkgdir"/usr/share/emacs/

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/notmuch-emacs-mua "$subpkgdir"/usr/bin/
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/
	mv "$pkgdir"/usr/share/bash-completion/completions/$pkgname \
		"$subpkgdir"/usr/share/bash-completion/completions/
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions/
	mv "$pkgdir"/usr/share/zsh/site-functions/_${pkgname} \
		"$subpkgdir"/usr/share/zsh/site-functions/
}

sha512sums="e2014380de68de3e1a3fd3058a441c6771a92bfffe07c0bd2b374802dd8b2539eddbbb91074738f58f48452a936f2f9427fadca825a165c61a27fe0c3e1fe7fc  notmuch-0.24.1.tar.gz
430e8f02b194b0582dfd7c66a2791a0071824e1d215993a6daf89c8d2a1ee7f73a6202136b1d890fc8920a4dc309ae976da8a8b8fc8b90e489d3c04f1592876c  fix-tests.patch"