diff options
Diffstat (limited to 'community/mercurial/APKBUILD')
-rw-r--r-- | community/mercurial/APKBUILD | 117 |
1 files changed, 81 insertions, 36 deletions
diff --git a/community/mercurial/APKBUILD b/community/mercurial/APKBUILD index e74c9d10799..9e6cc262d08 100644 --- a/community/mercurial/APKBUILD +++ b/community/mercurial/APKBUILD @@ -1,87 +1,132 @@ # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=mercurial -pkgver=5.7 +pkgver=6.7.1 pkgrel=0 pkgdesc="Scalable distributed SCM tool" url="https://www.mercurial-scm.org/" -arch="all !x86" # tests fails on x86 https://bz.mercurial-scm.org/show_bug.cgi?id=6506 +arch="all" license="GPL-2.0-or-later" depends="python3" -makedepends="python3-dev" -checkdepends="bash unzip diffutils xz sqlite gettext py3-docutils" +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-vim:vim:noarch - $pkgname-zsh-completion:zshcomp:noarch - $pkgname-bash-completion:bashcomp:noarch + $pkgname-lang + $pkgname-vim::noarch + $pkgname-zsh-completion + $pkgname-bash-completion " source="https://www.mercurial-scm.org/release/mercurial-$pkgver.tar.gz blacklist.txt - tests-include-deprecation-warning-in-expected-output.patch " +options="net !check" + case "$CARCH" in - ppc64le|mips64|aarch64|armv7|armhf) options="$options !check" ;; # around 400 of 919 tests time out +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 - x86_64|armv7|armhf|aarch64|x86|ppc64le) makedepends="$makedepends cargo" ;; + 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() { - HGPYTHON3=1 python3 setup.py 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() { - make PYTHON=python3 TESTFLAGS=--blacklist="$srcdir/blacklist.txt" tests + cd tests + python3 run-tests.py --blacklist="$srcdir"/blacklist.txt } package() { - HGPYTHON3=1 python3 setup.py install --root="$pkgdir" - install -m755 contrib/hgk contrib/hg-ssh hgeditor "$pkgdir"/usr/bin + 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 } -vim() { - depends="" - pkgdesc="Vim syntax for $pkgname" - install_if="vim $pkgname=$pkgver-r$pkgrel" +chg() { + pkgdesc="Client for Mercurial command server with cHg extension" + depends="$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/ + amove usr/bin/chg } -zshcomp() { +vim() { depends="" - pkgdesc="Zsh completion for $pkgname" - install_if="$pkgname=$pkgver-r$pkgrel zsh" + pkgdesc="Vim syntax for $pkgname" + install_if="vim $pkgname=$pkgver-r$pkgrel" - install -Dm644 "$builddir"/contrib/zsh_completion \ - "$subpkgdir"/usr/share/zsh/site-functions/_$pkgname + amove usr/share/vim } -bashcomp() { - depends="" - pkgdesc="Bash completion for $pkgname" - install_if="$pkgname=$pkgver-r$pkgrel bash-completion" +lang() { + pkgdesc="translations for $pkgname" + install_if="$pkgname=$pkgver-r$pkgrel lang" - install -Dm644 "$builddir"/contrib/bash_completion \ - "$subpkgdir"/usr/share/bash-completion/completions/$pkgname + amove usr/lib/python3*/site-packages/mercurial/locale } sha512sums=" -ecf1fb38e372acb5e29998cbe1105ecfb846a2bb43254419c89395c52fd28c37abe8eb850584f32f6ef53b539e6a7ef5a4dae10b816b747d20c6b0b4933f4b62 mercurial-5.7.tar.gz -93612774fd8c47920232440a516b68d121ac66c5c22d86d7220f50556ad79f97b8139dda58c1af04050b7677aff03ed51f4cae0c3207296fb5f2a03b6d4941c8 blacklist.txt -a86d9008ae952f5957b52492d20a22a493b7b7f810ccb28b54d88780c1a22af4c006f6ee60e9e8c43fe33a9dc0b89c940aa20e85a379026dc2b02218bf92d5c6 tests-include-deprecation-warning-in-expected-output.patch +60b29ac4f7c4865500cefaa590f1d9fe953fcb674456081c21802af8d815c971f884aac4c64ba4aa9341bf4e3cef3415fd30b76cd441512e8561bbf3e7b01372 mercurial-6.7.1.tar.gz +b24e1b79ca36ac1d78a5af4e35eb87581f209255838327a7d9315c17175d41bfa4b7f98c66be078cfa1e7d27a41c1a12bba265fa6d3d30edb4e2ba599fe0ed18 blacklist.txt " |