# -*- 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 # $Id$ PortSystem 1.0 PortGroup active_variants 1.1 PortGroup compiler_blacklist_versions 1.0 name rust version 1.0.0 categories lang devel platforms darwin supported_archs i386 x86_64 # https://github.com/mozilla/rust/issues/2024 universal_variant no license {MIT Apache-2} BSD zlib NCSA Permissive maintainers g5pw description A safe, concurrent, practical language long_description Rust is a curly-brace, block-structured expression \ language. It visually resembles the C language \ family, but differs significantly in syntactic and \ semantic details. Its design is oriented toward \ concerns of “programming in the large”, that is, of \ creating and maintaining boundaries — both abstract \ and operational — that preserve large-system \ integrity, availability and concurrency. homepage http://www.rust-lang.org/ pre-fetch { if {${os.platform} eq "darwin" && ${os.major} < 11} { ui_error "${name} is only supported on OS X 10.7 Lion or later." return -code error "unsupported platform version" } } # To take advantage of distfile mirroring and checksumming for the # snapshot compiler, we let base treat it as the distfile and deal with # the actual Rust source "manually". # Download the snapshot compiler; see src/snapshots.txt in the Rust # distribution. master_sites https://static.rust-lang.org/dist/:main \ https://static.rust-lang.org/stage0-snapshots/:snap distfiles ${name}c-${version}-src${extract.suffix}:main worksrcdir ${name}c-${version} checksums ${name}c-${version}-src${extract.suffix} \ rmd160 b1127e616619fcd981e33896d4f00c4bf548ce6b \ sha256 c304cbd4f7b25d116b73c249f66bdb5c9da8645855ce195a41bda5077b995eba set stage0(distdir) rust-stage0 set stage0(date) 2015-03-27 set stage0(rev) 5520801 set stage0(platform) macos-${configure.build_arch} set stage0(hash) [expr {${configure.build_arch} eq "i386" ? "0310b1a970f2da7e61770fd14dbbbdca3b518234" : "5f35d9c920b8083a7420ef8cf5b00d5ef3085dfa"}] set stage0_name [join "rust stage0 ${stage0(date)} ${stage0(rev)} ${stage0(platform)} ${stage0(hash)}" -].tar.bz2 distfiles-append ${stage0_name}:snap switch ${configure.build_arch} { i386 {checksums-append ${stage0_name} \ rmd160 15a0ffbcee0def1a056d69aa851edf2b8ca490b6 \ sha256 0cc20c5f3c808d6332bcc192b60d6a1e9ee313d481030d8d07ff42a831492ba2} default {checksums-append ${stage0_name} \ rmd160 a5ef6ad68e6e49b40d045e45227ad858b0935988 \ sha256 38076751be5a52a61285cced36879832a7a106d7ce0bfd2b2080c3cfc42de1ce} } # Only use compilers supported by upstream # (https://github.com/rust-lang/rust#building-from-source). compiler.blacklist {clang < 211} \ *dragonegg* \ gcc-3.3 {*gcc-4.[0-6]} \ macports-clang-2.9 # Building the bundled LLVM requires Python 2.4-2.7. All supported # OS X releases have 2.6. (Using MacPorts' LLVM ports fails either # during build or during testing.) depends_build bin:perl:perl5 \ bin:python2.6:python27 depends_skip_archcheck python27 # The libs for both targets link to libgcc and libstdc++. if {[regexp {^macports-gcc-(\d+)\.(\d+)$} ${configure.compiler} \ -> major minor]} { depends_lib-append {path:lib/libstdc\\+\\+\\.6\\.dylib:libstdcxx} require_active_variants gcc${major}${minor} universal require_active_variants {path:lib/libstdc\\+\\+\\.6\\.dylib:libstdcxx} \ universal } # TODO: Test whether i386 machines can cross-compile for x86_64. set tgts {i686-apple-darwin x86_64-apple-darwin} # TODO: Trying to build a cross-compiler breaks Intel 64 builds as # of 0.11.0. Worth fixing? # #configure.pre_args-append --target=[join $tgts ,] if {${configure.build_arch} eq "i386"} { configure.pre_args-append --build=[lindex $tgts 0] } else { configure.pre_args-append --build=[lindex $tgts 1] } # We need to use "--enable-rpath" as of a0546de, otherwise the build # produces improperly linked binaries. # (https://github.com/rust-lang/rust/issues/11747) # TODO: Build docs also, probably in a subport. configure.args --disable-docs \ --enable-local-rust \ --enable-rpath \ --local-rust-root=${workpath}/${stage0(distdir)} build.type gnu build.args VERBOSE=1 \ CC=${configure.cc} \ CXX=${configure.cxx} \ CPP="${configure.cc} -E" # TODO: Add path-style dependency on python, whenever test dependencies # are implemented (#38208). Not critical, since all supported versions # of OS X come with Python 2.6. test.run yes test.target check test.env VERBOSE=1 destroot.args VERBOSE=1 post-destroot { xinstall -d ${destroot}${prefix}/share/${name} xinstall -m 644 ${worksrcpath}/src/etc/ctags.rust \ ${destroot}${prefix}/share/${name} } livecheck.type regex livecheck.url ${homepage}/install.html livecheck.regex {dist/rust-(\d\.\d)}