diff --git a/recipes-devtools/cargo/cargo-1.40.0/0001-Disable-http2.patch b/recipes-devtools/cargo/cargo-1.40.0/0001-Disable-http2.patch new file mode 100644 index 0000000..168d5a9 --- /dev/null +++ b/recipes-devtools/cargo/cargo-1.40.0/0001-Disable-http2.patch @@ -0,0 +1,29 @@ +From f0496287fb754e5b8dd1956f6a0addb55f3b06f5 Mon Sep 17 00:00:00 2001 +From: Johan Anderholm +Date: Sun, 27 Jan 2019 10:19:00 +0100 +Subject: [PATCH] Disable http2 + +http2 requires that curl is build with nghttp2 which in turn depends on +many dependencies and ultimately a dependency loop in the case of +curl-native. As long as multiplexing is disabled in cargo this should +be fine. + +Upstream-Status: Inappropriate + +--- + src/tools/cargo/Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index eea1f42a2..5159890f4 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -25,7 +25,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1" } + crates-io = { path = "crates/crates-io", version = "0.29" } + crossbeam-utils = "0.6" + crypto-hash = "0.3.1" +-curl = { version = "0.4.23", features = ["http2"] } ++curl = { version = "0.4.23" } + curl-sys = "0.4.22" + env_logger = "0.7.0" + pretty_env_logger = { version = "0.3", optional = true } diff --git a/recipes-devtools/cargo/cargo_1.40.0.bb b/recipes-devtools/cargo/cargo_1.40.0.bb new file mode 100644 index 0000000..f048779 --- /dev/null +++ b/recipes-devtools/cargo/cargo_1.40.0.bb @@ -0,0 +1,8 @@ +require recipes-devtools/rust/rust-source-${PV}.inc +require recipes-devtools/rust/rust-snapshot-${PV}.inc +require cargo.inc + +LIC_FILES_CHKSUM += " \ + file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \ + file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \ +" diff --git a/recipes-devtools/rust/libstd-rs_1.40.0.bb b/recipes-devtools/rust/libstd-rs_1.40.0.bb new file mode 100644 index 0000000..69cb48a --- /dev/null +++ b/recipes-devtools/rust/libstd-rs_1.40.0.bb @@ -0,0 +1,8 @@ +require rust-source-${PV}.inc +require libstd-rs.inc + +LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" + +CARGO_FEATURES ?= "panic-unwind backtrace" + +CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" diff --git a/recipes-devtools/rust/rust-cross_1.40.0.bb b/recipes-devtools/rust/rust-cross_1.40.0.bb new file mode 100644 index 0000000..ddc25d3 --- /dev/null +++ b/recipes-devtools/rust/rust-cross_1.40.0.bb @@ -0,0 +1,2 @@ +require rust-cross.inc +require rust-source-${PV}.inc diff --git a/recipes-devtools/rust/rust-llvm_1.40.0.bb b/recipes-devtools/rust/rust-llvm_1.40.0.bb new file mode 100644 index 0000000..ac77a4b --- /dev/null +++ b/recipes-devtools/rust/rust-llvm_1.40.0.bb @@ -0,0 +1,16 @@ +require rust-source-${PV}.inc +require rust-llvm.inc + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe" + +do_install_prepend () { + # the install does a sed on this without installing the file + # we don't need it for anything + mkdir -p "${D}/usr/share/llvm/cmake" + touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake" +} + +do_install_append () { + # we don't need any of this stuff to build Rust + rm -rf "${D}/usr/lib/cmake" +} diff --git a/recipes-devtools/rust/rust-snapshot-1.40.0.inc b/recipes-devtools/rust/rust-snapshot-1.40.0.inc new file mode 100644 index 0000000..22a6dc2 --- /dev/null +++ b/recipes-devtools/rust/rust-snapshot-1.40.0.inc @@ -0,0 +1,24 @@ +## This is information on the rust-snapshot (binary) used to build our current release. +## snapshot info is taken from rust/src/stage0.txt +## TODO: find a way to add additional SRC_URIs based on the contents of an +## earlier SRC_URI. +RS_VERSION = "1.39.0" + +RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" +CARGO_VERSION = "0.40.0" +CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu" + +SRC_URI += " \ + https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \ + " + +# TODO: Add hashes for other architecture toolchains as well. Make a script? +SRC_URI[rustc-snapshot-x86_64.md5sum] = "aa10585498675e44be219d3644c15853" +SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5b2a435a4c034615d70cfc383abe9924cbd1ffd4669caa55ce6539f22ed979ed" +SRC_URI[rust-std-snapshot-x86_64.md5sum] = "d8b8e6f1a5a255d22b9f86c97a65049f" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "b629952ec9e3e750137d7b8a922de145c97c1dc372dd616e86e4e501da13910b" +SRC_URI[cargo-snapshot-x86_64.md5sum] = "a51643b8980bcaefa9043715a8e9a2ba" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "7b9ba52c252964724f49aab49e42bec62fca929297ef058412c7e727b0794620" diff --git a/recipes-devtools/rust/rust-source-1.40.0.inc b/recipes-devtools/rust/rust-source-1.40.0.inc new file mode 100644 index 0000000..efb4075 --- /dev/null +++ b/recipes-devtools/rust/rust-source-1.40.0.inc @@ -0,0 +1,11 @@ +SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" + +SRC_URI[rust.md5sum] = "1725f67a1d92ab843a71fbbefef06db9" +SRC_URI[rust.sha256sum] = "6e2aa3a91697f4b225c6b394cbae6b97666f061dba491f666a5281698fe2aace" + +# later versions of rust change the directory that they unextract to +RUSTSRC = "${WORKDIR}/rustc-${PV}-src" +# set this as our default +S = "${RUSTSRC}" + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" diff --git a/recipes-devtools/rust/rust_1.40.0.bb b/recipes-devtools/rust/rust_1.40.0.bb new file mode 100644 index 0000000..c7f9f4f --- /dev/null +++ b/recipes-devtools/rust/rust_1.40.0.bb @@ -0,0 +1,12 @@ +require rust.inc +require rust-source-${PV}.inc +require rust-snapshot-${PV}.inc + +DEPENDS += "rust-llvm (=${PV})" + +# Otherwise we'll depend on what we provide +INHIBIT_DEFAULT_RUST_DEPS_class-native = "1" +# We don't need to depend on gcc-native because yocto assumes it exists +PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust" + +BBCLASSEXTEND = "native"