testing/git-annex: cleanup

This commit is contained in:
build@apk-groulx 2021-12-05 23:30:09 +00:00
parent c0f1cfc676
commit 56bac9eaf8

View file

@ -5,18 +5,18 @@
# #
pkgname=git-annex pkgname=git-annex
pkgver=8.20211203 pkgver=8.20211123
pkgrel=0 pkgrel=0
pkgdesc="Manage files with git, without checking their contents into git" pkgdesc="Manage files with git, without checking their contents into git"
url="http://git-annex.branchable.com" url="http://git-annex.branchable.com"
arch="i686 x86_64" arch="x86 x86_64"
license="GPL3" license="GPL3"
depends="git lsof rsync curl gmp zlib gnupg file gnutls libxml2 openssh util-linux libidn libgsasl" depends="git lsof rsync curl gmp zlib gnupg file gnutls libxml2 openssh util-linux libidn libgsasl"
makedepends="cabal ghc zlib-dev file-dev gnutls-dev libxml2-dev libgsasl-dev ncurses-dev happy alex libffi-dev" makedepends="cabal ghc zlib-dev file-dev gnutls-dev libxml2-dev libgsasl-dev ncurses-dev happy alex libffi-dev"
_gittag=490689f122f4cce63cbd6aa29f5b59c6caf09d09 _gittag=$pkgver
_giturl=https://git.joeyh.name/index.cgi/git-annex.git _giturl=https://git.joeyh.name/index.cgi/git-annex.git
source=" source="
$_giturl/snapshot/$pkgname-${_gittag}.tar.gz $_giturl/snapshot/$pkgname-$_gittag.tar.gz
" "
subpackages="$pkgname-doc" subpackages="$pkgname-doc"
builddir="$srcdir/$pkgname-$_gittag" builddir="$srcdir/$pkgname-$_gittag"
@ -71,11 +71,10 @@ _cabal_libdepends="exceptions hslogger async tasty filepath-bytestring split uni
# #
_features="" _features=""
gitannexfeature() { gitannexfeature() {
case $1 in case $1 in
(0) _features="${_features} -f-$2";; (0) _features="$_features -f-$2";;
(*) _features="$_features -f$2";;
(*) _features="${_features} -f$2";; esac
esac
} }
@ -93,81 +92,76 @@ gitannexfeature $_gitlfs GitLfs
gitannexfeature $_httpclientrestricted HttpClientRestricted gitannexfeature $_httpclientrestricted HttpClientRestricted
# #
# APKBUILD functions # APKBUILD functions
# #
_localize_home(){ _localize_home() {
ORIG_HOME="$HOME" ORIG_HOME="$HOME"
ORIG_TMPDIR="$TMPDIR" ORIG_TMPDIR="$TMPDIR"
export HOME="${srcdir}"/cabal export HOME="$srcdir"/cabal
export TMPDIR="${srcdir}"/cabal/tmp export TMPDIR="$srcdir"/cabal/tmp
export PATH="$HOME/.cabal/bin:$PATH" export PATH="$HOME/.cabal/bin:$PATH"
} }
_restore_home(){ _restore_home() {
export HOME="$ORIG_HOME" export HOME="$ORIG_HOME"
export TMPDIR="$ORIG_TMPDIR" export TMPDIR="$ORIG_TMPDIR"
} }
pkgver() { pkgver() {
cd "$srcdir/${pkgname%-git}" cd "$srcdir/${pkgname%-git}"
git describe --long | sed 's/^v//;s/-/_/g' git describe --long | sed 's/^v//;s/-/_/g'
} }
asking() { asking() {
read -p "$@ (Y/n)" answer read -p "$@ (Y/n)" answer
case "$answer" in case "$answer" in
n|N|no|NO|No|nO) false;; n|N|no|NO|No|nO) false;;
*) true;; *) true;;
esac esac
} }
prepare() { prepare() {
default_prepare default_prepare
cd "$builddir" _localize_home
_localize_home mkdir -p "$HOME" "$TMPDIR"
mkdir -p "$HOME" "$TMPDIR"
msg "Features: $_features" msg "Features: $_features"
msg "Installing missing cabal dependencies..." msg "Installing missing cabal dependencies..."
cabal update cabal update
cabal install ${_cabal_makedepends} cabal install $_cabal_makedepends
cabal install --lib ${_cabal_libdepends} cabal install --lib $_cabal_libdepends
cabal install ${_cabal_flags} --user --only-dependencies ${_features} cabal install $_cabal_flags --user --only-dependencies $_features
_restore_home _restore_home
} }
build() { build() {
cd "$builddir" _localize_home
_localize_home
msg "Configuring..." msg "Configuring..."
cabal configure ${_features} cabal configure $_features
msg "Starting build..." msg "Starting build..."
make make
_restore_home _restore_home
} }
check() { check() {
cd "$builddir" _localize_home
_localize_home make test || asking "Tests failed. Continue?"
make test || asking "Tests failed. Continue?" _restore_home
_restore_home
} }
package() { package() {
cd "$builddir" _localize_home
_localize_home make DESTDIR="$pkgdir" install
make DESTDIR="$pkgdir" install _restore_home
_restore_home
} }
sha512sums=" sha512sums="
329cdb1acd54d33298c528297e6e102b6f02618ca8b132e45fa9c5007bf3fce9c1d0d336ff5135e8e1f1bd7f3fd6fea641a7da1a1658721d89681d0f1249706d git-annex-490689f122f4cce63cbd6aa29f5b59c6caf09d09.tar.gz cd5eb30e71bd580867b9a92d33dc2338f239919765a7c03f5caf1b772cf9059d6d4b6899087a62d141968546d1a6187dbac11858fe93ba7fabcaa543be863613 git-annex-8.20211123.tar.gz
" "