Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/cargo.mk
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
# Location of the cargo output directory. | # Location of the cargo output directory. | ||||
CARGO_TARGET_DIR?= ${WRKDIR}/target | CARGO_TARGET_DIR?= ${WRKDIR}/target | ||||
# Default target platform (affects some RUSTFLAGS if passed) | # Default target platform (affects some RUSTFLAGS if passed) | ||||
CARGO_BUILD_TARGET?= ${_CARGO_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | CARGO_BUILD_TARGET?= ${_CARGO_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} | ||||
_CARGO_RUST_ARCH_amd64= x86_64 | _CARGO_RUST_ARCH_amd64= x86_64 | ||||
_CARGO_RUST_ARCH_i386= i686 | _CARGO_RUST_ARCH_i386= i686 | ||||
_CARGO_RUST_ARCH_riscv64= riscv64gc | |||||
# Environment for cargo | # Environment for cargo | ||||
# - CARGO_HOME: local cache of the registry index | # - CARGO_HOME: local cache of the registry index | ||||
# - CARGO_BUILD_JOBS: configure number of jobs to run | # - CARGO_BUILD_JOBS: configure number of jobs to run | ||||
# - CARGO_TARGET_DIR: location of where to place all generated artifacts | # - CARGO_TARGET_DIR: location of where to place all generated artifacts | ||||
# - RUST_BACKTRACE: produce backtraces when something in the build panics | # - RUST_BACKTRACE: produce backtraces when something in the build panics | ||||
# - RUSTC: path of rustc binary (default to lang/rust) | # - RUSTC: path of rustc binary (default to lang/rust) | ||||
# - RUSTDOC: path of rustdoc binary (default to lang/rust) | # - RUSTDOC: path of rustdoc binary (default to lang/rust) | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | |||||
.endfor | .endfor | ||||
.if ${CARGO_CONFIGURE:tl} == "yes" | .if ${CARGO_CONFIGURE:tl} == "yes" | ||||
_USES_configure+= 250:cargo-configure | _USES_configure+= 250:cargo-configure | ||||
# configure hook. Place a config file for overriding crates-io index | # configure hook. Place a config file for overriding crates-io index | ||||
# by local source directory. | # by local source directory. | ||||
cargo-configure: | cargo-configure: | ||||
.if ${ARCH} != riscv64 | |||||
# 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 | ||||
.endif | |||||
@${ECHO_MSG} "===> Cargo config:" | @${ECHO_MSG} "===> Cargo config:" | ||||
@${MKDIR} ${WRKDIR}/.cargo | @${MKDIR} ${WRKDIR}/.cargo | ||||
@: > ${WRKDIR}/.cargo/config.toml | @: > ${WRKDIR}/.cargo/config.toml | ||||
@${ECHO_CMD} "[source.cargo]" >> ${WRKDIR}/.cargo/config.toml | @${ECHO_CMD} "[source.cargo]" >> ${WRKDIR}/.cargo/config.toml | ||||
@${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config.toml | @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config.toml | ||||
@${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config.toml | @${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config.toml | ||||
@${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config.toml | @${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config.toml | ||||
.if !empty(_CARGO_GIT_SOURCES) | .if !empty(_CARGO_GIT_SOURCES) | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |