# Contributor: Sören Tempel # Maintainer: Natanael Copa pkgname=mercurial pkgver=6.5.1 pkgrel=0 pkgdesc="Scalable distributed SCM tool" url="https://www.mercurial-scm.org/" arch="all" license="GPL-2.0-or-later" depends="python3" makedepends=" cargo-auditable gettext-dev py3-gpep517 py3-setuptools py3-wheel python3-dev zlib-dev " checkdepends=" bash diffutils py3-docutils sqlite unzip xz " subpackages=" $pkgname-pyc $pkgname-doc $pkgname-lang $pkgname-vim::noarch $pkgname-zsh-completion $pkgname-bash-completion " source="https://www.mercurial-scm.org/release/mercurial-$pkgver.tar.gz blacklist.txt " options="net !check" case "$CARCH" in aarch64|armhf) # around 400 of 919 tests time out options="$options !check" ;; esac case "$CARCH" in x86_64|armv7|armhf|aarch64|x86|ppc64le) # Oxidation, limited by Rust export HGWITHRUSTEXT=cpython makedepends="$makedepends cargo" subpackages="$subpackages $pkgname-chg" ;; esac # secfixes: # 4.9-r0: # - CVE-2019-3902 prepare() { default_prepare if [ "$HGWITHRUSTEXT" = "cpython" ]; then cd rust cargo fetch --target=$CTARGET --locked cd chg cargo fetch --target=$CTARGET --locked fi } build() { gpep517 build-wheel \ --wheel-dir .dist \ --output-fd 3 3>&1 >&2 if [ "$HGWITHRUSTEXT" = "cpython" ]; then cd rust cargo auditable build --release --frozen --manifest-path chg/Cargo.toml fi } check() { cd tests python3 run-tests.py --blacklist="$srcdir"/blacklist.txt } package() { python3 -m installer -d "$pkgdir" \ .dist/*.whl install -Dm755 contrib/hgk contrib/hg-ssh hgeditor -t "$pkgdir"/usr/bin local man for man in doc/*.?; do install -Dm644 "$man" \ "$pkgdir"/usr/share/man/man${man##*.}/${man##*/} done install -Dm644 contrib/vim/HGAnnotate.vim contrib/vim/hgtest.vim \ -t "$pkgdir"/usr/share/vim/vimfiles/syntax/ if [ "$HGWITHRUSTEXT" = "cpython" ]; then install -Dm755 rust/chg/target/release/chg -t "$pkgdir"/usr/bin/ fi } chg() { pkgdesc="Client for Mercurial command server with cHg extension" depends="$pkgname=$pkgver-r$pkgrel" amove usr/bin/chg } vim() { depends="" pkgdesc="Vim syntax for $pkgname" install_if="vim $pkgname=$pkgver-r$pkgrel" amove usr/share/vim } lang() { pkgdesc="translations for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel lang" amove usr/lib/python3*/site-packages/mercurial/locale } sha512sums=" 344305e9b1690f062ffc3d3f9dd99e0e4a63cede749def49c1975aa0a293b8c46777692274f83002ce136800a3a692ce1a916c254aea6d93aa749b2a30141303 mercurial-6.5.1.tar.gz b24e1b79ca36ac1d78a5af4e35eb87581f209255838327a7d9315c17175d41bfa4b7f98c66be078cfa1e7d27a41c1a12bba265fa6d3d30edb4e2ba599fe0ed18 blacklist.txt "