ayaports/user/git-annex/APKBUILD

147 lines
4.4 KiB
Text

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=git-annex
pkgver=10.20230329
_bloomfilterver=2.0.1.0
_gitlfsver=1.2.0
pkgrel=0
pkgdesc="Manage files with git, without checking their contents into git"
url="http://git-annex.branchable.com"
arch="x86_64 aarch64" # limited by ghc
license="AGPL-3.0-or-later"
depends="
curl
git
rsync
"
makedepends="
alex
cabal
dbus-dev
file-dev
ghc
gmp-dev
gnutls-dev
happy
libffi-dev
libgsasl-dev
libxml2-dev
ncurses-dev
zlib-dev
"
source="
https://git.joeyh.name/index.cgi/git-annex.git/snapshot/git-annex-$pkgver.tar.gz
https://hackage.haskell.org/package/bloomfilter-$_bloomfilterver/bloomfilter-$_bloomfilterver.tar.gz
https://hackage.haskell.org/package/git-lfs-$_gitlfsver/git-lfs-$_gitlfsver.tar.gz
git-annex.config
git-lfs.config
bloomfilter-ghc9.2.diff
git-lfs-depend-update.diff
fix-makefile.patch
"
subpackages="$pkgname-doc $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion"
# Add / remove '-' between "-f" and "FeatureName" to adjust feature build
_feature_flags="
-fAssistant \
-fWebApp \
-fPairing \
-fProduction \
-fTorrentParser \
-fMagicMime \
-fBenchmark \
-f-DebugLocks \
-fDbus \
-fNetworkBSD \
-fGitLfs \
-fHttpClientRestricted \
"
_cabal_home="$srcdir/dist"
_cabal_config="git-annex git-lfs"
cabal_update() {
msg "Freezing $pkgname dependencies"
# Resolve deps and generate fresh cabal.config with version constraints.
HOME="$_cabal_home" cabal update
for i in $_cabal_config; do
cd "$srcdir/$i"*
HOME="$_cabal_home" cabal v1-freeze --shadow-installed-packages
# Add version tag at the first line.
sed -i "1i--$pkgver" "cabal.config"
mv "cabal.config" "$startdir/$i.config"
cd "$startdir"
done
# git-annex is not compatible with unix-compat-0.7
sed -i 's|unix-compat.*|unix-compat ==0.6,|' git-annex.config
if ! abuild checksum; then
die "Failed to update checksum, run 'abuild checksum' manually"
fi
}
prepare() {
default_prepare
if [ "$(head -n 1 "$srcdir/git-annex.config")" != "--$pkgver" ]; then
die "Requirements file is outdated, run 'abuild cabal_update'"
fi
for i in $_cabal_config; do
cd "$srcdir"/$i*
ln -sf "$srcdir/$i.config" cabal.config
done
# ghc version path
export PATH="$PATH:/usr/lib/llvm14/bin"
# problematic depend install
HOME="$_cabal_home" cabal update
msg "Installing dependency bloomfilter-$_bloomfilterver out-of-tree"
cd "$srcdir"/bloomfilter-*
patch -p1 -i "$srcdir"/bloomfilter-ghc9.2.diff
HOME="$_cabal_home" cabal v1-install
msg "installing dependency git-lfs-$_gitlfsver out-of-tree"
cd "$srcdir"/git-lfs-*
patch -p1 -i "$srcdir"/git-lfs-depend-update.diff
HOME="$_cabal_home" cabal v1-install
}
build() {
# ghc version path
export PATH="$PATH:/usr/lib/llvm14/bin"
msg "Building git-annex-$pkgver"
HOME="$_cabal_home" cabal update
HOME="$_cabal_home" cabal v1-install \
--only-dependencies \
$_feature_flags
HOME="$_cabal_home" cabal v1-configure $_feature_flags
HOME="$_cabal_home" cabal v1-build -j
mv dist/build/git-annex/git-annex .
ln -s git-annex git-annex-shell
}
check() {
"$builddir"/git-annex test
}
package() {
HOME="$_cabal_home" make DESTDIR="$pkgdir" install
}
sha512sums="
b0b35f16030109341121f10977d507c64d49913ac033949b4444d94b7bec592de6ca617993cd5e0be3774e48ce0394e248d6f691c387b073db3ed7ec24c4a759 git-annex-10.20230329.tar.gz
1031cc28c5e5c1b7687355b709d436ebab1956ffd7591a010fa3852a1bc7412925a365f99937feeacf4b1a5d3c7b34bc0370707ad6e4533280dcac4ea3fa7c21 bloomfilter-2.0.1.0.tar.gz
13d8c3c7c9844e935af278b4b6dc477b4ef069a3b61a5fea5bf28aadbd3ca4b475aa23701fe7be8a9468af78771d1fabda3e74c5d4b9a3fbb77ee8b803198f65 git-lfs-1.2.0.tar.gz
37c238e1290fe239298e78e950ed28e363cde44319dcb548030bb73d68c96649a98787cd902867fd677ffcaf011efb5088801e61b96eccd0f484c10b2914a5f1 git-annex.config
3f255b3cc534257fba11647d79718009861b6462f19c90acb790a8a8107de1b9a882538b5ccba44cbd0c100d3032cb4ee09f69427040f0015acad07f9fa81354 git-lfs.config
500ebfd84e5771ed62ad2491b3f484d9a049091cd9bced072f34e64d81fd4db8aff2cfd9a0b2278335ac86198bfca551aec6ce3a2bd07d4484393a4288d3af35 bloomfilter-ghc9.2.diff
923d9e93380238115841f2dfbe61d34bf4bf8b3806f898d259125f31f5e4c6147840b1da737385aaa96a425d0dd4bacb2ab846ec3ea608ec6de243484fdded2e git-lfs-depend-update.diff
178be26bc808f6a5c065957b04e3a32b02f0a6b5eb8c422c9d8960b6e9a1f90d689360c5ad491156783b25e80f4c2f9861e9ccff5091c302be713fa3063df670 fix-makefile.patch
"