app-crypt/gpgme: skip tests when WORKDIR is too long
authorAlon Bar-Lev <alonbl@gentoo.org>
Sun, 7 Jan 2018 18:10:39 +0000 (20:10 +0200)
committerAlon Bar-Lev <alonbl@gentoo.org>
Sun, 7 Jan 2018 18:10:55 +0000 (20:10 +0200)
Closes: https://bugs.gentoo.org/643696
Package-Manager: Portage-2.3.13, Repoman-2.3.3

app-crypt/gpgme/gpgme-1.10.0.ebuild

index 110e0e94550bd523ff2f3cd46ed8f0e4d4d29ad1..ce5b9f1ca7056104746894b95a41c31476f22463 100644 (file)
@@ -44,15 +44,14 @@ do_python() {
        fi
 }
 
-pkg_pretend() {
-       local MAX_WORKDIR=66
-
-       [[ "${#WORKDIR}" -le "${MAX_WORKDIR}" ]] ||
-               die "Cannot build package as WORKDIR '${WORKDIR}' is longer than ${MAX_WORKDIR} which will fail build"
-}
-
 pkg_setup() {
        addpredict /run/user/$(id -u)/gnupg
+
+       local MAX_WORKDIR=66
+       if [[ "${#WORKDIR}" -gt "${MAX_WORKDIR}" ]]; then
+               ewarn "Disabling tests as WORKDIR '${WORKDIR}' is longer than ${MAX_WORKDIR} which will fail tests"
+               SKIP_TESTS=1
+       fi
 }
 
 src_prepare() {
@@ -76,6 +75,7 @@ src_configure() {
        fi
 
        econf \
+               $([[ -n "${SKIP_TESTS}" ]] && echo "--disable-gpg-test --disable-gpgsm-test") \
                --enable-languages="${languages[*]}" \
                $(use_enable static-libs static)
 
@@ -90,6 +90,8 @@ src_compile() {
 }
 
 src_test() {
+       [[ -z "${SKIP_TESTS}" ]] || return
+
        default
        if use python; then
                test_python() {