aboutsummaryrefslogtreecommitdiffstats
path: root/community/git-lfs/APKBUILD
blob: f89dd47e971a0e75bd14eb9334d70aaa3495c90e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=git-lfs
pkgver=2.3.4
pkgrel=1
pkgdesc="Git extension for versioning large files"
url="https://git-lfs.github.io/"
arch="all"
license="MIT"
depends="git"
checkdepends="bash coreutils git-daemon perl-utils"
makedepends="go ronn"
subpackages="$pkgname-doc"
install="$pkgname.post-install $pkgname.pre-deinstall"
source="$pkgname-$pkgver.tar.gz::https://github.com/git-lfs/$pkgname/archive/v$pkgver.tar.gz
	fix-test-locks.patch
	wait-longer.patch"
builddir="$srcdir/src/github.com/git-lfs/$pkgname"

export GOPATH="$srcdir:$builddir"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"

	default_prepare
}

build() {
	cd "$builddir"

	# Build manpages first (some embedding in the executable is done).
	cd docs
	ronn man/*.ronn
	go run man/mangen.go
	cd -

	# Build git-lfs executable.
	_gobuild -o bin/$pkgname

	# Build test executables.
	local file; for file in test/cmd/*.go; do
		_gobuild -o bin/$(basename $file .go) $file
	done
	_gobuild -o bin/git-lfs-test-server-api \
		test/git-lfs-test-server-api/*.go
}

check() {
	cd "$builddir"

	GIT_LFS_TEST_MAXPROCS=$JOBS SKIPCOMPILE=1 ./script/integration
}

package() {
	local docdir="$pkgdir/usr/share/doc/$pkgname"
	local mandir="$pkgdir/usr/share/man"

	cd "$builddir"

	install -Dm755 bin/$pkgname "$pkgdir"/usr/bin/$pkgname

	mkdir -p "$mandir"/man1 "$mandir"/man5
	install -m 644 docs/man/*.1 "$mandir"/man1/
	install -m 644 docs/man/*.5 "$mandir"/man5/

	mkdir -p "$docdir"
	cp -r docs/*.md docs/api "$docdir"/
	rm -r "$docdir"/api/schemas
}

_gobuild() {
	# netcgo - use system's DNS resolver by default. Go's built-in DNS
	#   resolver is buggy; it resolved localhost to totally wrong IP
	#   address on ARM builders and so caused test failures.
	go build -tags netcgo -v "$@"
}

sha512sums="97174dc9346979777c3951baa86cfc07c85e2df04f13a50114e016facbb3fd5fde08d38825493d4e7ff149a13c87ae44e9e40350cd4950f27fe309ef62b6724a  git-lfs-2.3.4.tar.gz
66927aa462cb7b5061442e5ffaf7c9e4a5d97179482dc00de3f4abfad5959a9c55df3e88c211067bf15b5b0ea3ef29b249ca32290cc9839280266de5c6854b3f  fix-test-locks.patch
408f30bd047dc6bc502c37698615067b6496966e3c0d76e2c36d2eff50d87567aac9b9cbd3bb683566ffdd534a76d7e193ed6338b06c81dc358330de9f7f7903  wait-longer.patch"