diff options
Diffstat (limited to 'sysutils/mods/Makefile')
| -rw-r--r-- | sysutils/mods/Makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sysutils/mods/Makefile b/sysutils/mods/Makefile new file mode 100644 index 000000000000..232a5eaef727 --- /dev/null +++ b/sysutils/mods/Makefile @@ -0,0 +1,62 @@ +PORTNAME= mods +DISTVERSIONPREFIX= v +DISTVERSION= 1.8.1 +PORTREVISION= 3 +CATEGORIES= sysutils + +MAINTAINER= mopp7@proton.me +COMMENT= AI for the command line, built for pipelines +WWW= https://github.com/charmbracelet/mods + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= aarch64 amd64 +ONLY_FOR_ARCHS_REASON= Requires Go module modernc.org/libc, which only supports FreeBSD aarch64 and amd64 + +USES= go:modules + +_BUILD_VERSION= ${DISTVERSION} +_BUILD_SHA= 9b36cf8 + +GO_MODULE= github.com/charmbracelet/${PORTNAME} +GO_BUILDFLAGS= -ldflags "\ + -s -w \ + -X main.Version=${_BUILD_VERSION} \ + -X main.CommitSHA=${_BUILD_SHA}" + +PLIST_FILES= bin/${PORTNAME} +DOCS= config_template.yml README.md +PORTDOCS= ${DOCS:T} + +OPTIONS_DEFINE= COMPLETIONS DOCS + +COMPLETIONS_DESC= Build and/or install shell completions + +COMPLETIONS_PLIST_FILES= etc/bash_completion.d/${PORTNAME} \ + share/fish/completions/${PORTNAME}.fish \ + share/zsh/site-functions/_${PORTNAME} + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR} + +post-build-COMPLETIONS-on: + @${MKDIR} ${GO_WRKSRC}/completions +.for sh in bash fish zsh + ${GO_WRKDIR_BIN}/${PORTNAME} completion ${sh} > \ + ${GO_WRKSRC}/completions/${PORTNAME}.${sh} +.endfor + +post-install-COMPLETIONS-on: + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d \ + ${STAGEDIR}${PREFIX}/share/fish/completions \ + ${STAGEDIR}${PREFIX}/share/zsh/site-functions + ${INSTALL_DATA} ${GO_WRKSRC}/completions/${PORTNAME}.bash \ + ${STAGEDIR}${PREFIX}/etc/bash_completion.d/${PORTNAME} + ${INSTALL_DATA} ${GO_WRKSRC}/completions/${PORTNAME}.fish \ + ${STAGEDIR}${PREFIX}/share/fish/completions/${PORTNAME}.fish + ${INSTALL_DATA} ${GO_WRKSRC}/completions/${PORTNAME}.zsh \ + ${STAGEDIR}${PREFIX}/share/zsh/site-functions/_${PORTNAME} + +.include <bsd.port.mk> |
