You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.0 KiB
94 lines
2.0 KiB
2 years ago
|
# Copyright 2018-2022 Gentoo Authors
|
||
3 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
EAPI=8
|
||
|
|
||
|
inherit go-module bash-completion-r1
|
||
|
|
||
3 years ago
|
DESCRIPTION="Fast static HTML and CSS website generator"
|
||
3 years ago
|
HOMEPAGE="https://gohugo.io https://github.com/gohugoio/hugo"
|
||
|
SRC_URI="
|
||
|
https://github.com/gohugoio/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
||
2 years ago
|
https://tastytea.de/files/gentoo/${P}-vendor.tar.xz
|
||
3 years ago
|
"
|
||
|
|
||
|
# NOTE: To create the vendor tarball, run:
|
||
2 years ago
|
# `go mod vendor && cd .. && tar -caf ${P}-vendor.tar.xz ${P}/vendor`
|
||
3 years ago
|
|
||
|
LICENSE="Apache-2.0 BSD BSD-2 MIT Unlicense"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
2 years ago
|
IUSE="doc +sass test"
|
||
2 years ago
|
|
||
|
BDEPEND="
|
||
|
>=dev-lang/go-1.18
|
||
|
test? (
|
||
|
dev-python/docutils
|
||
|
dev-ruby/asciidoctor
|
||
2 years ago
|
virtual/pandoc
|
||
2 years ago
|
)
|
||
|
"
|
||
3 years ago
|
RDEPEND="
|
||
3 years ago
|
media-libs/libwebp:=
|
||
|
sass? ( dev-libs/libsass:= )
|
||
3 years ago
|
"
|
||
|
DEPEND="${RDEPEND}"
|
||
|
|
||
2 years ago
|
RESTRICT="!test? ( test )"
|
||
|
|
||
|
PATCHES=(
|
||
|
"${FILESDIR}/${PN}-0.96.0-unbundle-libwebp-and-libsass.patch"
|
||
|
"${FILESDIR}/${PN}-0.96.0-skip-some-tests.patch"
|
||
2 years ago
|
"${FILESDIR}/${PN}-0.99.1-test-timeout.patch"
|
||
2 years ago
|
)
|
||
3 years ago
|
|
||
|
src_configure() {
|
||
|
export CGO_ENABLED=1
|
||
|
export CGO_CFLAGS="${CFLAGS}"
|
||
2 years ago
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
||
3 years ago
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
||
|
export CGO_LDFLAGS="${LDFLAGS}"
|
||
|
|
||
2 years ago
|
MY_BUILDFLAGS="$(usev sass "-tags extended")"
|
||
|
|
||
3 years ago
|
default
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
mkdir -pv bin || die
|
||
2 years ago
|
ego build -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=gentoo:${PVR}" \
|
||
|
${MY_BUILDFLAGS} -o "${S}/bin/hugo"
|
||
3 years ago
|
|
||
|
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
|
||
|
}
|
||
|
|
||
2 years ago
|
src_test() {
|
||
|
ego test -race "./..." ${MY_BUILDFLAGS}
|
||
|
}
|
||
|
|
||
3 years ago
|
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
|
||
|
}
|