aboutsummaryrefslogblamecommitdiffstats
path: root/community/notmuch/APKBUILD
blob: e1160be7256e2ff2bdc405827e72b64a5bb02ef2 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                              


                                                    
           
        

                                          
          
                          












                              
                                                  
             

                               
                    
                     
                                   
                               

                                                 
                                                                
 
         
                                    

                                   




                                                                            

                                                                
 
                          
                              


           
                                            



                                      
               

                          
                  






                                                                   
                                                                  
 


                                        
                                                              
                                                                                      

                    
                       
            

 







                                                        










                                                                    



                                                              


                                                                     
                                                                   
                                                  





                                                  

                                                           
                                                             
                                                          
                                      

 


                                        

                                      
                                                                  

 
            
                                                                                                                                                     
 
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
# Maintainer: Stefan Wagner <stw@bit-strickerei.de>
pkgname=notmuch
pkgver=0.34
pkgrel=0
pkgdesc="E-Mail index, search and tagging"
url="https://notmuchmail.org/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	bash-completion
	emacs-nox
	gmime-dev
	gzip
	perl
	py3-charset-normalizer
	py3-requests
	py3-sphinx
	python3-dev
	talloc-dev
	xapian-core-dev
	"
checkdepends="bash coreutils dtach mandoc sed tar"
subpackages="
	py3-$pkgname:py3:noarch
	$pkgname-doc
	$pkgname-dev
	$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/notmuch-$pkgver.tar.xz"

build() {
	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 bindings/python
	python3 setup.py build
}

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

check() {
	cd 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|T590-libconfig) continue ;;

		# FIXME fails on riscv64
		T620-lock) 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
}

py3() {
	pkgdesc="$pkgdesc (for python3)"
	depends="$depends python3"

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

sha512sums="
c7c802ee6fc056cb626611e3403541e404c628d238983299faf877e7eca9dfb94bd643c399e6a6cda53b051d2ad837ad03b124a1f44e17c7637a9c9b23e33c73  notmuch-0.34.tar.xz
"