diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2022-12-28 15:23:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-28 23:59:56 +0000 |
commit | a5a8904f8c8d81059ba79fd84d3a808462c86065 (patch) | |
tree | 125676addb7c448fc33d4d99c906f04fab956dd9 /meta/recipes-devtools/rust | |
parent | f504a2a21c38c6386e57680a8543deea99928031 (diff) | |
download | poky-a5a8904f8c8d81059ba79fd84d3a808462c86065.tar.gz |
cargo: Include crossbeam-utils patch
We need patched crossbeam-utils in cargo as well as rust, move cargo
alongside rust so they can both use the same patch.
(From OE-Core rev: 39402790724014a39b265ee1978396a0514fdc98)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r-- | meta/recipes-devtools/rust/cargo_1.66.0.bb | 79 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/files/crossbeam_atomic.patch (renamed from meta/recipes-devtools/rust/rust/crossbeam_atomic.patch) | 0 |
2 files changed, 79 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/cargo_1.66.0.bb b/meta/recipes-devtools/rust/cargo_1.66.0.bb new file mode 100644 index 0000000000..f00c67bef5 --- /dev/null +++ b/meta/recipes-devtools/rust/cargo_1.66.0.bb | |||
@@ -0,0 +1,79 @@ | |||
1 | SUMMARY ?= "Cargo, a package manager for Rust." | ||
2 | HOMEPAGE = "https://crates.io" | ||
3 | LICENSE = "MIT | Apache-2.0" | ||
4 | SECTION = "devel" | ||
5 | |||
6 | DEPENDS = "openssl zlib curl ca-certificates libssh2" | ||
7 | |||
8 | LIC_FILES_CHKSUM = " \ | ||
9 | file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \ | ||
10 | file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \ | ||
11 | file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \ | ||
12 | " | ||
13 | |||
14 | require rust-source.inc | ||
15 | require rust-snapshot.inc | ||
16 | |||
17 | SRC_URI:append:class-target = " file://crossbeam_atomic.patch;patchdir=${RUSTSRC}" | ||
18 | |||
19 | # Used by crossbeam_atomic.patch | ||
20 | export TARGET_VENDOR | ||
21 | |||
22 | S = "${RUSTSRC}/src/tools/cargo" | ||
23 | CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" | ||
24 | EXCLUDE_FROM_WORLD = "1" | ||
25 | |||
26 | inherit cargo pkgconfig | ||
27 | |||
28 | DEBUG_PREFIX_MAP += "-fdebug-prefix-map=${RUSTSRC}/vendor=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" | ||
29 | |||
30 | do_cargo_setup_snapshot () { | ||
31 | ${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig | ||
32 | # Need to use uninative's loader if enabled/present since the library paths | ||
33 | # are used internally by rust and result in symbol mismatches if we don't | ||
34 | if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then | ||
35 | patchelf-uninative ${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo --set-interpreter ${UNINATIVE_LOADER} | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | addtask cargo_setup_snapshot after do_unpack before do_configure | ||
40 | do_cargo_setup_snapshot[dirs] += "${WORKDIR}/${CARGO_SNAPSHOT}" | ||
41 | do_cargo_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" | ||
42 | |||
43 | |||
44 | do_compile:prepend () { | ||
45 | export RUSTC_BOOTSTRAP="1" | ||
46 | } | ||
47 | |||
48 | do_install () { | ||
49 | install -d "${D}${bindir}" | ||
50 | install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}" | ||
51 | } | ||
52 | |||
53 | do_install:append:class-nativesdk() { | ||
54 | # To quote the cargo docs, "Cargo also sets the dynamic library path when compiling | ||
55 | # and running binaries with commands like `cargo run` and `cargo test`". Sadly it | ||
56 | # sets to libdir but not base_libdir leading to symbol mismatches depending on the | ||
57 | # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this. | ||
58 | create_wrapper ${D}/${bindir}/cargo LD_LIBRARY_PATH=${libdir}:${base_libdir} | ||
59 | } | ||
60 | |||
61 | # Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1) | ||
62 | # as shipped by Yocto Dunfell. | ||
63 | # According to https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there are no compatibility guarantees between | ||
64 | # libgit2-sys and arbitrary system libgit2 versions, so better keep this turned off. | ||
65 | #export LIBGIT2_SYS_USE_PKG_CONFIG = "1" | ||
66 | |||
67 | # Needed for pkg-config to be used | ||
68 | export LIBSSH2_SYS_USE_PKG_CONFIG = "1" | ||
69 | |||
70 | # When building cargo-native we don't have cargo-native to use and depend on, | ||
71 | # so we must use the locally set up snapshot to bootstrap the build. | ||
72 | BASEDEPENDS:remove:class-native = "cargo-native" | ||
73 | CARGO:class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo" | ||
74 | |||
75 | DEPENDS:append:class-nativesdk = " nativesdk-rust" | ||
76 | RUSTLIB:append:class-nativesdk = " -L ${STAGING_DIR_HOST}/${SDKPATHNATIVE}/usr/lib/rustlib/${RUST_HOST_SYS}/lib" | ||
77 | RUSTLIB_DEP:class-nativesdk = "" | ||
78 | |||
79 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/rust/rust/crossbeam_atomic.patch b/meta/recipes-devtools/rust/files/crossbeam_atomic.patch index b24ac439c6..b24ac439c6 100644 --- a/meta/recipes-devtools/rust/rust/crossbeam_atomic.patch +++ b/meta/recipes-devtools/rust/files/crossbeam_atomic.patch | |||