Changeset View
Changeset View
Standalone View
Standalone View
head/lang/rust/Makefile
# Created by: Jyun-Yan You <jyyou@cs.nctu.edu.tw> | # Created by: Jyun-Yan You <jyyou@cs.nctu.edu.tw> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= rust | PORTNAME= rust | ||||
PORTVERSION?= 1.38.0 | PORTVERSION?= 1.39.0 | ||||
PORTREVISION?= 0 | PORTREVISION?= 0 | ||||
CATEGORIES= lang | CATEGORIES= lang | ||||
MASTER_SITES= https://static.rust-lang.org/dist/:src \ | MASTER_SITES= https://static.rust-lang.org/dist/:src \ | ||||
https://static.rust-lang.org/dist/:rust_bootstrap \ | https://static.rust-lang.org/dist/:rust_bootstrap \ | ||||
LOCAL/tobik/rust:rust_bootstrap \ | LOCAL/tobik/rust:rust_bootstrap \ | ||||
https://static.rust-lang.org/dist/:cargo_bootstrap \ | https://static.rust-lang.org/dist/:cargo_bootstrap \ | ||||
LOCAL/tobik/rust:cargo_bootstrap \ | LOCAL/tobik/rust:cargo_bootstrap \ | ||||
https://releases.llvm.org/${COMPILER_RT_VERSION}/:compiler_rt \ | https://releases.llvm.org/${COMPILER_RT_VERSION}/:compiler_rt \ | ||||
Show All 22 Lines | |||||
ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap compiler | ||||
BUILD_DEPENDS= cmake:devel/cmake \ | BUILD_DEPENDS= cmake:devel/cmake \ | ||||
gmake:devel/gmake | gmake:devel/gmake | ||||
LIB_DEPENDS= libcurl.so:ftp/curl \ | LIB_DEPENDS= libcurl.so:ftp/curl \ | ||||
libgit2.so:devel/libgit2 \ | libgit2.so:devel/libgit2 \ | ||||
libssh2.so:security/libssh2 | libssh2.so:security/libssh2 | ||||
USES= libedit pkgconfig python:build ssl tar:xz | USES= pkgconfig python:build ssl tar:xz | ||||
CONFLICTS_INSTALL?= rust-nightly | CONFLICTS_INSTALL?= rust-nightly | ||||
EXTRA_PATCHES+= ${EXTRA_PATCHES_${ARCH}} | |||||
EXTRA_PATCHES_armv6= ${PATCHDIR}/extra-patch-arm-compiler-rt | |||||
EXTRA_PATCHES_armv7= ${PATCHDIR}/extra-patch-arm-compiler-rt | |||||
PLIST_FILES= lib/rustlib/components \ | PLIST_FILES= lib/rustlib/components \ | ||||
lib/rustlib/rust-installer-version | lib/rustlib/rust-installer-version | ||||
OPTIONS_DEFINE= DOCS GDB SOURCES | OPTIONS_DEFINE= DOCS GDB SOURCES | ||||
GDB_DESC= Install ports gdb (necessary for debugging rust programs) | GDB_DESC= Install ports gdb (necessary for debugging rust programs) | ||||
SOURCES_DESC= Install source files | SOURCES_DESC= Install source files | ||||
DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | DOCS_VARS_OFF= _RUST_BUILD_DOCS=false | ||||
DOCS_VARS= _RUST_BUILD_DOCS=true | DOCS_VARS= _RUST_BUILD_DOCS=true | ||||
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb | ||||
# See WRKSRC/src/stage0.txt for the date and version values. | # See WRKSRC/src/stage0.txt for the date and version values. | ||||
BOOTSTRAPS_DATE?= 2019-08-15 | BOOTSTRAPS_DATE?= 2019-09-26 | ||||
RUST_BOOTSTRAP_VERSION?= 1.37.0 | RUST_BOOTSTRAP_VERSION?= 1.38.0 | ||||
CARGO_BOOTSTRAP_VERSION?= 0.38.0 | CARGO_BOOTSTRAP_VERSION?= 0.39.0 | ||||
COMPILER_RT_VERSION?= 9.0.0 | COMPILER_RT_VERSION?= 9.0.0 | ||||
BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} | BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} | ||||
BOOTSTRAPS_SUFFIX_powerpc64?= -elfv1 | BOOTSTRAPS_SUFFIX_powerpc64?= -elfv1 | ||||
CARGO_VENDOR_DIR?= ${WRKSRC}/vendor | CARGO_VENDOR_DIR?= ${WRKSRC}/vendor | ||||
# Rust's target arch string might be different from *BSD arch strings | # Rust's target arch string might be different from *BSD arch strings | ||||
_RUST_ARCH_amd64= x86_64 | _RUST_ARCH_amd64= x86_64 | ||||
_RUST_ARCH_i386= i686 | _RUST_ARCH_i386= i686 | ||||
_RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | ||||
_LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} | _LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} | ||||
_RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | _RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | ||||
_RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | _RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | ||||
_CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${_RUST_TARGET} | ||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) | |||||
EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} | |||||
.endif | |||||
.if ${ARCH} == powerpc64 | .if ${ARCH} == powerpc64 | ||||
# The bootstrap is hardcoded to use gcc9 | # The bootstrap is hardcoded to use gcc9 | ||||
# but we can build with a newer or older compiler as provided by USE_GCC=yes | # but we can build with a newer or older compiler as provided by USE_GCC=yes | ||||
BUILD_DEPENDS+= gcc9:lang/gcc9 | BUILD_DEPENDS+= gcc9:lang/gcc9 | ||||
USE_GCC= yes | USE_GCC= yes | ||||
.endif | .endif | ||||
.if ${OPSYS} == FreeBSD && ${ARCH} == aarch64 && \ | .if ${ARCH} == aarch64 && ${OSVERSION} < 1200502 | ||||
(${OSVERSION} < 1200502 || \ | |||||
(${OSVERSION} > 1300000 && ${OSVERSION} < 1300006)) | |||||
IGNORE= fails to run due to a bug in rtld, update to 12-STABLE r342847 or 13-CURRENT r342113 | IGNORE= fails to run due to a bug in rtld, update to 12-STABLE r342847 or 13-CURRENT r342113 | ||||
.endif | .endif | ||||
.ifdef QEMU_EMULATING | .ifdef QEMU_EMULATING | ||||
IGNORE= fails to build with qemu-user-static | IGNORE= fails to build with qemu-user-static | ||||
.endif | .endif | ||||
X_PY_ENV= HOME="${WRKDIR}" \ | X_PY_ENV= HOME="${WRKDIR}" \ | ||||
Show All 22 Lines | |||||
# on aarch64 where we provide our own bootstraps), we need to update | # on aarch64 where we provide our own bootstraps), we need to update | ||||
# places where they are recorded. | # places where they are recorded. | ||||
@${REINPLACE_CMD} -e 's,^date:.*,date: ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}},' \ | @${REINPLACE_CMD} -e 's,^date:.*,date: ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}},' \ | ||||
-e 's,^rustc:.*,rustc: ${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}},' \ | -e 's,^rustc:.*,rustc: ${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}},' \ | ||||
-e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}},' \ | -e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}},' \ | ||||
${WRKSRC}/src/stage0.txt | ${WRKSRC}/src/stage0.txt | ||||
@${ECHO_MSG} "Bootstrap date and version after patching:" | @${ECHO_MSG} "Bootstrap date and version after patching:" | ||||
@${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | @${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | ||||
.if ${ARCH} == powerpc64 | |||||
@${REINPLACE_CMD} -e 's,powerpc64-unknown-freebsd,powerpc64-unknown-freebsd${OSREL},' \ | |||||
${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs | |||||
.endif | |||||
# Disable vendor checksums | # Disable vendor checksums | ||||
@${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ | @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ | ||||
${CARGO_VENDOR_DIR}/*/.cargo-checksum.json | ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json | ||||
post-patch-SOURCES-off: | post-patch-SOURCES-off: | ||||
# Mimic tools in config.toml with just src excluded | # Mimic tools in config.toml with just src excluded | ||||
@${REINPLACE_CMD} -e 's/config.tools.*"src".*/false;/' \ | @${REINPLACE_CMD} -e 's/config.tools.*"src".*/false;/' \ | ||||
${WRKSRC}/src/bootstrap/install.rs | ${WRKSRC}/src/bootstrap/install.rs | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |