Ticket #55962: Portfile.diff
File Portfile.diff, 9.3 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 7 years ago) |
---|
-
Portfile
old new 1 1 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4 2 2 3 3 PortSystem 1.0 4 PortGroup muniversal 1.0 4 5 5 6 name rust 6 7 version 1.24.1 … … 35 36 36 37 patchfiles patch-src-librustc-llvm-lib.diff 37 38 38 set rust_platform ${build_arch}-apple-darwin 39 40 if {${build_arch} eq "i386"} { 41 set rust_platform i686-apple-darwin 39 set ruststd_version 1.23.0 40 set rustc_version 1.23.0 41 set cargo_version 0.24.0 42 43 if {![variant_isset universal]} { 44 if {${build_arch} eq "i386"} { 45 set architectures i686 46 } else { 47 set architectures ${build_arch} 48 } 49 } else { 50 set architectures {} 51 foreach arch ${universal_archs} { 52 if {${arch} eq "i386"} { 53 lappend architectures i686 54 } else { 55 lappend architectures ${arch} 56 } 57 } 42 58 } 43 59 44 set stage0(ruststd) rust-std-1.23.0-${rust_platform} 45 set stage0(rustc) rustc-1.23.0-${rust_platform} 46 set stage0(cargo) cargo-0.24.0-${rust_platform} 47 48 distfiles-append ${stage0(ruststd)}${extract.suffix} \ 49 ${stage0(rustc)}${extract.suffix} \ 50 ${stage0(cargo)}${extract.suffix} 60 foreach arch ${architectures} { 61 distfiles-append rust-std-${ruststd_version}-${arch}-apple-${os.platform}${extract.suffix} \ 62 rustc-${rustc_version}-${arch}-apple-${os.platform}${extract.suffix} \ 63 cargo-${cargo_version}-${arch}-apple-${os.platform}${extract.suffix} 64 } 51 65 52 66 checksums ${distname}${extract.suffix} \ 53 67 rmd160 e4c92648fbd3499dcc54c6efdce53d5cdde010c4 \ 54 sha256 3ea53d45e8d2e9a41afb3340cf54b9745f845b552d802d607707cf04450761ef 68 sha256 3ea53d45e8d2e9a41afb3340cf54b9745f845b552d802d607707cf04450761ef \ 69 size 67512394 55 70 56 if {${build_arch} eq "i386"} { 57 checksums-append \ 58 ${stage0(ruststd)}${extract.suffix} \ 71 checksums-append \ 72 rust-std-${ruststd_version}-i686-apple-${os.platform}${extract.suffix} \ 59 73 rmd160 2873bd63f74c1d225a0a3392bb8cfa5534679dc1 \ 60 74 sha256 e454d4f5fd1e66f48d6ea8f102a96a15325cf969079f4485aab8e4486b96e2d8 \ 61 ${stage0(rustc)}${extract.suffix} \ 75 size 66640892 \ 76 rustc-${rustc_version}-i686-apple-${os.platform}${extract.suffix} \ 62 77 rmd160 e4622e6082c4666e06bc173ee669f8198661d04a \ 63 78 sha256 618b0dea1e1563d22cb58c1d54344c096e7a4e2d138a17413a349a3edc753745 \ 64 ${stage0(cargo)}${extract.suffix} \ 79 size 48081807 \ 80 cargo-${cargo_version}-i686-apple-${os.platform}${extract.suffix} \ 65 81 rmd160 17458dce93eb7e644385bd82ecb511311765e5e6 \ 66 sha256 6b7a0a97e0d87cca7b7a5e090d168be6cdbb03298381bece33df493447e17e76 67 } else { 68 checksums-append \ 69 ${stage0(ruststd)}${extract.suffix} \ 82 sha256 6b7a0a97e0d87cca7b7a5e090d168be6cdbb03298381bece33df493447e17e76 \ 83 size 3909191 84 85 checksums-append \ 86 rust-std-${ruststd_version}-x86_64-apple-${os.platform}${extract.suffix} \ 70 87 rmd160 5b2d5f9e7ed73112fc970d5d74eef392b5c490a8 \ 71 88 sha256 c2859aeb763edc07ec289a929c66f269373de67908d3a9be069868a8c103c833 \ 72 ${stage0(rustc)}${extract.suffix} \ 89 size 67553850 \ 90 rustc-${rustc_version}-x86_64-apple-${os.platform}${extract.suffix} \ 73 91 rmd160 f15d358053c4979a027299c68ba0dd8ca50df444 \ 74 92 sha256 61d8774c6e348addc1e82fe598b5d007f30d3d8992d95f0530048236dedf4e0d \ 75 ${stage0(cargo)}${extract.suffix} \ 93 size 49076336 \ 94 cargo-${cargo_version}-x86_64-apple-${os.platform}${extract.suffix} \ 76 95 rmd160 ac5eff8ae2489845f9761c275b03677a50309c1a \ 77 sha256 b6f7c662ea75a94f5a5e41c2fee95f09a5ba168429ac8cdd41f6ba2c78d1b07f 78 } 79 80 set stage0(dir) ${worksrcpath}/build/stage0 96 sha256 b6f7c662ea75a94f5a5e41c2fee95f09a5ba168429ac8cdd41f6ba2c78d1b07f \ 97 size 4215369 81 98 82 99 pre-fetch { 83 100 if {${os.platform} eq "darwin" && ${os.major} < 11} { … … 87 104 } 88 105 89 106 post-extract { 90 file mkdir ${stage0(dir)} 91 system "cp -r ${workpath}/${stage0(ruststd)}/rust-std-${rust_platform}/* ${stage0(dir)}" 92 system "cp -r ${workpath}/${stage0(rustc)}/rustc/* ${stage0(dir)}" 93 system "cp -r ${workpath}/${stage0(cargo)}/cargo/* ${stage0(dir)}" 107 foreach arch ${architectures} { 108 set rust_root ${worksrcpath}/build/stage0-${arch} 109 set rust_platform ${arch}-apple-${os.platform} 110 file mkdir ${rust_root} 111 system "cp -r ${workpath}/rust-std-${ruststd_version}-${rust_platform}/rust-std-${rust_platform}/* ${rust_root}" 112 system "cp -r ${workpath}/rustc-${rustc_version}-${rust_platform}/rustc/* ${rust_root}" 113 system "cp -r ${workpath}/cargo-${cargo_version}-${rust_platform}/cargo/* ${rust_root}" 114 } 94 115 } 95 116 96 configure.args --build=${rust_platform} \ 97 --enable-vendor \ 117 configure.args --enable-vendor \ 98 118 --default-linker=${configure.cc} \ 99 119 --disable-codegen-tests \ 100 120 --disable-docs \ 101 121 --llvm-root=${prefix}/libexec/llvm-5.0 \ 102 --local-rust-root=${stage0(dir)} \ 103 --release-channel=stable \ 122 --release-channel=stable 123 124 if {![variant_isset universal]} { 125 if {${build_arch} eq "i386"} { 126 set arch_name i686 127 } else { 128 set arch_name ${build_arch} 129 } 130 set rust_platform ${arch_name}-apple-${os.platform} 131 set rust_root ${worksrcpath}/build/stage0-${arch_name} 132 configure.args-append \ 133 --build=${rust_platform} \ 134 --local-rust-root=${rust_root} 135 } else { 136 foreach arch ${universal_archs} { 137 if {${arch} eq "i386"} { 138 set arch_name i686 139 } else { 140 set arch_name ${build_arch} 141 } 142 set rust_platform ${arch_name}-apple-${os.platform} 143 set rust_root ${worksrcpath}/build/stage0-${arch_name} 144 lappend merger_configure_args(${arch}) \ 145 --build=${rust_platform} \ 146 --local-rust-root=${rust_root} 147 } 148 } 149 150 foreach arch ${architectures} { 151 set rust_platform ${arch}-apple-${os.platform} 152 configure.args-append \ 104 153 --set=target.${rust_platform}.cc=${configure.cc} \ 105 154 --set=target.${rust_platform}.cxx=${configure.cxx} \ 106 155 --set=target.${rust_platform}.linker=${configure.cc} 156 } 107 157 108 158 configure.universal_args-delete --disable-dependency-tracking 109 159 160 post-configure { 161 # the bootstrap call to rustc uses cc for the linker 162 # place config file in the HOME directory 163 # see https://trac.macports.org/wiki/UsingTheRightCompiler 164 xinstall -d -m 0755 ${workpath}/.home/.cargo 165 set config [open ${workpath}/.home/.cargo/config w] 166 foreach arch ${architectures} { 167 set rust_platform ${arch}-apple-${os.platform} 168 puts ${config} "\[target.${rust_platform}\]" 169 puts ${config} "linker = \"${configure.cc}\"" 170 } 171 close ${config} 172 } 173 110 174 build.env RUSTC_SAVE_ANALYSIS=api 111 175 build.args VERBOSE=1 BOOTSTRAP_ARGS="-v -j${build.jobs}" 112 176 … … 115 179 test.args VERBOSE=1 116 180 117 181 destroot.args VERBOSE=1 118 post-destroot { 119 if {${subport} eq ${name}} { 182 if {${subport} eq ${name}} { 183 if {![variant_isset universal]} { 184 post-destroot { 185 if {${build_arch} eq "i386"} { 186 set arch_name i686 187 } else { 188 set arch_name ${build_arch} 189 } 190 set rust_platform ${arch_name}-apple-${os.platform} 120 191 file copy \ 121 192 ${worksrcpath}/build/${rust_platform}/stage1-std/${rust_platform}/release/deps/save-analysis \ 122 193 ${destroot}${prefix}/lib/rustlib/${rust_platform}/analysis … … 125 196 xinstall -m 644 ${worksrcpath}/src/etc/ctags.rust \ 126 197 ${destroot}${prefix}/share/${name} 127 198 } 199 } else { 200 merger-post-destroot { 201 foreach arch ${universal_archs} { 202 if {${arch} eq "i386"} { 203 set arch_name i686 204 } else { 205 set arch_name ${arch} 206 } 207 set rust_platform ${arch_name}-apple-${os.platform} 208 file copy \ 209 ${worksrcpath}-${arch}/build/${rust_platform}/stage1-std/${rust_platform}/release/deps/save-analysis \ 210 ${destroot}-${arch}${prefix}/lib/rustlib/${rust_platform}/analysis 211 212 xinstall -d ${destroot}-${arch}${prefix}/share/${name} 213 xinstall -m 644 ${worksrcpath}-${arch}/src/etc/ctags.rust \ 214 ${destroot}-${arch}${prefix}/share/${name} 215 } 216 } 217 } 128 218 } 129 219 130 220 livecheck.type regex