aboutsummaryrefslogtreecommitdiff
path: root/community/hugo/APKBUILD
blob: 1db316f5e55bd40ef4b633059e2f4fecfa9d9230 (plain)
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
# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=hugo
pkgver=0.72.0
pkgrel=0
pkgdesc="A Fast and Flexible Static Site Generator built with love in GoLang"
url="https://gohugo.io/"
arch="all !x86 !s390x !mips !mips64" # tests fail on x86, s390x and mips
license="Apache-2.0"
makedepends="go"
subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/gohugoio/hugo/archive/v$pkgver.tar.gz
	0001-Remove-git-tests.patch
	0002-skip-tests-that-need-nodejs.patch
"

build() {
	go build -v -o bin/$pkgname --tags extended
	./bin/hugo gen man
	./bin/hugo gen autocomplete --completionfile="$builddir"/hugo.bash
}

check() {
	# image_test.so:548 fails
	case "$CARCH" in
		aarch64|ppc64le) return 0 ;;
	esac
	go test ./...
}

package() {
	install -Dm755 "$builddir"/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 "$builddir"/man/*.1 -t "$pkgdir"/usr/share/man/man1
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/hugo.bash \
			"$subpkgdir"/usr/share/bash-completion/completions/hugo
}

sha512sums="7efc37cda59e7ce3b5db96fd6db153df63952b6da6ab60d3cc7159cc78d14ffc53b48d40ec197df8d7819b8730f895fafdf7d44bf7491ac26792833c6da6b9e7  hugo-0.72.0.tar.gz
57be9a6c8e49bd2a75921d51d8dc503439f68453a6c9803c9cecef8bb63541f10d8b652db151426949c1bcf134a96eec0253ee4a61c0987143d6159ea49e9588  0001-Remove-git-tests.patch
093dd4355bbb48ff9e8e3d24e8d290d4587d3517e1f8804903f0707d5530a106edc4297e6f4508c2ef408f01d6699cd3de40259d97c34857b58b7f0f3f52deff  0002-skip-tests-that-need-nodejs.patch"