Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 1 | |
| 2 | require rust-cross-canadian-common.inc |
| 3 | |
| 4 | RUST_TOOLS_CLIPPY_PN = "rust-tools-clippy-cross-canadian-${TRANSLATED_TARGET_ARCH}" |
| 5 | RUST_TOOLS_RUSTFMT_PN = "rust-tools-rustfmt-cross-canadian-${TRANSLATED_TARGET_ARCH}" |
| 6 | RUST_TOOLS_PKGS = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN}" |
| 7 | PN = "rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH}" |
| 8 | |
| 9 | PACKAGES = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN} ${PN}" |
| 10 | RDEPENDS:${PN} += "${RUST_TOOLS_PKGS}" |
| 11 | |
| 12 | do_compile () { |
| 13 | rust_runx build --stage 2 src/tools/clippy |
| 14 | rust_runx build --stage 2 src/tools/rustfmt |
| 15 | } |
| 16 | |
| 17 | do_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 | |
| 29 | ALLOW_EMPTY:${PN} = "1" |
| 30 | |
| 31 | PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin" |
| 32 | FILES:${RUST_TOOLS_CLIPPY_PN} = "${PKG_SYS_BINDIR}/cargo-clippy ${PKG_SYS_BINDIR}/clippy-driver" |
| 33 | FILES:${RUST_TOOLS_RUSTFMT_PN} = "${PKG_SYS_BINDIR}/rustfmt" |
| 34 | |
| 35 | SUMMARY:${PN} = "Rust helper tools" |
| 36 | SUMMARY:${RUST_TOOLS_CLIPPY_PN} = "A collection of lints to catch common mistakes and improve your Rust code" |
| 37 | SUMMARY:${RUST_TOOLS_RUSTFMT_PN} = "A tool for formatting Rust code according to style guidelines" |
| 38 | |