From 27c6bdb2ce6188aaf060dbdbefb1a8e19e3d7ed1 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Tue, 26 May 2015 10:32:03 -0400 Subject: [PATCH] rust: add machinery to fetch the snapshot This is based on Steven Walter's proposed change "rust-git.inc: use bitbake to fetch the snapshot". --- recipes/rust/rust.inc | 8 +++++++- recipes/rust/rust_git.bb | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/rust/rust.inc b/recipes/rust/rust.inc index 8b87b45..15f7b83 100644 --- a/recipes/rust/rust.inc +++ b/recipes/rust/rust.inc @@ -22,6 +22,8 @@ LIC_FILES_CHKSUM ="\ ## stage0 (format_args!() change) USE_LOCAL_RUST ??= "0" +SRC_URI += "${@base_conditional('USE_LOCAL_RUST', '1', 'https://static.rust-lang.org/stage0-snapshots/${RUST_SNAPSHOT};unpack=0', '', d)}" + # We generate local targets, and need to be able to locate them export RUST_TARGET_PATH="${WORKDIR}/targets/" @@ -337,6 +339,10 @@ rust_runmake () { } do_compile () { + if [ ${USE_LOCAL_RUST} -ne 1 ]; then + mkdir -p dl + cp -f ${WORKDIR}/${RUST_SNAPSHOT} dl + fi rust_runmake } @@ -380,7 +386,7 @@ USE_LOCAL_RUST_class-native ?= "${@base_conditional('USE_LOCAL_NATIVE_RUST', '0' # Otherwise we'll depend on what we provide INHIBIT_DEFAULT_RUST_DEPS_class-cross = "1" -DEPENDS_class-cross += "${@base_conditional('USE_LOCAL_RUST', '1', 'rust-native', '')}" +DEPENDS_class-cross += "${@base_conditional('USE_LOCAL_RUST', '1', 'rust-native', '', d)}" DEPENDS_class-cross += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" PROVIDES_class-cross = "virtual/${TARGET_PREFIX}rust" PN_class-cross = "rust-cross-${TARGET_ARCH}" diff --git a/recipes/rust/rust_git.bb b/recipes/rust/rust_git.bb index 1c89dc5..c846b42 100644 --- a/recipes/rust/rust_git.bb +++ b/recipes/rust/rust_git.bb @@ -2,6 +2,10 @@ SRCREV = "b0aad7dd4fad8d7e2e2f877a511a637258949597" require rust-git.inc +RUST_SNAPSHOT = "rust-stage0-2015-03-27-5520801-linux-x86_64-ef2154372e97a3cb687897d027fd51c8f2c5f349.tar.bz2" +SRC_URI[md5sum] = "6447489e0009519c845b8e350c220636" +SRC_URI[sha256sum] = "b62eed6bdb3cb356c90d587e9d9ee7fb5aedad917ff872c04e67e20b4c8f1c91" + SRC_URI_append = "\ file://0001-libstd-io-process-Command-fully-quote-and-escape-the.patch \ file://0002-std-io-process-add-Debug-tests.patch \