void-packages/srcpkgs/notmuch/template
Đoàn Trần Công Danh 81c3c1884b notmuch: update to 0.30.
Close #23874
2020-07-29 21:49:42 +07:00

132 lines
3.5 KiB
Bash

# Template file for 'notmuch'
pkgname=notmuch
version=0.30
revision=1
hostmakedepends="perl pkg-config python3-Sphinx python3-devel texinfo"
makedepends="bash-completion gmime3-devel talloc-devel xapian-core-devel
python3-cffi python3-setuptools gnupg2"
depends="gmime3>=3.2.7"
checkdepends="python3-pytest mdocml dtach gdb tar xz"
short_desc="Thread-based email index, search, and tagging"
maintainer="Jan S. <jan.schreib@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://notmuchmail.org"
distfiles="https://notmuchmail.org/releases/notmuch-${version}.tar.xz
https://notmuchmail.org/releases/test-databases/database-v1.tar.xz"
checksum="5e3baa6fe11d65c67e26ae488be11b320bae04e336acc9c64621f7e3449096fa
4299e051b10e1fa7b33ea2862790a09ebfe96859681804e5251e130f800e69d2"
skip_extraction="database-v1.tar.xz"
# Not a real conflicts, but this package is broken with gpgme 1.13.1-
# gpgme is optional dependency
conflicts="gpgme<1.14.0_1"
subpackages="libnotmuch libnotmuch-devel notmuch-mutt notmuch-python3"
patch_args=-Np1
if [ ! "$CROSS_BUILD" ]; then
hostmakedepends+=" desktop-file-utils"
makedepends+=" ruby-devel emacs"
subpackages+=" notmuch-ruby notmuch-emacs"
_args="--emacslispdir=/usr/share/emacs/site-lisp/notmuch
--emacsetcdir=/usr/share/emacs/site-lisp/notmuch"
else
_args="--without-emacs"
fi
do_configure() {
ln -sf /usr/bin/gpg2 $XBPS_WRAPPERDIR/gpg
./configure --prefix=/usr \
--bashcompletiondir=/usr/share/bash-completion/completions \
--zshcompletiondir=/usr/share/zsh/site-functions ${_args}
}
do_build() {
make ${makejobs}
make -C contrib/notmuch-mutt
cd bindings/python
python3 setup.py build --build-base=build
}
do_check() {
# We want wrapper-dirs included for gpg being gpg2
# But we don't want to use date wrapper in check
unset SOURCE_DATE_EPOCH
PATH=$XBPS_WRAPPERDIR:$PATH
cp $XBPS_SRCDISTDIR/notmuch-$version/database-v1.tar.xz \
test/test-databases
# 2 tests is failing on musl
# glibc is clean
make test
}
do_install() {
make DESTDIR=${DESTDIR} install
pushd bindings/python
python3 setup.py build --build-base=build \
install --prefix=/usr --root=${DESTDIR}
popd
if [ ! "$CROSS_BUILD" ]; then
make DESTDIR=${DESTDIR} -C bindings/ruby install
fi
}
post_install() {
rm -f ${DESTDIR}/usr/share/applications/mimeinfo.cache
}
libnotmuch_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove usr/lib/*.so.*
}
}
libnotmuch-devel_package() {
short_desc+=" - development files"
depends="libnotmuch-${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/*.so
}
}
notmuch-emacs_package() {
archs=noarch
short_desc+=" - Emacs interface"
depends="${sourcepkg}-${version}_${revision} virtual?emacs"
pkg_install() {
vmove usr/bin/notmuch-emacs-mua
vmove usr/share/applications
vmove usr/share/emacs/site-lisp
vmove usr/share/info/notmuch-emacs*
vmove usr/share/man/man1/notmuch-emacs*
}
}
notmuch-mutt_package() {
archs=noarch
short_desc+=" - Mutt interface"
depends="${sourcepkg}-${version}_${revision} perl-Mail-Box perl-MailTools
perl-String-ShellQuote perl-Term-ReadLine-Gnu perl-File-Which"
pkg_install() {
vbin contrib/notmuch-mutt/notmuch-mutt
vman contrib/notmuch-mutt/notmuch-mutt.1
}
}
notmuch-python3_package() {
archs=noarch
depends="libnotmuch-${version}_${revision}"
short_desc+=" - Python 3 bindings"
pkg_install() {
vmove ${py3_sitelib}
}
}
notmuch-ruby_package() {
depends="libnotmuch-${version}_${revision} ruby"
short_desc+=" - Ruby bindings"
pkg_install() {
vmove usr/lib/ruby
}
}