Changeset View
Changeset View
Standalone View
Standalone View
lang/rust-bootstrap/Makefile
Show All 21 Lines | |||||
ONLY_FOR_ARCHS_REASON= untested on other architectures | ONLY_FOR_ARCHS_REASON= untested on other architectures | ||||
BUILD_DEPENDS= ${FLAVOR:S/_/-/g}-freebsd-sysroot>=a2021.09.14:devel/freebsd-sysroot@${FLAVOR} \ | BUILD_DEPENDS= ${FLAVOR:S/_/-/g}-freebsd-sysroot>=a2021.09.14:devel/freebsd-sysroot@${FLAVOR} \ | ||||
cmake:devel/cmake \ | cmake:devel/cmake \ | ||||
gmake:devel/gmake \ | gmake:devel/gmake \ | ||||
rust>=${PORTVERSION}:lang/rust | rust>=${PORTVERSION}:lang/rust | ||||
FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \ | FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \ | ||||
powerpc64le powerpc | powerpc64le powerpc riscv64 | ||||
FLAVOR?= ${FLAVORS:[1]} | FLAVOR?= ${FLAVORS:[1]} | ||||
USES= cpe ninja:build perl5 python:3.6+,build tar:xz | USES= cpe ninja:build perl5 python:3.6+,build tar:xz | ||||
CPE_VENDOR= ${PORTNAME}-lang | CPE_VENDOR= ${PORTNAME}-lang | ||||
.if ${FLAVOR} == powerpc64_elfv1 | .if ${FLAVOR} == powerpc64_elfv1 | ||||
USE_GCC= 9:build | USE_GCC= 9:build | ||||
.endif | .endif | ||||
# for openssl-src crate | # for openssl-src crate | ||||
USE_PERL5= build | USE_PERL5= build | ||||
PATCHDIR= ${.CURDIR}/../rust/files | PATCHDIR= ${.CURDIR}/../rust/files | ||||
# rustc stashes intermediary files in TMPDIR (default /tmp) which | # rustc stashes intermediary files in TMPDIR (default /tmp) which | ||||
# might cause issues for users that for some reason space limit | # might cause issues for users that for some reason space limit | ||||
# their /tmp. WRKDIR should have plenty of space. | # their /tmp. WRKDIR should have plenty of space. | ||||
# ?= to allow users to still overwrite it in make.conf. | # ?= to allow users to still overwrite it in make.conf. | ||||
TMPDIR?= ${WRKDIR} | TMPDIR?= ${WRKDIR} | ||||
# Resulting packages are not specific to amd64 | # Resulting packages are not specific to amd64 | ||||
NO_ARCH= yes | NO_ARCH= yes | ||||
_CARGO_VENDOR_DIR= ${WRKSRC}/vendor | _CARGO_VENDOR_DIR= ${WRKSRC}/vendor | ||||
_RUST_ARCH_amd64= x86_64 | _RUST_ARCH_amd64= x86_64 | ||||
_RUST_ARCH_i386= i686 | _RUST_ARCH_i386= i686 | ||||
_RUST_ARCH_powerpc64_elfv1= powerpc64 | _RUST_ARCH_powerpc64_elfv1= powerpc64 | ||||
_RUST_ARCH_powerpc64_elfv2= powerpc64 | _RUST_ARCH_powerpc64_elfv2= powerpc64 | ||||
_RUST_ARCH_riscv64= riscv64gc | |||||
_RUST_HOST= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | _RUST_HOST= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | ||||
_RUST_TARGET= ${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl} | _RUST_TARGET= ${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl} | ||||
_RUST_LLVM_TARGET= ${_RUST_LLVM_TARGET_${FLAVOR}} | _RUST_LLVM_TARGET= ${_RUST_LLVM_TARGET_${FLAVOR}} | ||||
_RUST_LLVM_TARGET_aarch64= AArch64 | _RUST_LLVM_TARGET_aarch64= AArch64 | ||||
_RUST_LLVM_TARGET_amd64= X86 | _RUST_LLVM_TARGET_amd64= X86 | ||||
_RUST_LLVM_TARGET_armv6= ARM | _RUST_LLVM_TARGET_armv6= ARM | ||||
_RUST_LLVM_TARGET_armv7= ARM | _RUST_LLVM_TARGET_armv7= ARM | ||||
_RUST_LLVM_TARGET_i386= X86 | _RUST_LLVM_TARGET_i386= X86 | ||||
_RUST_LLVM_TARGET_powerpc64_elfv1= PowerPC | _RUST_LLVM_TARGET_powerpc64_elfv1= PowerPC | ||||
_RUST_LLVM_TARGET_powerpc64_elfv2= PowerPC | _RUST_LLVM_TARGET_powerpc64_elfv2= PowerPC | ||||
_RUST_LLVM_TARGET_powerpc64le= PowerPC | _RUST_LLVM_TARGET_powerpc64le= PowerPC | ||||
_RUST_LLVM_TARGET_powerpc= PowerPC | _RUST_LLVM_TARGET_powerpc= PowerPC | ||||
_RUST_LLVM_TARGET_riscv64= RISCV | |||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
.if ${OPSYS} != FreeBSD | .if ${OPSYS} != FreeBSD | ||||
IGNORE= is only for FreeBSD | IGNORE= is only for FreeBSD | ||||
.endif | .endif | ||||
.if ${FLAVOR} == powerpc64le && ${OSVERSION} < 1300116 | .if (${FLAVOR} == powerpc64le || ${FLAVOR} == riscv64) && ${OSVERSION} < 1300116 | ||||
IGNORE= will not build on 12.x due to old system | IGNORE= will not build on 12.x due to old system | ||||
.endif | .endif | ||||
.if exists(${PATCHDIR}/${FLAVOR:S/_/-/}) | .if exists(${PATCHDIR}/${FLAVOR:S/_/-/}) | ||||
EXTRA_PATCHES+= ${PATCHDIR}/${FLAVOR:S/_/-/} | EXTRA_PATCHES+= ${PATCHDIR}/${FLAVOR:S/_/-/} | ||||
.endif | .endif | ||||
post-patch: | post-patch: | ||||
Show All 25 Lines | # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 | ||||
@${ECHO_CMD} 'rustc="${LOCALBASE}/bin/rustc"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'rustc="${LOCALBASE}/bin/rustc"' >> ${WRKSRC}/config.toml | ||||
.if ${_RUST_HOST} != ${_RUST_TARGET} | .if ${_RUST_HOST} != ${_RUST_TARGET} | ||||
@${ECHO_CMD} 'host=["${_RUST_HOST}","${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'host=["${_RUST_HOST}","${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'target=["${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'target=["${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml | ||||
.endif | .endif | ||||
@${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml | ||||
.if ${FLAVOR} == riscv64 | |||||
@${ECHO_CMD} 'debug=true' >> ${WRKSRC}/config.toml | |||||
.endif | |||||
@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml | @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml | ||||
@${ECHO_CMD} 'link-shared=false' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'link-shared=false' >> ${WRKSRC}/config.toml | ||||
.if ${FLAVOR} == powerpc64_elfv1 | .if ${FLAVOR} == powerpc64_elfv1 | ||||
@${ECHO_CMD} 'static-libstdcpp=true' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'static-libstdcpp=true' >> ${WRKSRC}/config.toml | ||||
.endif | .endif | ||||
.if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) | .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) | ||||
@${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml | @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |