diff -urb ./Portfile /Users/macports/MacPorts/mports/lang/rust/Portfile
old
|
new
|
|
2 | 2 | |
3 | 3 | PortSystem 1.0 |
4 | 4 | PortGroup muniversal 1.0 |
| 5 | PortGroup active_variants 1.1 |
5 | 6 | |
6 | 7 | name rust |
7 | 8 | version 1.25.0 |
… |
… |
|
24 | 25 | |
25 | 26 | homepage https://www.rust-lang.org/ |
26 | 27 | |
| 28 | set ruststd_version 1.24.0 |
| 29 | set rustc_version 1.24.0 |
| 30 | set cargo_version 0.25.0 |
| 31 | set llvm_version 6.0 |
| 32 | |
27 | 33 | # can use cmake or cmake-devel; default to cmake. |
28 | 34 | depends_build path:bin/cmake:cmake \ |
29 | 35 | bin:python2.7:python27 |
30 | 36 | |
31 | | depends_lib port:llvm-6.0 |
| 37 | depends_lib port:llvm-${llvm_version} |
32 | 38 | |
33 | 39 | master_sites https://static.rust-lang.org/dist |
34 | 40 | |
… |
… |
|
36 | 42 | |
37 | 43 | patchfiles patch-src-librustc-llvm-lib.diff |
38 | 44 | |
39 | | set ruststd_version 1.24.0 |
40 | | set rustc_version 1.24.0 |
41 | | set cargo_version 0.25.0 |
42 | | |
43 | 45 | if {![variant_isset universal]} { |
44 | 46 | if {${build_arch} eq "i386"} { |
45 | 47 | set architectures i686 |
… |
… |
|
118 | 120 | --default-linker=${configure.cc} \ |
119 | 121 | --disable-codegen-tests \ |
120 | 122 | --disable-docs \ |
121 | | --llvm-root=${prefix}/libexec/llvm-6.0 \ |
122 | 123 | --release-channel=stable |
123 | 124 | |
| 125 | if {[variant_isset universal]} { |
| 126 | # LLVM is or will need to be universal |
| 127 | set copy_llvm 1 |
| 128 | } else { |
| 129 | if {![catch {set result [active_variants llvm-${llvm_version} "universal" ""]}] && $result} { |
| 130 | # LLVM was installed with universal variant |
| 131 | set copy_llvm 1 |
| 132 | } else { |
| 133 | set copy_llvm 0 |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | if {!${copy_llvm}} { |
| 138 | # LLVM is NOT universal, so use installed version |
| 139 | configure.args-append \ |
| 140 | --llvm-root=${prefix}/libexec/llvm-${llvm_version} |
| 141 | } else { |
| 142 | # copy LLVM and thin static libraries |
| 143 | # see https://trac.macports.org/ticket/56351 |
| 144 | # see https://github.com/rust-lang/rust/issues/50220 |
| 145 | if {[variant_isset universal]} { |
| 146 | set archs ${universal_archs} |
| 147 | foreach arch ${universal_archs} { |
| 148 | lappend merger_configure_args(${arch}) \ |
| 149 | --llvm-root=${workpath}/llvm-${llvm_version}-${arch} |
| 150 | } |
| 151 | } else { |
| 152 | set archs ${build_arch} |
| 153 | configure.args-append \ |
| 154 | --llvm-root=${workpath}/llvm-${llvm_version}-${build_arch} |
| 155 | } |
| 156 | |
| 157 | post-extract { |
| 158 | foreach arch ${archs} { |
| 159 | system -W ${workpath} "cp -R ${prefix}/libexec/llvm-${llvm_version} ${workpath}/llvm-${llvm_version}-${arch}" |
| 160 | fs-traverse f ${workpath}/llvm-${llvm_version}-${arch} { |
| 161 | if {[file isfile $f] && [file type $f]!="link" && [file extension $f]==".a"} { |
| 162 | catch {system "lipo -thin ${arch} ${f} -o ${f}"} |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | |
124 | 169 | if {![variant_isset universal]} { |
125 | 170 | if {${build_arch} eq "i386"} { |
126 | 171 | set arch_name i686 |