Skip to content

Commit

Permalink
fd: use new features of cargo PG
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusCalhoun-Lopez committed Apr 27, 2018
1 parent 968ddf5 commit 24864ae
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions sysutils/fd/Portfile
Expand Up @@ -22,6 +22,8 @@ checksums fd-${version}.tar.gz \
sha256 e6ba21e66a295b9fb69bfc9a361813b3c7d73b8d29dc819d37d21af750814ee9 \
size 49655

cargo.direct_call yes

cargo.crates \
aho-corasick 0.6.4 d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4 \
ansi_term 0.11.0 ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b \
Expand Down Expand Up @@ -79,22 +81,23 @@ pre-build {

build.env-append SHELL_COMPLETIONS_DIR="${worksrcpath}/shell_completions"

destroot {
xinstall -m 755 ${worksrcpath}/target/release/${name} ${destroot}${prefix}/bin/
xinstall -m 444 ${worksrcpath}/doc/${name}.1 ${destroot}${prefix}/share/man/man1/
# muniversal build requires Makefile
destroot.args-append -f Makefile-Install
post-extract {
set makefile [open ${worksrcpath}/Makefile-Install "w"]
puts ${makefile} "install:"
puts ${makefile} "\tinstall -m 0755 target/\$(CARGO_BUILD_TARGET)/release/${name} \$(DESTDIR)${prefix}/bin"
puts ${makefile} "\tinstall -m 0444 doc/${name}.1 \$(DESTDIR)${prefix}/share/man/man1/"

puts ${makefile} "\tinstall -d -m 0755 \$(DESTDIR)${prefix}/share/doc/${name}"
puts ${makefile} "\tinstall -m 0644 README.md LICENSE-MIT LICENSE-APACHE \$(DESTDIR)${prefix}/share/doc/${name}"

xinstall -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath} \
README.md LICENSE-MIT LICENSE-APACHE \
${destroot}${prefix}/share/doc/${name}
puts ${makefile} "\tinstall -d -m 0755 \$(DESTDIR)${prefix}/share/bash-completion/completions"
puts ${makefile} "\tinstall -m 644 ${worksrcpath}/shell_completions/fd.bash \$(DESTDIR)${prefix}/share/bash-completion/completions/fd"
puts ${makefile} "\tinstall -d -m 0755 \$(DESTDIR)${prefix}/share/zsh/site-functions"
puts ${makefile} "\tinstall -m 644 ${worksrcpath}/shell_completions/_fd \$(DESTDIR)${prefix}/share/zsh/site-functions/_fd"
puts ${makefile} "\tinstall -d -m 0755 \$(DESTDIR)${prefix}/share/fish/completions"
puts ${makefile} "\tinstall -m 644 ${worksrcpath}/shell_completions/fd.fish \$(DESTDIR)${prefix}/share/fish/completions/fd.fish"

xinstall -d ${destroot}${prefix}/share/bash-completion/completions
xinstall -m 644 ${worksrcpath}/shell_completions/fd.bash \
${destroot}${prefix}/share/bash-completion/completions/fd
xinstall -d ${destroot}${prefix}/share/zsh/site-functions
xinstall -m 644 ${worksrcpath}/shell_completions/_fd \
${destroot}${prefix}/share/zsh/site-functions/_fd
xinstall -d ${destroot}${prefix}/share/fish/completions
xinstall -m 644 ${worksrcpath}/shell_completions/fd.fish \
${destroot}${prefix}/share/fish/completions/fd.fish
close ${makefile}
}

0 comments on commit 24864ae

Please sign in to comment.