# Contributor: Sören Tempel # Maintainer: Natanael Copa pkgname=mercurial pkgver=5.5.2 pkgrel=0 pkgdesc="Scalable distributed SCM tool" url="https://www.mercurial-scm.org/" arch="all" license="GPL-2.0-or-later" depends="python3" makedepends="python3-dev" checkdepends="unzip diffutils xz sqlite gettext py3-docutils" subpackages=" $pkgname-doc $pkgname-vim:vim:noarch $pkgname-zsh-completion:zshcomp:noarch $pkgname-bash-completion:bashcomp:noarch " source="https://www.mercurial-scm.org/release/mercurial-$pkgver.tar.gz blacklist.txt" case "$CARCH" in armv7|armhf) options="$options !check" ;; # around 400 of 919 tests time out esac # secfixes: # 4.9-r0: # - CVE-2019-3902 build() { HGPYTHON3=1 python3 setup.py build } check() { make PYTHON=python3 TESTFLAGS=--blacklist="$srcdir/blacklist.txt" tests } package() { HGPYTHON3=1 python3 setup.py install --root="$pkgdir" install -m755 contrib/hgk contrib/hg-ssh hgeditor "$pkgdir"/usr/bin local man for man in doc/*.?; do install -Dm644 "$man" \ "$pkgdir"/usr/share/man/man${man##*.}/${man##*/} done } vim() { depends="" pkgdesc="Vim syntax for $pkgname" install_if="vim $pkgname=$pkgver-r$pkgrel" cd "$builddir"/contrib/vim/ mkdir -p "$subpkgdir"/usr/share/vim/vimfiles/syntax/ install -Dm644 HGAnnotate.vim hgtest.vim \ "$subpkgdir"/usr/share/vim/vimfiles/syntax/ } zshcomp() { depends="" pkgdesc="Zsh completion for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel zsh" install -Dm644 "$builddir"/contrib/zsh_completion \ "$subpkgdir"/usr/share/zsh/site-functions/_$pkgname } bashcomp() { depends="" pkgdesc="Bash completion for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" install -Dm644 "$builddir"/contrib/bash_completion \ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname } sha512sums="e154592deed6168a32e7fd075fa034908ca72826ae49a92c84a6ad82b820753906578f064ac623018442d83d125a551eecc057179e66ac7217398a192e903629 mercurial-5.5.2.tar.gz 8a6453ae8da9c4a5c069099909651ff24e93e8851333f96d58432429d2d2aad898cf6091aa4b2ea479e87fc73361dc83405db3af3fec56296f22cba35bda65f3 blacklist.txt"