From 22952612f3df2a7f1b2dd983b88544365a5e06fc Mon Sep 17 00:00:00 2001 From: Nuno Teixeira Date: Tue, 25 Jul 2023 07:59:56 +0100 Subject: devel/gum: Add fish completion and port improvements - gum binary is installed by default, so no need to use INSTALL_PROGRAM (or wrongly INSTALL_SCRIPT) - add fish completion - do generation of man and completions in post-build - use correct go variable to execute cmd on post-build - install stuff on post-install - move man page to a valid location (${PREFIX}/man being considered as deprecated.) PR: 272668 --- devel/gum/Makefile | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/devel/gum/Makefile b/devel/gum/Makefile index 24df8c10d37d..a79ec711e177 100644 --- a/devel/gum/Makefile +++ b/devel/gum/Makefile @@ -1,6 +1,7 @@ PORTNAME= gum DISTVERSIONPREFIX= v DISTVERSION= 0.11.0 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= dave@bitboss.ca @@ -14,20 +15,27 @@ USES= go:modules GO_MODULE= github.com/charmbracelet/gum PLIST_FILES= bin/gum \ - etc/bash_completion.d/gum \ - man/man1/gum.1.gz \ + etc/bash_completion.d/gum.bash \ + share/fish/completions/gum.fish \ + share/man/man1/gum.1.gz \ share/zsh/site-functions/_gum post-build: - ${MKDIR} ${WRKDIR}/manpages - ${WRKDIR}/bin/gum man > ${WRKDIR}/manpages/gum.1 + ${GO_WRKDIR_BIN}/${PORTNAME} man > ${WRKSRC}/${PORTNAME}.1 +.for SHELL in bash fish zsh + ${GO_WRKDIR_BIN}/${PORTNAME} completion ${SHELL} > ${WRKSRC}/${SHELL} +.endfor -do-install: - ${INSTALL_SCRIPT} ${WRKDIR}/bin/gum ${STAGEDIR}${PREFIX}/bin/ - ${INSTALL_MAN} ${WRKDIR}/manpages/gum.1 ${STAGEDIR}${PREFIX}/man/man1/ - ${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d - ${WRKDIR}/bin/gum completion bash > ${STAGEDIR}${PREFIX}/etc/bash_completion.d/gum - ${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions - ${WRKDIR}/bin/gum completion zsh > ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_gum +post-install: + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d + ${INSTALL_DATA} ${WRKSRC}/bash \ + ${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME}.bash + @${MKDIR} ${STAGEDIR}${PREFIX}/share/fish/completions + ${INSTALL_DATA} ${WRKSRC}/fish \ + ${STAGEDIR}${PREFIX}/share/fish/completions/${PORTNAME}.fish + @${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions + ${INSTALL_DATA} ${WRKSRC}/zsh \ + ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME} + ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${PREFIX}/share/man/man1 .include -- cgit v1.2.3