commit:     b77acceb4a652da2a47d5b325c08cf855e4a2201
Author:     tastytea <gentoo <AT> tastytea <DOT> de>
AuthorDate: Sun Jun 30 08:37:20 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Jul 10 05:22:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b77acceb

www-apps/hugo: add 0.128.2

Signed-off-by: tastytea <gentoo <AT> tastytea.de>
Closes: https://github.com/gentoo/gentoo/pull/37369
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 www-apps/hugo/Manifest                             |   2 +
 .../hugo/files/hugo-0.128.0-skip-some-tests.patch  |  79 ++++++++++++++++
 www-apps/hugo/hugo-0.128.2.ebuild                  | 101 +++++++++++++++++++++
 3 files changed, 182 insertions(+)

diff --git a/www-apps/hugo/Manifest b/www-apps/hugo/Manifest
index 0008abeac299..83ad12bb79ff 100644
--- a/www-apps/hugo/Manifest
+++ b/www-apps/hugo/Manifest
@@ -4,3 +4,5 @@ DIST hugo-0.125.7-vendor.tar.xz 6760028 BLAKE2B 
8ced0fc2c9b5b7a73eb11c31e8d94ddc
 DIST hugo-0.125.7.tar.gz 21062939 BLAKE2B 
030171ac009c50e85123a3c4c3573da1b81a2696d2f98b51543fb5c28467d1f5416513dad278063590361ea1611735d41d514ce3226a222d32be6fb16e84630d
 SHA512 
e6202026c7918f885abce338ade2e0a59d3a299030fc3b32af65eb434da31ef90647d14294ce1be5b3c66d2cd950b7a1f826094a2bf0e9538285e8cb2717cb91
 DIST hugo-0.127.0-vendor.tar.xz 6747376 BLAKE2B 
28569618b1398effe5eeafe72b43576986a9680371100812b546c5c62936754ebc4ecda2c8fea77ec93761b5e3746509b065bd6e1000815135be31a8ba8077c8
 SHA512 
f88d7a98d2d012e48beb239941a0a485b3ac761b055c7e76b5823550275e19b4ced6977765a7cc34342c5e9113f208793f483794afefa9689c76b3b4dedca94f
 DIST hugo-0.127.0.tar.gz 21132608 BLAKE2B 
6fa8ae09d325292715d94f28e13d3bce8efcecc5e729da3644a054857aa3e11893068bd25524857e7dde6bab92efc9acb5b0de823c8a6246b9f5e83b07c4e279
 SHA512 
829d118f12f153794ed882572a37ec2a3b3ade9c8160a754d3d411d6aede22c15e44dd75a52443e3cc7fc8ea1f65febecac5a47b4e09cc42006d7badd1a0fa2f
+DIST hugo-0.128.2-vendor.tar.xz 6698936 BLAKE2B 
28762e61a7e7452545889f31a751dea236f90c352bc63ac0b33a1e8cf0c7d9091d5ccc7cefc2b47f37db7a10f44636d4fbda02af3ca7be2e9cba64b564b85b87
 SHA512 
7576830db0a9058117ab5ba0c7269d5d75114695183882af5184a79088235a22aad3691e114892f179e107bf06048c6d302019fb0bb85d492715922a772b2224
+DIST hugo-0.128.2.tar.gz 20239793 BLAKE2B 
47d75606053e44a0f863dbb88050ff5323e33c1306a47baff237db7fa41dce0559960785105ad8643dcef1eeb149054b5536da168ff978ac0b5c3c5398379b6f
 SHA512 
4710fceb11872577a1d9c929d296dc79829135af0c509ac0b7b8142568b0e907c2de28c9f482cc1138d9595086363397166eb2ca208fa4fdf1beadd168558787

diff --git a/www-apps/hugo/files/hugo-0.128.0-skip-some-tests.patch 
b/www-apps/hugo/files/hugo-0.128.0-skip-some-tests.patch
new file mode 100644
index 000000000000..409e267fd709
--- /dev/null
+++ b/www-apps/hugo/files/hugo-0.128.0-skip-some-tests.patch
@@ -0,0 +1,79 @@
+From 890a1842ce705c56f71ea661d0d0be43e11d5df1 Mon Sep 17 00:00:00 2001
+From: tastytea <[email protected]>
+Date: Fri, 8 Sep 2023 20:01:03 +0200
+Subject: [PATCH] skip some tests
+
+reasons:
+  - needs to be in a git repo
+  - needs special test dependencies
+  - requires network access
+  - is time sensitive
+---
+ common/para/para_test.go                                      | 1 +
+ modules/client_test.go                                        | 4 ++++
+ .../resource_factories/create/create_integration_test.go      | 1 +
+ 3 files changed, 6 insertions(+)
+
+diff --git a/common/para/para_test.go b/common/para/para_test.go
+index 2d9188e..daf0560 100644
+--- a/common/para/para_test.go
++++ b/common/para/para_test.go
+@@ -69,6 +69,7 @@ func TestPara(t *testing.T) {
+       })
+ 
+       c.Run("Time", func(c *qt.C) {
++        c.Skip("time sensitive")
+               const n = 100
+ 
+               p := New(5)
+diff --git a/modules/client_test.go b/modules/client_test.go
+index 0ee7e0d..4bb8843 100644
+--- a/modules/client_test.go
++++ b/modules/client_test.go
+@@ -72,6 +72,7 @@ github.com/gohugoio/hugoTestModules1_darwin/[email protected] 
github.com/gohugoio/h
+       }
+ 
+       c.Run("All", func(c *qt.C) {
++              c.Skip("Test dependencies not available")
+               client, clean := newClient(c, func(cfg *ClientConfig) {
+                       cfg.ModuleConfig = DefaultModuleConfig
+               }, defaultImport)
+@@ -111,6 +112,7 @@ project 
github.com/gohugoio/hugoTestModules1_darwin/[email protected]+vendor
+       })
+ 
+       c.Run("IgnoreVendor", func(c *qt.C) {
++              c.Skip("Test dependencies not available")
+               client, clean := newClient(
+                       c, func(cfg *ClientConfig) {
+                               cfg.ModuleConfig = DefaultModuleConfig
+@@ -129,6 +131,7 @@ project 
github.com/gohugoio/hugoTestModules1_darwin/[email protected]+vendor
+       })
+ 
+       c.Run("NoVendor", func(c *qt.C) {
++              c.Skip("Test dependencies not available")
+               mcfg := DefaultModuleConfig
+               mcfg.NoVendor = "**"
+               client, clean := newClient(
+@@ -148,6 +151,7 @@ project 
github.com/gohugoio/hugoTestModules1_darwin/[email protected]+vendor
+       })
+ 
+       c.Run("VendorClosest", func(c *qt.C) {
++              c.Skip("Test dependencies not available")
+               mcfg := DefaultModuleConfig
+               mcfg.VendorClosest = true
+ 
+diff --git a/resources/resource_factories/create/create_integration_test.go 
b/resources/resource_factories/create/create_integration_test.go
+index 1708457..e81f4de 100644
+--- a/resources/resource_factories/create/create_integration_test.go
++++ b/resources/resource_factories/create/create_integration_test.go
+@@ -25,6 +25,7 @@ import (
+ )
+ 
+ func TestGetRemoteHead(t *testing.T) {
++      t.Skip("Requires network access")
+       files := `
+ -- config.toml --
+ [security]
+-- 
+2.44.2
+

diff --git a/www-apps/hugo/hugo-0.128.2.ebuild 
b/www-apps/hugo/hugo-0.128.2.ebuild
new file mode 100644
index 000000000000..b3f3114af58e
--- /dev/null
+++ b/www-apps/hugo/hugo-0.128.2.ebuild
@@ -0,0 +1,101 @@
+# Copyright 2018-2024 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 Unlicense"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
+IUSE="doc +extended test"
+
+BDEPEND="
+       >=dev-lang/go-1.22.2
+       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.128.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}"
+       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,_npm{,_withexisting}}.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