summaryrefslogtreecommitdiff
path: root/user/notmuch/APKBUILD
blob: b585d685f10547de8bd601bff00d0c86cd7d817e (plain) (blame)
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
# Contributor: Luis Ressel <aranea@aixah.de>
# Maintainer: Luis Ressel <aranea@aixah.de>
pkgname=notmuch
pkgver=0.28.4
pkgrel=0
pkgdesc="Thread-based email index, search and tagging"
url="https://notmuchmail.org/"
arch="all"
license="GPL-3.0+"
depends=""
depends_dev="gmime-dev talloc-dev xapian-core-dev zlib-dev"
makedepends="$depends_dev doxygen emacs python3-dev ruby-dev"
checkdepends="bash dtach gnupg"
subpackages="$pkgname-dev $pkgname-doc $pkgname-emacs py3-$pkgname:_py ruby-$pkgname:_rb $pkgname-bash-completion:bashcomp:noarch $pkgname-zsh-completion:zshcomp:noarch"
source="https://notmuchmail.org/releases/notmuch-$pkgver.tar.gz
	0.28.2-disable-rpath.patch"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--without-bash-completion \
		--without-desktop \
		--without-rpath
	make

	cd bindings/python
	python3 setup.py build
}

check() {
	cd "$builddir"
	# config, regexp-query: musl issues, TODO: Fixed in master
	# atomicity, count, new, insert: gdb-based tests which fail randomly on some arches, with some CFLAGS, or during some moon phases
	NOTMUCH_SKIP_TESTS="config regexp-query atomicity count new insert" make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

doc() {
	default_doc
	# TODO: We'd need sphinx to generate the man pages, but the raw *.rst's are still better than no docs at all.
	mkdir -p "$subpkgdir/usr/share/doc/$pkgname" "$builddir/doc/man"*
	cp -r "$builddir/doc/man"* "$subpkgdir/usr/share/doc/$pkgname/"
}

emacs() {
	mkdir -p "$subpkgdir/usr/bin" "$subpkgdir/usr/share"
	mv "$pkgdir/usr/bin/notmuch-emacs-mua" "$subpkgdir/usr/bin"
	mv "$pkgdir/usr/share/emacs" "$subpkgdir/usr/share"
}

_py() {
	pkgdesc="$pkgdesc (Python bindings)"
	depends="$pkgname=$pkgver-r$pkgrel python3"

	cd "$builddir/bindings/python"
	python3 setup.py install --prefix=/usr --root="$subpkgdir"
}

_rb() {
	pkgdesc="$pkgdesc (Ruby bindings)"
	depends="$pkgname=$pkgver-r$pkgrel ruby"

	cd "$builddir/bindings/ruby"
	make DESTDIR="$subpkgdir" install
}


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

	install -Dt "$subpkgdir/usr/share/bash-completion" "$builddir/completion/notmuch-completion.bash"
}

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

	mkdir -p "$subpkgdir/usr/share"
	mv "$pkgdir/usr/share/zsh" "$subpkgdir/usr/share"
}

sha512sums="77d7ad81e1f7dc93ae6392346da434f6dc74c21d19be728c2a6ca283c429f36e7081387d223af58eb5f63f5d2a8ad8367f0103f0bb9d052890c07fe419abbee7  notmuch-0.28.4.tar.gz
b2991ee5edf927f04d904d99888dbce17a98e9d4d7d809bc2248f45d214025f4a1632b19e4fbca2b08e99721ec8a7eea82384c5c718206884801c7bfa5a8c540  0.28.2-disable-rpath.patch"