Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mani: Install manpage and completions #27402

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion devel/mani/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PortGroup golang 1.0

go.setup github.com/alajmo/mani 0.30.0 v
github.tarball_from archive
revision 0
revision 1

homepage https://manicli.com

Expand Down Expand Up @@ -36,6 +36,29 @@ build.cmd make
build.pre_args DATE=""
build.args build

post-build {
# Generate shell completions for supported shells
foreach shell {bash fish zsh} {
system -W ${worksrcpath}/dist \
"./${name} completion ${shell} > ${name}.${shell}"
}
}

destroot {
xinstall -m 0755 ${worksrcpath}/dist/${name} ${destroot}${prefix}/bin/

set bash_comp_path ${destroot}${prefix}/share/bash-completion/completions
xinstall -m 0755 -d ${bash_comp_path}
xinstall -m 0644 ${worksrcpath}/dist/${name}.bash ${bash_comp_path}/${name}

set fish_comp_path ${destroot}${prefix}/share/fish/vendor_completions.d
xinstall -m 0755 -d ${fish_comp_path}
xinstall -m 0644 ${worksrcpath}/dist/${name}.fish ${fish_comp_path}

set zsh_comp_path ${destroot}${prefix}/share/zsh/site-functions
xinstall -m 0755 -d ${zsh_comp_path}
xinstall -m 0644 ${worksrcpath}/dist/${name}.zsh ${zsh_comp_path}/_${name}

xinstall -m 0755 -d ${destroot}${prefix}/share/man/man1
xinstall -m 0444 ${worksrcpath}/core/mani.1 ${destroot}${prefix}/share/man/man1
}