blob: 50ae5b3634cf7adc632e76497f2893aea34b6329 (
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
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
82
83
84
85
86
87
88
89
90
91
92
|
# Copyright 2018-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module bash-completion-r1
DESCRIPTION="Fast static HTML and CSS website generator"
HOMEPAGE="https://gohugo.io https://github.com/gohugoio/hugo"
SRC_URI="
https://github.com/gohugoio/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://tastytea.de/files/${P}-vendor.tar.xz
"
# NOTE: To create the vendor tarball, run:
# `go mod vendor && cd .. && tar -cJf ${P}-vendor.tar.xz ${P}/vendor`
LICENSE="Apache-2.0 BSD BSD-2 MIT Unlicense"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc +sass test test-full"
BDEPEND="
>=dev-lang/go-1.18
test? (
dev-python/docutils
dev-ruby/asciidoctor
test-full? ( app-text/pandoc )
)
"
RDEPEND="
media-libs/libwebp:=
sass? ( dev-libs/libsass:= )
"
DEPEND="${RDEPEND}"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/${PN}-0.96.0-unbundle-libwebp-and-libsass.patch"
"${FILESDIR}/${PN}-0.96.0-skip-some-tests.patch"
)
src_configure() {
export CGO_ENABLED=1
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
MY_BUILDFLAGS="$(usev sass "-tags extended")"
default
}
src_compile() {
mkdir -pv bin || die
ego build -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=gentoo:${PVR}" \
${MY_BUILDFLAGS} -o "${S}/bin/hugo"
bin/hugo gen man --dir man || die
mkdir -pv completions || die
bin/hugo completion bash > completions/hugo || die
bin/hugo completion fish > completions/hugo.fish || die
bin/hugo completion zsh > completions/_hugo || die
if use doc ; then
bin/hugo gen doc --dir doc || die
fi
}
src_test() {
ego test -race "./..." ${MY_BUILDFLAGS}
}
src_install() {
dobin bin/*
doman man/*
dobashcomp completions/${PN}
insinto /usr/share/fish/vendor_completions.d
doins completions/${PN}.fish
insinto /usr/share/zsh/site-functions
doins completions/_${PN}
if use doc ; then
dodoc -r doc/*
fi
}
|