blob: f0358551ae2f61baff77132b3cc35052e59eee96 [file] [log] [blame]
Andrew Geisslerd159c7f2021-09-02 21:05:58 -05001
2require rust-cross-canadian-common.inc
3
4RUST_TOOLS_CLIPPY_PN = "rust-tools-clippy-cross-canadian-${TRANSLATED_TARGET_ARCH}"
5RUST_TOOLS_RUSTFMT_PN = "rust-tools-rustfmt-cross-canadian-${TRANSLATED_TARGET_ARCH}"
6RUST_TOOLS_PKGS = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN}"
7PN = "rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH}"
8
9PACKAGES = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN} ${PN}"
10RDEPENDS:${PN} += "${RUST_TOOLS_PKGS}"
11
12do_compile () {
13 rust_runx build --stage 2 src/tools/clippy
14 rust_runx build --stage 2 src/tools/rustfmt
15}
16
17do_install () {
18 SYS_BINDIR=$(dirname ${D}${bindir})
19
20 install -d "${SYS_BINDIR}"
21 cp build/${SNAPSHOT_BUILD_SYS}/stage2-tools-bin/* ${SYS_BINDIR}
22 for i in ${SYS_BINDIR}/*; do
23 chrpath -r "\$ORIGIN/../lib" ${i}
24 done
25
26 chown -R root.root ${D}
27}
28
29ALLOW_EMPTY:${PN} = "1"
30
31PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin"
32FILES:${RUST_TOOLS_CLIPPY_PN} = "${PKG_SYS_BINDIR}/cargo-clippy ${PKG_SYS_BINDIR}/clippy-driver"
33FILES:${RUST_TOOLS_RUSTFMT_PN} = "${PKG_SYS_BINDIR}/rustfmt"
34
35SUMMARY:${PN} = "Rust helper tools"
36SUMMARY:${RUST_TOOLS_CLIPPY_PN} = "A collection of lints to catch common mistakes and improve your Rust code"
37SUMMARY:${RUST_TOOLS_RUSTFMT_PN} = "A tool for formatting Rust code according to style guidelines"
38