<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7a04eb80e914077f852cfea9a805bd9f095a09e0">https://github.com/macports/macports-ports/commit/7a04eb80e914077f852cfea9a805bd9f095a09e0</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 7a04eb80e91 rust-compiler-wrap: Handle compiler options with spaces and do not fail with non-versioned compiler selections
</span>7a04eb80e91 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 7a04eb80e914077f852cfea9a805bd9f095a09e0
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Wed Apr 28 11:14:34 2021 +0100
<span style='display:block; white-space:pre;color:#404040;'> rust-compiler-wrap: Handle compiler options with spaces and do not fail with non-versioned compiler selections
</span>---
lang/rust/Portfile | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/rust/Portfile b/lang/rust/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 787d0fd5572..d0bd8dd06c6 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/rust/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/rust/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -189,6 +189,10 @@ proc envs_append { value } {
</span> # to rust to ensure they are available when rust is both built and installed.
set wrapdir ${prefix}/libexec/${ccwrap}/bin
subport ${ccwrap} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Remove after next rust version update
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${version} eq "1.51.0" } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ revision [expr ${revision} + 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> # Enable support in scripts for all neccessary versions
legacysupport.newest_darwin_requires_legacy ${max_wrap_darwin}
description Wrapped compiler commands for ${name}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -208,31 +212,38 @@ subport ${ccwrap} {
</span> xinstall -d ${destroot}${prefix}/share/doc/${ccwrap}
system "echo '${description}' > ${destroot}${prefix}/share/doc/${ccwrap}/README"
if { ${os.major} <= ${max_wrap_darwin} } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Deduce MP clang version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![regexp {macports-clang-(.*)} ${configure.compiler} -> llvm_ver]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Unsupported compiler: ${configure.compiler}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Try and deduce MacPorts LLVM version from configured compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If this fails just use exact settings for cc and cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_cc ${configure.cc}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_cxx ${configure.cxx}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_ld ld
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[regexp {macports-clang-(.*)} ${configure.compiler} -> llvm_ver]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set llvm_path ${prefix}/libexec/llvm-${llvm_ver}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_cc ${llvm_path}/bin/clang
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_cxx ${llvm_path}/bin/clang++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set sel_ld ${llvm_path}/bin/ld
</span> }
xinstall -m 755 -d ${destroot}${wrapdir}
proc create_wrapper { fname comp flags } {
set f [ open ${fname} w 0755 ]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts ${f} "#!/bin/bash"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts ${f} "exec ${comp} ${flags} \$\{\@\}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${f} "#!/bin/bash"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${f} "exec ${comp} ${flags} \"\$\{\@\}\""
</span> close ${f}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set llvm_dir ${prefix}/libexec/llvm-${llvm_ver}/bin
</span> create_wrapper ${destroot}${wrapdir}/clang \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- "\$\{MACPORTS_RUST_CC\:\-${llvm_dir}/clang\}" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "\$\{MACPORTS_RUST_CC\:\-${sel_cc}\}" \
</span> "\$\{MACPORTS_LEGACY_SUPPORT_CPPFLAGS\}"
create_wrapper ${destroot}${wrapdir}/clang++ \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- "\$\{MACPORTS_RUST_CXX\:\-${llvm_dir}/clang++\}" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "\$\{MACPORTS_RUST_CXX\:\-${sel_cxx}\}" \
</span> "\$\{MACPORTS_LEGACY_SUPPORT_CPPFLAGS\}"
create_wrapper ${destroot}${wrapdir}/ld-rust \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- "\$\{MACPORTS_RUST_CC\:\-${llvm_dir}/clang\}" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "\$\{MACPORTS_RUST_CC\:\-${sel_cc}\}" \
</span> "\$\{MACPORTS_LEGACY_SUPPORT_CPPFLAGS\} \$\{MACPORTS_LEGACY_SUPPORT_LDFLAGS\}"
create_wrapper ${destroot}${wrapdir}/ld \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- "\$\{MACPORTS_RUST_LD\:\-${llvm_dir}/ld\}" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "\$\{MACPORTS_RUST_LD\:\-${sel_ld}\}" \
</span> "\$\{MACPORTS_LEGACY_SUPPORT_LDFLAGS\}"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach cmd { ar as nm nm-classic libtool lipo objdump otool ranlib size size-classic strip strings bitcode-strip segedit } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach cmd { ar as nm nm-classic libtool lipo objdump otool ranlib \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size size-classic strip strings bitcode-strip segedit } {
</span> ln -s ${prefix}/bin/${cmd} ${destroot}${wrapdir}/${cmd}
}
}
</pre><pre style='margin:0'>
</pre>