On 2023/05/02 11:37, Laurent Cheylus wrote:
> Hi,
> 
> an update for devel/goreleaser with the latest version 1.17.2.
> 
> goreleaser is a Go tool to deliver Go binaries as fast and easily as
> possible => https://goreleaser.com/
> 
> - update Makefile and modules.inc for version 1.17.2 => build is OK on amd64
> with Go 1.20.1
> - update Makefile and pkg/PLIST to add shell completion for bash/fish/zsh
> 
> Build and tests OK on current/amd64.
> 
> Unless there's any objections, I'd like to take maintainership for this
> port. I'm using this tool for my Go projects.
> 
> Comments welcome and please commit if OK.
> 
> Laurent
> 

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}.

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.


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    2 May 2023 18:15: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 > 
${WRKSRC}/completion.bash
+       ${MODGO_WORKSPACE}/bin/goreleaser completion fish > 
${WRKSRC}/completion.fish
+       ${MODGO_WORKSPACE}/bin/goreleaser completion zsh > 
${WRKSRC}/completion.zsh
+
+post-install:
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/bash-completion/completions/
+       ${INSTALL_DATA} ${WRKSRC}/completion.bash \
+               ${PREFIX}/share/bash-completion/completions/goreleaser
+
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/fish/completions/
+       ${INSTALL_DATA} ${WRKSRC}/completion.fish \
+               ${PREFIX}/share/fish/completions/goreleaser.fish
+
+       ${INSTALL_DATA_DIR} ${PREFIX}/share/zsh/site-functions/
+       ${INSTALL_DATA} ${WRKSRC}/completion.zsh \
+               ${PREFIX}/share/zsh/site-functions/_goreleaser
 
 .include "modules.inc"
 

Reply via email to