ayaports/apk/v3.15/testing/git-annex/APKBUILD

168 lines
3.6 KiB
Text
Raw Normal View History

2021-11-30 21:44:44 +00:00
# Maintainer: Antoine Martin <dev@ayakael.net>
#
# Core APKBUILD variables
#
pkgname=git-annex
2021-12-05 23:30:09 +00:00
pkgver=8.20211123
2021-11-30 21:44:44 +00:00
pkgrel=0
pkgdesc="Manage files with git, without checking their contents into git"
url="http://git-annex.branchable.com"
2021-12-05 23:30:09 +00:00
arch="x86 x86_64"
2021-11-30 21:44:44 +00:00
license="GPL3"
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"
2021-12-05 23:30:09 +00:00
_gittag=$pkgver
2021-12-04 22:29:12 +00:00
_giturl=https://git.joeyh.name/index.cgi/git-annex.git
2021-11-30 21:44:44 +00:00
source="
2021-12-05 23:30:09 +00:00
$_giturl/snapshot/$pkgname-$_gittag.tar.gz
2021-11-30 21:44:44 +00:00
"
subpackages="$pkgname-doc"
2021-12-04 22:29:12 +00:00
builddir="$srcdir/$pkgname-$_gittag"
2021-11-30 21:44:44 +00:00
#
# Build feature flags
#
# Enable git-annex assistant and watch command
_assistant=1
# Enable git-annex webapp (requires significantly more dependencies)
_webapp=1
# Enable pairing
_pairing=1
# slower build; faster binary
_production=0
# Use haskell torrent library to parse torrent files
_torrentparser=1
# Use libmagic to determine file MIME types
_magicmime=1
# Enable benchmarking
_benchmark=1
# Debug location of MVar/STM deadlocks
_debuglocks=0
# Enable dbus support
_dbus=1
# Build with network-3.0 which split out network-bsd
_networkbsd=1
# Build with git-lfs library (rather than vendored copy)
_gitlfs=1
# Build with http-client-restricted library (rather than vendored copy)
_httpclientrestricted=1
# The man page is always built but,
# building the rest of the documentation requires ikiwiki.
# If you want to build the documentation turns this to 1.
_build_docs=0
#
# Build config flags
#
# Cabal flags
_cabal_flags=" --force-reinstalls "
_cabal_makedepends="c2hs cpphs"
_cabal_libdepends="exceptions hslogger async tasty filepath-bytestring split unix-compat"
#
# Create features array for build
#
_features=""
gitannexfeature() {
2021-12-05 23:30:09 +00:00
case $1 in
(0) _features="$_features -f-$2";;
(*) _features="$_features -f$2";;
esac
2021-11-30 21:44:44 +00:00
}
gitannexfeature $_assistant Assistant
gitannexfeature $_webapp Webapp
gitannexfeature $_pairing Pairing
gitannexfeature $_production Production
gitannexfeature $_torrentparser TorrentParser
gitannexfeature $_magicmime MagicMime
gitannexfeature $_benchmark Benchmark
gitannexfeature $_debuglocks DebugLocks
gitannexfeature $_dbus Dbus
gitannexfeature $_networkbsd NetworkBSD
gitannexfeature $_gitlfs GitLfs
gitannexfeature $_httpclientrestricted HttpClientRestricted
2021-12-05 23:30:09 +00:00
#
2021-11-30 21:44:44 +00:00
# APKBUILD functions
#
2021-12-05 23:30:09 +00:00
_localize_home() {
ORIG_HOME="$HOME"
ORIG_TMPDIR="$TMPDIR"
export HOME="$srcdir"/cabal
export TMPDIR="$srcdir"/cabal/tmp
export PATH="$HOME/.cabal/bin:$PATH"
2021-11-30 21:44:44 +00:00
}
2021-12-05 23:30:09 +00:00
_restore_home() {
export HOME="$ORIG_HOME"
export TMPDIR="$ORIG_TMPDIR"
2021-11-30 21:44:44 +00:00
}
pkgver() {
2021-12-05 23:30:09 +00:00
cd "$srcdir/${pkgname%-git}"
git describe --long | sed 's/^v//;s/-/_/g'
2021-11-30 21:44:44 +00:00
}
asking() {
2021-12-05 23:30:09 +00:00
read -p "$@ (Y/n)" answer
case "$answer" in
n|N|no|NO|No|nO) false;;
*) true;;
esac
2021-11-30 21:44:44 +00:00
}
prepare() {
2021-12-05 23:30:09 +00:00
default_prepare
_localize_home
mkdir -p "$HOME" "$TMPDIR"
msg "Features: $_features"
msg "Installing missing cabal dependencies..."
cabal update
cabal install $_cabal_makedepends
cabal install --lib $_cabal_libdepends
cabal install $_cabal_flags --user --only-dependencies $_features
_restore_home
2021-11-30 21:44:44 +00:00
}
build() {
2021-12-05 23:30:09 +00:00
_localize_home
2021-11-30 21:44:44 +00:00
2021-12-05 23:30:09 +00:00
msg "Configuring..."
cabal configure $_features
2021-11-30 21:44:44 +00:00
2021-12-05 23:30:09 +00:00
msg "Starting build..."
make
_restore_home
2021-11-30 21:44:44 +00:00
}
check() {
2021-12-05 23:30:09 +00:00
_localize_home
make test || asking "Tests failed. Continue?"
_restore_home
2021-11-30 21:44:44 +00:00
}
package() {
2021-12-05 23:30:09 +00:00
_localize_home
make DESTDIR="$pkgdir" install
_restore_home
2021-11-30 21:44:44 +00:00
}
sha512sums="
2021-12-05 23:30:09 +00:00
cd5eb30e71bd580867b9a92d33dc2338f239919765a7c03f5caf1b772cf9059d6d4b6899087a62d141968546d1a6187dbac11858fe93ba7fabcaa543be863613 git-annex-8.20211123.tar.gz
2021-11-30 21:44:44 +00:00
"