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.43.0 | PORTVERSION?= 1.43.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 \ | ||||
LOCAL/tobik/rust:bootstrap \ | LOCAL/tobik/rust:bootstrap \ | ||||
https://static.rust-lang.org/dist/:bootstrap | https://static.rust-lang.org/dist/:bootstrap | ||||
DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src | ||||
DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ | DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ | ||||
${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ||||
${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ | ||||
${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap | ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap | ||||
DIST_SUBDIR?= rust | DIST_SUBDIR?= rust | ||||
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 | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
.if ${ARCH} == aarch64 && ${OSVERSION} < 1200502 | .if ${ARCH} == aarch64 && ${OSVERSION} < 1200502 | ||||
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 | ||||
post-extract: | |||||
@${MKDIR} ${WRKSRC}/build/cache/${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}} | |||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ | |||||
${WRKSRC}/build/cache/${_RUSTC_BOOTSTRAP}${EXTRACT_SUFX} | |||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ | |||||
${WRKSRC}/build/cache/${_RUST_STD_BOOTSTRAP}${EXTRACT_SUFX} | |||||
${LN} -sf ${DISTDIR}/${DIST_SUBDIR}/${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX} \ | |||||
${WRKSRC}/build/cache/${_CARGO_BOOTSTRAP}${EXTRACT_SUFX} | |||||
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:" | .if defined(NIGHTLY_DATE) | ||||
@${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | @${REINPLACE_CMD} '/^rustfmt:/d' ${WRKSRC}/src/stage0.txt | ||||
# If we override the versions and date of the bootstraps (for instance | .endif | ||||
# on aarch64 where we provide our own bootstraps), we need to update | |||||
# places where they are recorded. | |||||
@${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 '/^rustfmt:/d' \ | |||||
-e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}},' \ | |||||
${WRKSRC}/src/stage0.txt | |||||
@${ECHO_MSG} "Bootstrap date and version after patching:" | |||||
@${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt | |||||
.if ${ARCH} == powerpc64 | .if ${ARCH} == powerpc64 | ||||
# Starting with 13.0 powerpc64 is ELFv2 while 12.0 is ELFv1. Pass the correct LLVM target triple. | # Starting with 13.0 powerpc64 is ELFv2 while 12.0 is ELFv1. Pass the correct LLVM target triple. | ||||
@${REINPLACE_CMD} 's,powerpc64-unknown-freebsd,powerpc64-unknown-freebsd${OSREL},' \ | @${REINPLACE_CMD} 's,powerpc64-unknown-freebsd,powerpc64-unknown-freebsd${OSREL},' \ | ||||
${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs | ${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs | ||||
.endif | .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} 's,config.tools.*"src".*,false;,' \ | @${REINPLACE_CMD} 's,config.tools.*"src".*,false;,' \ | ||||
${WRKSRC}/src/bootstrap/install.rs | ${WRKSRC}/src/bootstrap/install.rs | ||||
do-configure: | do-configure: | ||||
# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 | # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 | ||||
@${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ | @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ | ||||
${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh | ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh | ||||
.for _component in cargo rust-std rustc | |||||
@cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \ | |||||
${SH} install.sh --disable-ldconfig --prefix=${WRKDIR}/bootstrap \ | |||||
--verbose | |||||
.endfor | |||||
@${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml | @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'docs=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'docs=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'target=[${_RUST_TARGETS:@.target.@"${.target.}"@:ts,}]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'target=[${_RUST_TARGETS:@.target.@"${.target.}"@:ts,}]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'cargo="${WRKDIR}/bootstrap/bin/cargo"' >> ${WRKSRC}/config.toml | |||||
@${ECHO_CMD} 'rustc="${WRKDIR}/bootstrap/bin/rustc"' >> ${WRKSRC}/config.toml | |||||
@${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |