On 2020/10/28 21:34, Matthieu Herrb wrote:
> Hi,
>
> On one of my machines where I'm building ports, I have a /tmp
> partition that is a too small (300MB) for building many of the go
> ports (gitea, facette,...)
>
> Those ports seem to unconditionnaly use /tmp as intermediate storage.
>
> I've plenty of space under /usr/ports. Is there a knob somehere to
> tell ports build (via dpb) to write to, let's say /usr/ports/tmp
> instead.
>
> (I've tried seting the TMPDIR environment variable without success...)
>
> Thanks.
> --
> Matthieu Herrb
>
This might be one way to do it..
Index: go.port.mk
===================================================================
RCS file: /cvs/ports/lang/go/go.port.mk,v
retrieving revision 1.35
diff -u -p -r1.35 go.port.mk
--- go.port.mk 9 Oct 2020 13:23:51 -0000 1.35
+++ go.port.mk 28 Oct 2020 20:58:37 -0000
@@ -45,6 +45,7 @@ MODGO_GOPATH ?= ${MODGO_WORKSPACE}:${MO
# to explicitly disable SSE on i386 builds.
MAKE_ENV += GO386=387
MAKE_ENV += GOCACHE="${MODGO_GOCACHE}"
+MAKE_ENV += GOTMPDIR="${WRKDIR}/go-tmp"
MODGO_CMD ?= ${SETENV} ${MAKE_ENV} go
MODGO_BUILD_CMD = ${MODGO_CMD} install ${MODGO_FLAGS}
@@ -107,6 +108,8 @@ MODGO_SETUP_WORKSPACE = mkdir -p ${WRKSR
WRKSRC ?= ${WRKDIR}/${MODGO_MODNAME}@${MODGO_VERSION}
MODGO_SETUP_WORKSPACE = ln -sf ${WRKSRC} ${WRKDIR}/${MODGO_MODNAME}
.endif
+
+MODGO_SETUP_WORKSPACE += mkdir -p ${WRKDIR}/go-tmp;
INSTALL_STRIP =
.if ${MODGO_TYPE:L:Mbin}