commit:     a84833498f04997dbb5b7fed790312c5e2bdbbf7
Author:     tastytea <gentoo <AT> tastytea <DOT> de>
AuthorDate: Wed Dec  6 13:13:48 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Thu Dec  7 06:49:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8483349

www-apps/hugo: add 0.121.0

Closes: https://bugs.gentoo.org/919134
Signed-off-by: tastytea <gentoo <AT> tastytea.de>
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 www-apps/hugo/Manifest                             |   2 +
 ...hugo-0.121.0-unbundle-libwebp-and-libsass.patch |  43 +++++++++
 www-apps/hugo/hugo-0.121.0.ebuild                  | 101 +++++++++++++++++++++
 3 files changed, 146 insertions(+)

diff --git a/www-apps/hugo/Manifest b/www-apps/hugo/Manifest
index d8c05af9dda3..7986a720503e 100644
--- a/www-apps/hugo/Manifest
+++ b/www-apps/hugo/Manifest
@@ -2,3 +2,5 @@ DIST hugo-0.118.2-vendor.tar.xz 6633368 BLAKE2B 
a88e3422828a98ae220805a5853402b6
 DIST hugo-0.118.2.tar.gz 19385307 BLAKE2B 
c5a4e358b37f41cdbadb12df4657570da249fb8ba70f3c18406431cf8a48287d14598e6c36453a53afe156eb2fdd6c177586136f32e1166d23c856a2fab98bc1
 SHA512 
decda9097ae3e9942524457527ecd2a1d0c8555b5909c676f2bcc16ca5052453a64366f3dbe5eeb2ef0930b65edd52d9963c967cf28f0b149fb410aa5811ac78
 DIST hugo-0.119.0-vendor.tar.xz 6642728 BLAKE2B 
1a7c3d8acb895f01db97b8583d7d578b0ebb422b9763754dc0e3536b0511ed07af8403d826d9a821b587e56c4d1f584392ea158db72c98caaa941a74de1da19a
 SHA512 
8ec40365efa97b0c6d0dd088b0ee2e44a582841b9b9d5938e6408bcf4fb82c4d1909430c414e5642cd9c3305e159ed2495770b4fb710fabafb5c9cd740ac3d53
 DIST hugo-0.119.0.tar.gz 19579413 BLAKE2B 
f383f28b054fb78f1e8c972ec84d88fcbc6d8902dcdbe4acaaa081fea2c78247b5345faaec93c708fbcf71fee38a781a2c7c213f042568b3bd6b27e3618713d9
 SHA512 
ce77d60869173d18d46d91e4f23910c709ccabdf81976c1c96177a9fbad965a13a735fafce37f413a40a5af248510e49f8b2da86c1ba4291fb8b3941e91ee5ea
+DIST hugo-0.121.0-vendor.tar.xz 6682060 BLAKE2B 
7aabdd97eada6b83e0e7bebe632f7b465a6d87d376e555325e4309eeed7b286a6e4f7bcb1bdab1884328decb25ee1356b438df9fa1f07a6d85aad36fcd3f2f7b
 SHA512 
c7688f7d32fa0b3fbbaffc154b025eda83b24dcbacff94188c80811692a091498e5e8107715e3b24e497ef56d4e9af843a4c5a4a42a6b28a79146ab2c44344b1
+DIST hugo-0.121.0.tar.gz 21036266 BLAKE2B 
a924e2ad2fc4a5c690bf3bdd2e837add543119632f3055117a73455555bc78996b9f3eeb42c94694135a8f174aced72fea359ca39ca3ed76673b2284dc641d60
 SHA512 
99566167e74e1eda996ca54b0284a56a1bcd6c69f60d4461faa3bcca2f0c2d499b5e4de806a78576b5ec7691aa6d81fb66b6f088a25255fc9496d1f65d37d2ac

diff --git 
a/www-apps/hugo/files/hugo-0.121.0-unbundle-libwebp-and-libsass.patch 
b/www-apps/hugo/files/hugo-0.121.0-unbundle-libwebp-and-libsass.patch
new file mode 100644
index 000000000000..4dcd86a6040f
--- /dev/null
+++ b/www-apps/hugo/files/hugo-0.121.0-unbundle-libwebp-and-libsass.patch
@@ -0,0 +1,43 @@
+From 1237c6c59e4fe777b39ee7c543eb4f8b6ce6a6b1 Mon Sep 17 00:00:00 2001
+From: tastytea <[email protected]>
+Date: Wed, 6 Dec 2023 12:37:26 +0100
+Subject: [PATCH] unbundle libwebp and libsass
+
+---
+ .../github.com/bep/golibsass/internal/libsass/a__cgo.go   | 8 ++++----
+ vendor/github.com/bep/gowebp/internal/libwebp/a__cgo.go   | 3 ++-
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go 
b/vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go
+index 1de9aeeef..fd565d1a9 100644
+--- a/vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go
++++ b/vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go
+@@ -4,9 +4,9 @@
+ // license that can be found in the LICENSE file.
+ package libsass
+ 
+-// #cgo CFLAGS: -O2 -fPIC
+-// #cgo CPPFLAGS: -I../../libsass_src/include
+-// #cgo CXXFLAGS: -g -std=c++0x -O2 -fPIC
+-// #cgo LDFLAGS: -lstdc++ -lm
++// #cgo CFLAGS: -fPIC
++// #cgo CPPFLAGS: -DUSE_LIBSASS_SRC
++// #cgo CXXFLAGS: -std=c++0x -fPIC
++// #cgo LDFLAGS: -lstdc++ -lm -lsass
+ // #cgo darwin linux LDFLAGS: -ldl
+ import "C"
+diff --git a/vendor/github.com/bep/gowebp/internal/libwebp/a__cgo.go 
b/vendor/github.com/bep/gowebp/internal/libwebp/a__cgo.go
+index bcf9bacd0..4cc2aa81c 100644
+--- a/vendor/github.com/bep/gowebp/internal/libwebp/a__cgo.go
++++ b/vendor/github.com/bep/gowebp/internal/libwebp/a__cgo.go
+@@ -3,5 +3,6 @@
+ 
+ package libwebp
+ 
+-// #cgo unix LDFLAGS: -lm
++// #cgo unix LDFLAGS: -lm -lwebp
++// #cgo CFLAGS: -DLIBWEBP_NO_SRC
+ import "C"
+-- 
+2.41.0
+

diff --git a/www-apps/hugo/hugo-0.121.0.ebuild 
b/www-apps/hugo/hugo-0.121.0.ebuild
new file mode 100644
index 000000000000..d3d9d003c7dd
--- /dev/null
+++ b/www-apps/hugo/hugo-0.121.0.ebuild
@@ -0,0 +1,101 @@
+# Copyright 2018-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module shell-completion
+
+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/gentoo/${P}-vendor.tar.xz
+"
+
+# NOTE: To create the vendor tarball, run:
+# `go mod vendor && cd .. && tar -caf ${P}-vendor.tar.xz ${P}/vendor`
+
+LICENSE="Apache-2.0 BSD BSD-2 MIT MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
+IUSE="doc +extended test"
+
+BDEPEND="
+       >=dev-lang/go-1.18
+       test? (
+               dev-python/docutils
+               dev-ruby/asciidoctor
+               virtual/pandoc
+       )
+"
+RDEPEND="
+       extended? (
+               dev-libs/libsass:=
+               >=media-libs/libwebp-1.3.2:=
+       )
+"
+DEPEND="${RDEPEND}"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.121.0-unbundle-libwebp-and-libsass.patch
+       "${FILESDIR}"/${PN}-0.118.2-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}"
+       export MY_BUILD_FLAGS="$(usev extended "-tags extended")"
+
+       default
+}
+
+src_prepare() {
+       # wants to run command that require network access
+       rm testscripts/commands/mod{,_vendor,__disable,_get,_get_u}.txt || die
+
+       default
+}
+
+src_compile() {
+       mkdir -pv bin || die
+       ego build -ldflags "-X 
github.com/gohugoio/hugo/common/hugo.vendorInfo=gentoo:${PVR}" \
+               ${MY_BUILD_FLAGS} -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 "./..." ${MY_BUILD_FLAGS}
+}
+
+src_install() {
+       dobin bin/*
+       doman man/*
+
+       dobashcomp completions/${PN}
+       dofishcomp completions/${PN}.fish
+       dozshcomp completions/_${PN}
+
+       if use doc ; then
+               dodoc -r doc/*
+       fi
+}
+
+pkg_postinst() {
+       elog "the sass USE-flag was renamed to extended. the functionality is 
the" \
+               "same, except it also toggles the dependency on libwebp (for 
encoding)"
+}

Reply via email to