ayaports/user/git-annex/APKBUILD

149 lines
4.3 KiB
Text

# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=git-annex
pkgver=10.20230214
_bloomfilterver=2.0.1.0
_gitlfsver=1.2.0
pkgrel=1
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() {
cabal_depends
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
if ! abuild checksum; then
die "Failed to update checksum, run 'abuild checksum' manually"
fi
}
cabal_depends() {
# 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
}
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
cabal_depends
}
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="
60047137c1b72d9d9161275063028af020016aa87b8929164ec35e53bb6d2eac1067896cc81e14bcd46ee1a3621319c9928658d94e80d2b88188242dce79bd10 git-annex-10.20230214.tar.gz
1031cc28c5e5c1b7687355b709d436ebab1956ffd7591a010fa3852a1bc7412925a365f99937feeacf4b1a5d3c7b34bc0370707ad6e4533280dcac4ea3fa7c21 bloomfilter-2.0.1.0.tar.gz
13d8c3c7c9844e935af278b4b6dc477b4ef069a3b61a5fea5bf28aadbd3ca4b475aa23701fe7be8a9468af78771d1fabda3e74c5d4b9a3fbb77ee8b803198f65 git-lfs-1.2.0.tar.gz
e7589b54b3b50b233c12ca0d5d4b94b82087067b2e1c40ed3678663c21f18723afc738571ec846e944aed946612894df6597ae81e4232e1053df8021df313ee2 git-annex.config
dceb863b2839fa6ec01390c1806f6da17fc2468f54a45b354da56f6d5412bc83292a456c387b6374aadb4aec1a490aac4f0373843d114ca33fb858f382a472ec git-lfs.config
500ebfd84e5771ed62ad2491b3f484d9a049091cd9bced072f34e64d81fd4db8aff2cfd9a0b2278335ac86198bfca551aec6ce3a2bd07d4484393a4288d3af35 bloomfilter-ghc9.2.diff
923d9e93380238115841f2dfbe61d34bf4bf8b3806f898d259125f31f5e4c6147840b1da737385aaa96a425d0dd4bacb2ab846ec3ea608ec6de243484fdded2e git-lfs-depend-update.diff
178be26bc808f6a5c065957b04e3a32b02f0a6b5eb8c422c9d8960b6e9a1f90d689360c5ad491156783b25e80f4c2f9861e9ccff5091c302be713fa3063df670 fix-makefile.patch
"