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.37.0 | PORTVERSION?= 1.38.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://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/:compiler_rt | https://releases.llvm.org/${COMPILER_RT_VERSION}/:compiler_rt \ | ||||
https://github.com/llvm/llvm-project/releases/download/llvmorg-${COMPILER_RT_VERSION}/:compiler_rt | |||||
DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | ||||
DISTFILES?= ${NIGHTLY_SUBDIR}${DISTNAME}${EXTRACT_SUFX}:src \ | DISTFILES?= ${NIGHTLY_SUBDIR}${DISTNAME}${EXTRACT_SUFX}:src \ | ||||
${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:rust_bootstrap \ | ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:rust_bootstrap \ | ||||
${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:rust_bootstrap \ | ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:rust_bootstrap \ | ||||
${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:cargo_bootstrap \ | ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz:cargo_bootstrap \ | ||||
${DISTFILES_${ARCH}} | ${DISTFILES_${ARCH}} | ||||
DISTFILES_armv6= compiler-rt-8.0.1.src.tar.xz:compiler_rt | DISTFILES_armv6= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt | ||||
DISTFILES_armv7= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt | |||||
DIST_SUBDIR?= rust | DIST_SUBDIR?= rust | ||||
EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//} | EXTRACT_ONLY?= ${DISTFILES:N*\:*bootstrap:C/:.*//} | ||||
MAINTAINER= rust@FreeBSD.org | MAINTAINER= rust@FreeBSD.org | ||||
COMMENT= Language with a focus on memory safety and concurrency | COMMENT= Language with a focus on memory safety and concurrency | ||||
LICENSE= APACHE20 MIT | LICENSE= APACHE20 MIT | ||||
LICENSE_COMB= dual | LICENSE_COMB= dual | ||||
LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE | LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE | ||||
LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT | ||||
IGNORE_FreeBSD_11_powerpc64= is missing a bootstrap for FreeBSD 11.x powerpc64 | |||||
ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 | ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 | ||||
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:2.7,build ssl tar:xz | USES= libedit 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-07-04 | BOOTSTRAPS_DATE?= 2019-08-15 | ||||
RUST_BOOTSTRAP_VERSION?= 1.36.0 | RUST_BOOTSTRAP_VERSION?= 1.37.0 | ||||
CARGO_BOOTSTRAP_VERSION?= 0.37.0 | CARGO_BOOTSTRAP_VERSION?= 0.38.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 ${ARCH} == powerpc64 | .if ${ARCH} == powerpc64 | ||||
# The bootstrap is hardcoded to use gcc8 | # 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+= gcc8:lang/gcc8 | BUILD_DEPENDS+= gcc9:lang/gcc9 | ||||
USE_GCC= yes | USE_GCC= yes | ||||
.endif | .endif | ||||
.if ${OPSYS} == FreeBSD && ${ARCH} == aarch64 && \ | .if ${OPSYS} == FreeBSD && ${ARCH} == aarch64 && \ | ||||
(${OSVERSION} < 1200502 || \ | (${OSVERSION} < 1200502 || \ | ||||
(${OSVERSION} > 1300000 && ${OSVERSION} < 1300006)) | (${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 | ||||
Show All 11 Lines | |||||
post-extract: | post-extract: | ||||
@${MKDIR} ${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}} | @${MKDIR} ${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}} | ||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ||||
${WRKSRC}/build/cache/${_RUSTC_BOOTSTRAP}.tar.gz | ${WRKSRC}/build/cache/${_RUSTC_BOOTSTRAP}.tar.gz | ||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ||||
${WRKSRC}/build/cache/${_RUST_STD_BOOTSTRAP}.tar.gz | ${WRKSRC}/build/cache/${_RUST_STD_BOOTSTRAP}.tar.gz | ||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}.tar.gz \ | ||||
${WRKSRC}/build/cache/${_CARGO_BOOTSTRAP}.tar.gz | ${WRKSRC}/build/cache/${_CARGO_BOOTSTRAP}.tar.gz | ||||
.if ${ARCH} == armv6 | .if ${ARCH} == armv6 || ${ARCH} == armv7 | ||||
${LN} -sf ${WRKDIR}/compiler-rt-8.0.1.src ${WRKSRC}/src/llvm-project/compiler-rt | ${LN} -sf ${WRKDIR}/compiler-rt-${COMPILER_RT_VERSION}.src ${WRKSRC}/src/llvm-project/compiler-rt | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb | @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb | ||||
@${ECHO_MSG} "Canonical bootstrap date and version before patching:" | @${ECHO_MSG} "Canonical bootstrap date and version before patching:" | ||||
@${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | @${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | ||||
# If we override the versions and date of the bootstraps (for instance | # If we override the versions and date of the bootstraps (for instance | ||||
# on aarch64 where we provide our own bootstraps), we need to update | # on aarch64 where we provide our own bootstraps), we need to update | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | ${SETENV} ${X_PY_ENV} \ | ||||
ALLOW_NONZERO_RLIMIT_CORE=1 \ | ALLOW_NONZERO_RLIMIT_CORE=1 \ | ||||
${X_PY_CMD} test \ | ${X_PY_CMD} test \ | ||||
--verbose \ | --verbose \ | ||||
--config ./config.toml \ | --config ./config.toml \ | ||||
--jobs ${MAKE_JOBS_NUMBER} | --jobs ${MAKE_JOBS_NUMBER} | ||||
.if !defined(_RUST_MAKESUM_GUARD) | .if !defined(_RUST_MAKESUM_GUARD) | ||||
makesum: | makesum: | ||||
${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} | ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp | ||||
.for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} | .for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} | ||||
${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} | ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} | ||||
${GREP} ${_RUST_ARCH_${arch}:U${arch}} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE} | ${GREP} ${_RUST_ARCH_${arch}:U${arch}} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp | ||||
.for file in ${DISTFILES_${arch}} | .for file in ${DISTFILES_${arch}} | ||||
${GREP} ${file:S,:, ,:[1]} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE} | ${GREP} ${file:S,:, ,:[1]} ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp | ||||
.endfor | .endfor | ||||
${RM} ${DISTINFO_FILE}.${arch} | ${RM} ${DISTINFO_FILE}.${arch} | ||||
.endfor | .endfor | ||||
${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=powerpc64 BOOTSTRAPS_SUFFIX="-elfv2" DISTINFO_FILE=${DISTINFO_FILE}.powerpc64-elfv2 | ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=powerpc64 BOOTSTRAPS_SUFFIX="-elfv2" DISTINFO_FILE=${DISTINFO_FILE}.powerpc64-elfv2 | ||||
${GREP} ${_RUST_ARCH_powerpc64:Upowerpc64} ${DISTINFO_FILE}.powerpc64-elfv2 >> ${DISTINFO_FILE} | ${GREP} ${_RUST_ARCH_powerpc64:Upowerpc64} ${DISTINFO_FILE}.powerpc64-elfv2 >> ${DISTINFO_FILE}.tmp | ||||
${RM} ${DISTINFO_FILE}.powerpc64-elfv2 | ${RM} ${DISTINFO_FILE}.powerpc64-elfv2 | ||||
${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} | |||||
${RM} ${DISTINFO_FILE}.tmp | |||||
.endif | .endif | ||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |