Skip to content

Commit

Permalink
mani: Install manpage and completions
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jan 16, 2025
1 parent da4f25a commit 5ffc71e
Showing 1 changed file with 24 additions and 1 deletion.
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
}

0 comments on commit 5ffc71e

Please sign in to comment.