<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/c61ef4ad76ea1f5079f74eb6525e07b0ee1f03d1">https://github.com/macports/macports-ports/commit/c61ef4ad76ea1f5079f74eb6525e07b0ee1f03d1</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 c61ef4ad76e rust PG: add ability to add flags to rust compiler
</span>c61ef4ad76e is described below
<span style='display:block; white-space:pre;color:#808000;'>commit c61ef4ad76ea1f5079f74eb6525e07b0ee1f03d1
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Sat Mar 18 15:37:09 2023 -0700
<span style='display:block; white-space:pre;color:#404040;'> rust PG: add ability to add flags to rust compiler
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> In particular, --remap-path-prefix prevents
</span><span style='display:block; white-space:pre;color:#404040;'> build information from bing included installed binaries.
</span>---
_resources/port1.0/group/rust-1.0.tcl | 15 +++++++++++++++
1 file changed, 15 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/rust-1.0.tcl b/_resources/port1.0/group/rust-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 930c3f066d4..aafa1b152d5 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/rust-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/rust-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -63,6 +63,14 @@ default cargo.offline_cmd {--frozen}
</span> # so offer the option of running cargo-update
default cargo.update {no}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# use `--remap-path-prefix` to prevent build information from bing included installed binaries
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options rust.remap
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default rust.remap {${cargo.home} "" ${worksrcpath} ""}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# flags to be passed to the rust compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options rust.flags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default rust.flags {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> options rust.upstream_deployment_target \
rust.upstream_archs \
rust.use_cctools \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -669,6 +677,9 @@ post-extract {
</span>
puts $conf "\[build\]"
puts $conf "rustc = \"${prefix}/bin/rustc\""
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[option rust.flags] ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $conf "rustflags = \[\"[join [option rust.flags] {", "}]\"\]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
# be sure to include all architectures in case, e.g., a 64-bit Cargo compiles a 32-bit port
foreach arch {arm64 x86_64 i386 ppc ppc64} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -742,6 +753,10 @@ proc rust::rust_pg_callback {} {
</span> if { ${subport} ne "rust" && [join [lrange [split ${subport} -] 0 1] -] ne "rust-bootstrap" } {
# port is *not* building Rust
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach {f s} [option rust.remap] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rust.flags-prepend --remap-path-prefix=${f}=${s}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> depends_build-delete port:rust
depends_build-append port:rust
</pre><pre style='margin:0'>
</pre>