commit:     0953d865c767ec28eccf962454b7cfa82d46b9e6
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 23:36:32 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 23:33:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0953d865

www-apps/hugo: add check-reqs verification for the build

I happened to notice while cleaning up old directories in
/var/tmp/portage, that hugo took up 3.5 GB of space in a build that had
tests enabled. Surprisingly large compared to some other pretty large
packages. Make sure that users can actually handle this.

Closes: https://github.com/gentoo/gentoo/pull/37728
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 www-apps/hugo/hugo-0.128.2.ebuild | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/www-apps/hugo/hugo-0.128.2.ebuild 
b/www-apps/hugo/hugo-0.128.2.ebuild
index d49c59a1bdb9..919bb3ccc8f6 100644
--- a/www-apps/hugo/hugo-0.128.2.ebuild
+++ b/www-apps/hugo/hugo-0.128.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit go-module shell-completion
+inherit check-reqs go-module shell-completion
 
 DESCRIPTION="Fast static HTML and CSS website generator"
 HOMEPAGE="https://gohugo.io https://github.com/gohugoio/hugo";
@@ -42,6 +42,27 @@ PATCHES=(
        "${FILESDIR}"/${PN}-0.128.0-skip-some-tests.patch
 )
 
+_check_reqs() {
+       if [[ ${MERGE_TYPE} = binary ]] ; then
+               return 0
+       fi
+
+       if has test ${FEATURES}; then
+               CHECKREQS_DISK_BUILD="4G"
+       else
+               CHECKREQS_DISK_BUILD="1500M"
+       fi
+       check-reqs_${EBUILD_PHASE_FUNC}
+}
+
+pkg_pretend() {
+       _check_reqs
+}
+
+pkg_setup() {
+       _check_reqs
+}
+
 src_configure() {
        export CGO_ENABLED=1
        export CGO_CFLAGS="${CFLAGS}"

Reply via email to