diff options
Diffstat (limited to 'meta/recipes-devtools/rust/rust_1.64.0.bb')
-rw-r--r-- | meta/recipes-devtools/rust/rust_1.64.0.bb | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/rust_1.64.0.bb b/meta/recipes-devtools/rust/rust_1.64.0.bb new file mode 100644 index 0000000000..1f9dbd3cce --- /dev/null +++ b/meta/recipes-devtools/rust/rust_1.64.0.bb | |||
@@ -0,0 +1,87 @@ | |||
1 | require rust-target.inc | ||
2 | require rust-source.inc | ||
3 | require rust-snapshot.inc | ||
4 | |||
5 | INSANE_SKIP:${PN}:class-native = "already-stripped" | ||
6 | FILES:${PN} += "${libdir}/rustlib" | ||
7 | FILES:${PN} += "${libdir}/*.so" | ||
8 | FILES:${PN}-dev = "" | ||
9 | |||
10 | # Used by crossbeam_atomic.patch | ||
11 | export TARGET_VENDOR | ||
12 | |||
13 | do_compile () { | ||
14 | rust_runx build --stage 2 | ||
15 | } | ||
16 | |||
17 | do_compile:append:class-target () { | ||
18 | rust_runx build --stage 2 src/tools/clippy | ||
19 | rust_runx build --stage 2 src/tools/rustfmt | ||
20 | } | ||
21 | |||
22 | do_compile:append:class-nativesdk () { | ||
23 | rust_runx build --stage 2 src/tools/clippy | ||
24 | rust_runx build --stage 2 src/tools/rustfmt | ||
25 | } | ||
26 | |||
27 | ALLOW_EMPTY:${PN} = "1" | ||
28 | |||
29 | PACKAGES =+ "${PN}-tools-clippy ${PN}-tools-rustfmt" | ||
30 | FILES:${PN}-tools-clippy = "${bindir}/cargo-clippy ${bindir}/clippy-driver" | ||
31 | FILES:${PN}-tools-rustfmt = "${bindir}/rustfmt" | ||
32 | RDEPENDS:${PN}-tools-clippy = "${PN}" | ||
33 | RDEPENDS:${PN}-tools-rustfmt = "${PN}" | ||
34 | |||
35 | SUMMARY:${PN}-tools-clippy = "A collection of lints to catch common mistakes and improve your Rust code" | ||
36 | SUMMARY:${PN}-tools-rustfmt = "A tool for formatting Rust code according to style guidelines" | ||
37 | |||
38 | rust_do_install() { | ||
39 | rust_runx install | ||
40 | } | ||
41 | |||
42 | rust_do_install:class-nativesdk() { | ||
43 | export PSEUDO_UNLOAD=1 | ||
44 | rust_runx install | ||
45 | unset PSEUDO_UNLOAD | ||
46 | |||
47 | install -d ${D}${bindir} | ||
48 | for i in cargo-clippy clippy-driver rustfmt; do | ||
49 | cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} | ||
50 | chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i | ||
51 | done | ||
52 | |||
53 | chown root:root ${D}/ -R | ||
54 | rm ${D}${libdir}/rustlib/uninstall.sh | ||
55 | rm ${D}${libdir}/rustlib/install.log | ||
56 | rm ${D}${libdir}/rustlib/manifest* | ||
57 | } | ||
58 | |||
59 | EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt" | ||
60 | EXTRA_TOOLS:remove:riscv32 = "rustfmt" | ||
61 | rust_do_install:class-target() { | ||
62 | export PSEUDO_UNLOAD=1 | ||
63 | rust_runx install | ||
64 | unset PSEUDO_UNLOAD | ||
65 | |||
66 | install -d ${D}${bindir} | ||
67 | for i in ${EXTRA_TOOLS}; do | ||
68 | cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} | ||
69 | chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i | ||
70 | done | ||
71 | |||
72 | chown root:root ${D}/ -R | ||
73 | rm ${D}${libdir}/rustlib/uninstall.sh | ||
74 | rm ${D}${libdir}/rustlib/install.log | ||
75 | rm ${D}${libdir}/rustlib/manifest* | ||
76 | } | ||
77 | |||
78 | # see recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch | ||
79 | # we need to link with ssp_nonshared on musl to avoid "undefined reference to `__stack_chk_fail_local'" | ||
80 | # when building MACHINE=qemux86 for musl | ||
81 | WRAPPER_TARGET_EXTRALD:libc-musl = "-lssp_nonshared" | ||
82 | |||
83 | RUSTLIB_DEP:class-nativesdk = "" | ||
84 | |||
85 | # musl builds include libunwind.a | ||
86 | INSANE_SKIP:${PN} = "staticdev" | ||
87 | |||