Use cargo version shipped with rust source

The source of cargo used in a release is shipped with the rust source.
Use this instead of the source from github to make sure cargo and rust
are always kept in sync.

This also makes updating rust version a bit easier.
This commit is contained in:
Johan Anderholm
2019-01-17 15:30:56 +01:00
parent d537c62b4e
commit 9952633163
9 changed files with 38 additions and 519 deletions
+32 -2
View File
@@ -1,13 +1,43 @@
SUMMARY = "Cargo, a package manager for Rust."
HOMEPAGE = "https://crates.io"
LICENSE = "MIT | Apache-2.0"
SECTION = "devel"
DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2"
LIC_FILES_CHKSUM += " \
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
LIC_FILES_CHKSUM = " \
file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
"
S = "${RUSTSRC}/src/tools/cargo"
CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/src/vendor"
inherit cargo
do_cargo_setup_snapshot () {
${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig
}
addtask cargo_setup_snapshot after do_unpack before do_configure
do_cargo_setup_snapshot[dirs] += "${WORKDIR}/${CARGO_SNAPSHOT}"
do_compile_prepend () {
export RUSTC_BOOTSTRAP="1"
}
do_install () {
install -d "${D}${bindir}"
install -m 755 "${RUSTSRC}/src/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
}
# Needed for pkg-config to be used
export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
export LIBSSH2_SYS_USE_PKG_CONFIG = "1"
BBCLASSEXTEND = "native"
# When building cargo-native we don't have a built cargo to use so we must use
# the snapshot to bootstrap the build of cargo
CARGO_class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"