Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/cargo.mk
Show All 24 Lines | |||||
# Name of the local directory for vendoring crates. | # Name of the local directory for vendoring crates. | ||||
CARGO_VENDOR_DIR?= ${WRKSRC}/cargo-crates | CARGO_VENDOR_DIR?= ${WRKSRC}/cargo-crates | ||||
# Default path for cargo manifest. | # Default path for cargo manifest. | ||||
CARGO_CARGOTOML?= ${WRKSRC}/Cargo.toml | CARGO_CARGOTOML?= ${WRKSRC}/Cargo.toml | ||||
CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock | CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock | ||||
# Define MASTER_SITES_CRATESIO for crates.io | |||||
MASTER_SITES_CRATESIO= https://crates.io/api/v1/crates | |||||
# Save crates inside ${DISTDIR}/rust/crates by default. | # Save crates inside ${DISTDIR}/rust/crates by default. | ||||
CARGO_DIST_SUBDIR?= rust/crates | CARGO_DIST_SUBDIR?= rust/crates | ||||
# Generate list of DISTFILES. | # Generate list of DISTFILES. | ||||
.for _crate in ${CARGO_CRATES} | .for _crate in ${CARGO_CRATES} | ||||
MASTER_SITES+= ${MASTER_SITES_CRATESIO}/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}/download?dummy=/:cargo_${_crate:S/-//g:S/.//g} | MASTER_SITES+= CRATESIO/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}:cargo_${_crate:S/-//g:S/.//g} | ||||
DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:S/-//g:S/.//g} | DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:S/-//g:S/.//g} | ||||
.endfor | .endfor | ||||
# Build dependencies. | # Build dependencies. | ||||
CARGO_BUILDDEP?= yes | CARGO_BUILDDEP?= yes | ||||
.if ${CARGO_BUILDDEP:tl} == "yes" | .if ${CARGO_BUILDDEP:tl} == "yes" | ||||
BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.32.0:lang/${RUST_DEFAULT} | BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.32.0:lang/${RUST_DEFAULT} | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |