# Contributor: Sören Tempel # Contributor: Stefan Wagner # Maintainer: Stefan Wagner pkgname=notmuch pkgver=0.28 pkgrel=1 pkgdesc="E-Mail index, search and tagging" url="https://notmuchmail.org/" arch="all" license="GPL-3.0" makedepends="gzip xapian-core-dev gmime-dev talloc-dev py-sphinx py-requests python2-dev python3-dev bash-completion" checkdepends="sed coreutils diffutils bash tar mdocml grep perl" subpackages=" py2-$pkgname:py2 py3-$pkgname:py3 $pkgname-dev $pkgname-doc $pkgname-libs $pkgname-emacs:emacs:noarch $pkgname-vim:vim: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" PYTHON=python3 ./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" cd "$builddir"/bindings/python python2 setup.py build python3 setup.py build } 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 T050-new|T140-excludes) continue ;; # FIXME: These should pass but currently don't T150-tagging|T060-count|T070-insert|T357-index-decryption) 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/ rm -rf "$pkgdir"/usr/share/bash-completion } 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/ rm -rf "$pkgdir"/usr/share/zsh } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir"/bindings/python $python setup.py install --prefix=/usr --root="$subpkgdir" } py2() { _py python2 } py3() { _py python3 } sha512sums="56c8e6b742990b5b1d5b8d12146cc9eb710c6b216c876fd3824cc88b9051fef8251f53809ba39cd2f0fbd5e4ccee9ddedc7a602e3584d8a158abe4f2a094242f notmuch-0.28.tar.gz 582484067b5899ec74f82c29b32b459670fc752365b9c09392b44538921aa6b106f56350d18d12cf51bfeac1a02b79c9026057111a7aa2016c75345e19e96da4 fix-tests.patch"