app-crypt/gpgme: fail pretend if workdir is too long
authorAlon Bar-Lev <alonbl@gentoo.org>
Sat, 6 Jan 2018 20:44:52 +0000 (22:44 +0200)
committerAlon Bar-Lev <alonbl@gentoo.org>
Sat, 6 Jan 2018 20:46:45 +0000 (22:46 +0200)
Bug: https://bugs.gentoo.org/643696
Package-Manager: Portage-2.3.13, Repoman-2.3.3

app-crypt/gpgme/gpgme-1.10.0.ebuild

index 34e7e743665abc83d6d52fb781b0f6df2e2d6925..81ca9ecddb2fb3541afb7e35c1952b4deb6ad3b1 100644 (file)
@@ -44,10 +44,26 @@ 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
 }
 
+src_prepare() {
+       default
+
+       # Make best effort to allow longer PORTAGE_TMPDIR
+       # as usock limitation fails build/tests
+       ln -s "${P}" "${WORKDIR}/b"
+       S="${WORKDIR}/b"
+}
+
 src_configure() {
        local languages=()
        use common-lisp && languages+=( "cl" )