From b4527016dfba649edcf9af1a35c82c30fd9607d9 Mon Sep 17 00:00:00 2001 From: Johan Anderholm Date: Wed, 21 Jun 2017 09:23:56 -0500 Subject: [PATCH] cargo: build cargo using cargo and not make Instead of using the configure script paired with make, use Cargo to build Cargo. This moves us closer to being compatible with rustbuild. (cherry picked from commit 3e0f03d12a329f0c61f9f2b7a1b838a2d9c34eba) --- recipes-devtools/cargo/cargo.inc | 40 ++------------------------ recipes-devtools/cargo/cargo_0.16.0.bb | 2 -- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index bccb751..0836b31 100644 --- a/recipes-devtools/cargo/cargo.inc +++ b/recipes-devtools/cargo/cargo.inc @@ -12,45 +12,11 @@ SRC_URI = "\ http://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${CARGO_SNAPSHOT} \ " -B = "${S}" - # Used in libgit2-sys's build.rs, needed for pkg-config to be used export LIBGIT2_SYS_USE_PKG_CONFIG = "1" -# cargo's configure doesn't recognize --disable-static, so remove it. -DISABLE_STATIC = "" - -do_configure () { - "${S}/configure" \ - "--prefix=${prefix}" \ - "--build=${BUILD_SYS}" \ - "--host=${HOST_SYS}" \ - "--target=${TARGET_SYS}" \ - "--localstatedir=${localstatedir}" \ - "--sysconfdir=${sysconfdir}" \ - "--datadir=${datadir}" \ - "--infodir=${infodir}" \ - "--mandir=${mandir}" \ - "--libdir=${libdir}" \ - "--disable-verify-install" \ - ${EXTRA_OECONF} \ - || die "Could not configure cargo" - - cargo_do_configure -} - -do_compile () { - oe_cargo_fix_env - - rm -rf target/snapshot - mkdir -p target - cp -R ${WORKDIR}/cargo-nightly-x86_64-unknown-linux-gnu/cargo target/snapshot - - oe_runmake VERBOSE=1 -} - -do_install () { - oe_runmake prepare-image-${TARGET_SYS} IMGDIR_${TARGET_SYS}="${D}${prefix}" -} +# 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-nightly-${RUST_BUILD_SYS}/cargo/bin/cargo" BBCLASSEXTEND = "native" diff --git a/recipes-devtools/cargo/cargo_0.16.0.bb b/recipes-devtools/cargo/cargo_0.16.0.bb index 47d447d..192ac86 100644 --- a/recipes-devtools/cargo/cargo_0.16.0.bb +++ b/recipes-devtools/cargo/cargo_0.16.0.bb @@ -1,8 +1,6 @@ require cargo-snapshot.inc require cargo.inc -EXTRA_OECONF += "--cargo=${WORKDIR}/cargo-nightly-x86_64-unknown-linux-gnu/cargo/bin/cargo" - SRC_URI += " \ git://github.com/rust-lang/cargo.git;protocol=https;name=cargo;branch=rust-1.15.1 \ crate://crates.io/advapi32-sys/0.2.0 \