[macports-ports] 09/17: cargo PG: respect build_arch; allow universal build
Rainer Müller
raimue at macports.org
Fri Apr 27 23:24:53 UTC 2018
On 2018-04-28 00:34, Marcus Calhoun-Lopez wrote:
> Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
> in repository macports-ports.
>
> https://github.com/macports/macports-ports/commit/68a34f577814e3e5b3f444530262b109093da515
>
> commit 68a34f577814e3e5b3f444530262b109093da515 Author: Marcus Calhoun-Lopez <mcalhoun at macports.org>
> AuthorDate: Fri Apr 27 11:47:22 2018 -0700
>
> cargo PG: respect build_arch; allow universal build ---
> _resources/port1.0/group/cargo-1.0.tcl | 56 ++++++++++++++++++++++++++++++++++
> devel/mesalink/Portfile | 2 ++
> textproc/ripgrep/Portfile | 31 +++++++++++--------
> 3 files changed, 77 insertions(+), 12 deletions(-)
> diff --git a/textproc/ripgrep/Portfile b/textproc/ripgrep/Portfile
> index c62e042..7dbba25 100644 --- a/textproc/ripgrep/Portfile +++
> b/textproc/ripgrep/Portfile @@ -67,16 +67,23 @@ depends_build-append \ port:asciidoc \
> port:docbook-xsl
>
> -destroot { - xinstall -m 755 ${worksrcpath}/target/release/rg
> ${destroot}${prefix}/bin/ - ln -s rg ${destroot}${prefix}/bin/ripgrep
> - - set outpath
> ${worksrcpath}/target/release/build/ripgrep-65e5a64db1247a47/out/ -
> xinstall -m 644 ${outpath}/rg.1 ${destroot}${prefix}/share/man/man1/ -
> xinstall -d -m 755
> ${destroot}${prefix}/share/bash-completion/completions - xinstall -m
> 644 ${outpath}/rg.bash
> ${destroot}${prefix}/share/bash-completion/completions/rg - xinstall
> -d -m 755 ${destroot}${prefix}/share/fish/completions - xinstall -m
> 644 ${outpath}/rg.fish ${destroot}${prefix}/share/fish/completions/ -
> xinstall -d -m 755 ${destroot}${prefix}/share/zsh/site-functions -
> xinstall -m 644 ${worksrcpath}/complete/_rg
> ${destroot}${prefix}/share/zsh/site-functions/ +# muniversal build
> requires Makefile +# OUTDIR contains a checksum, so it is not know
> until late in the build process and may +# change with a change in the
> cargo PortGroup
The out dir can be overriden with the environment variable OUT_DIR, used
by build.rs. I was going to change this with the next update.
> +destroot.args-append -f Makefile-Install +post-extract { + set
> makefile [open ${worksrcpath}/Makefile-Install "w"] + # from
> ci/utils.sh + puts ${makefile} "OUTDIR=\$(shell find . -name
> ripgrep-stamp -print0 | xargs -0 ls -t | head -n1 | xargs dirname)" +
> puts ${makefile} "install:" + puts ${makefile} "\tinstall -m 0755
> target/\$(CARGO_BUILD_TARGET)/release/rg \$(DESTDIR)${prefix}/bin" +
> puts ${makefile} "\tln -s rg \$(DESTDIR)${prefix}/bin/ripgrep" + puts
> ${makefile} "\tinstall -m 0644 \$(OUTDIR)/rg.1
> \$(DESTDIR)${prefix}/share/man/man1" + puts ${makefile} "\tinstall -d
> -m 0755 \$(DESTDIR)${prefix}/share/bash-completion/completions" + puts
> ${makefile} "\tinstall -m 0644 \$(OUTDIR)/rg.bash
> \$(DESTDIR)${prefix}/share/bash-completion/completions" + puts
> ${makefile} "\tinstall -d -m 0755
> \$(DESTDIR)${prefix}/share/fish/completions" + puts ${makefile}
> "\tinstall -m 0644 \$(OUTDIR)/rg.fish
> \$(DESTDIR)${prefix}/share/fish/completions" + puts ${makefile}
> "\tinstall -d -m 0755 \$(DESTDIR)${prefix}/share/zsh/site-functions" +
> puts ${makefile} "\tinstall -m 0644 complete/_rg
> \$(DESTDIR)${prefix}/share/zsh/site-functions/" + close ${makefile} }
Same comment for this Makefile as for the changes to fd. Why write a
Makefile from the Portfile? Even shipping the Makefile in files/ would
be better than this hack.
destroot {} is exactly meant for this kind of code. If muniversal cannot
handle it, supporting +universal is not important enough for me to
maintain this.
I do not consider this a minor change under the openmaintainer policy.
If you change the cargo port group in a way that requires such big
changes in ports, please discuss them first. If you cannot wait to
update your own ports, then commit the updated port group as cargo 1.1
instead.
Rainer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20180428/64fddc11/attachment.html>
More information about the macports-dev
mailing list