Hi,

On 2023/05/02 22:38, Omar Polo wrote:
On 2023/05/02 19:18:00 +0100, Stuart Henderson <s...@spacehopper.org> wrote:
TMPDIR is a special variable and overriding it can cause problems
sometimes (it's normally set in the environment to /tmp and used by
various things; setting in a port Makefile can make it into the
environment actually used for the build in some cases).

I don't think there's a need for any special dir for that at all,
we can just write the generated completion files to ${WRKSRC}.

+1

So I'd use the below Makefile diff instead (I won't include the
other ~13000 lines of diff again :)

Otherwise looks good to me, it will be some time before my machine
ends up fetching the 4100 distfiles to do any testing but I'm
basically ok with it.

I have virtually the same diff locally (I used WRKBUILD rather than
WRKSRC, but it's fine either the way) and seems to be fine.  I wanted
to double check modules.inc but it filled my /tmp/ with 3.5G of random
crap^Wgit repos before failing.

Thanks Omar and Stuart for your comments.

Below my patch (only for Makefile, not included the whole diff, other files are untouched) to use WRKBUILD for shell completion files.

Build and tests are OK on current/amd64. Please commit if OK.

Laurent

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/goreleaser/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile	5 Oct 2022 14:54:23 -0000	1.8
+++ Makefile	3 May 2023 06:20:38 -0000
@@ -1,23 +1,43 @@
-BROKEN =	does not build with Go 1.17
-
 COMMENT =	deliver Go binaries as fast and easily as possible
 
 MODGO_MODNAME =	github.com/goreleaser/goreleaser
-MODGO_VERSION =	v1.7.0
+MODGO_VERSION =	v1.17.2
 
 HOMEPAGE =	https://goreleaser.com/
 
 DISTNAME =	goreleaser-${MODGO_VERSION}
-REVISION =	1
 
 CATEGORIES =	devel
 
+MAINTAINER =	Laurent Cheylus <f...@free.fr>
+
 # MIT
 PERMIT_PACKAGE =	Yes
 
-WANTLIB += c pthread
+WANTLIB +=	c pthread
+
+MODULES =	lang/go
+
+MODGO_LDFLAGS =	-X main.version=${MODGO_VERSION:S/v//}
 
-MODULES =		lang/go
+# Generate shells completion
+post-build:
+	${MODGO_WORKSPACE}/bin/goreleaser completion bash > ${WRKBUILD}/completion.bash
+	${MODGO_WORKSPACE}/bin/goreleaser completion fish > ${WRKBUILD}/completion.fish
+	${MODGO_WORKSPACE}/bin/goreleaser completion zsh > ${WRKBUILD}/completion.zsh
+
+post-install:
+	${INSTALL_DATA_DIR} ${PREFIX}/share/bash-completion/completions/
+	${INSTALL_DATA} ${WRKBUILD}/completion.bash \
+		${PREFIX}/share/bash-completion/completions/goreleaser
+
+	${INSTALL_DATA_DIR} ${PREFIX}/share/fish/completions/
+	${INSTALL_DATA} ${WRKBUILD}/completion.fish \
+		${PREFIX}/share/fish/completions/goreleaser.fish
+
+	${INSTALL_DATA_DIR} ${PREFIX}/share/zsh/site-functions/
+	${INSTALL_DATA} ${WRKBUILD}/completion.zsh \
+		${PREFIX}/share/zsh/site-functions/_goreleaser
 
 .include "modules.inc"
 

Reply via email to