diff options
Diffstat (limited to 'meta/recipes-devtools/cargo/cargo-cross-canadian.inc')
-rw-r--r-- | meta/recipes-devtools/cargo/cargo-cross-canadian.inc | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc b/meta/recipes-devtools/cargo/cargo-cross-canadian.inc deleted file mode 100644 index a2fac929d4..0000000000 --- a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | SUMMARY = "Cargo, a package manager for Rust cross canadian flavor." | ||
2 | |||
3 | RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" | ||
4 | |||
5 | HOST_SYS = "${HOST_ARCH}-unknown-linux-gnu" | ||
6 | CARGO_RUST_TARGET_CCLD = "${RUST_BUILD_CCLD}" | ||
7 | |||
8 | inherit rust-target-config | ||
9 | require cargo.inc | ||
10 | |||
11 | CARGO = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo" | ||
12 | BASEDEPENDS:remove = "cargo-native" | ||
13 | |||
14 | export RUST_TARGET_PATH="${WORKDIR}/targets/" | ||
15 | |||
16 | RUSTLIB = " \ | ||
17 | -L ${STAGING_DIR_NATIVE}/${SDKPATHNATIVE}/usr/lib/${TARGET_SYS}/rustlib/${HOST_SYS}/lib \ | ||
18 | " | ||
19 | |||
20 | DEPENDS += "rust-native \ | ||
21 | rust-cross-canadian-${TRANSLATED_TARGET_ARCH} \ | ||
22 | virtual/nativesdk-${HOST_PREFIX}compilerlibs \ | ||
23 | nativesdk-openssl nativesdk-zlib \ | ||
24 | virtual/nativesdk-libc \ | ||
25 | " | ||
26 | |||
27 | inherit cross-canadian | ||
28 | |||
29 | PN = "cargo-cross-canadian-${TRANSLATED_TARGET_ARCH}" | ||
30 | |||
31 | RUST_TARGETGENS = "BUILD HOST" | ||
32 | |||
33 | do_compile:prepend () { | ||
34 | PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
35 | } | ||
36 | |||
37 | create_sdk_wrapper () { | ||
38 | file="$1" | ||
39 | shift | ||
40 | |||
41 | cat <<- EOF > "${file}" | ||
42 | #!/bin/sh | ||
43 | \$$1 \$@ | ||
44 | EOF | ||
45 | |||
46 | chmod +x "$file" | ||
47 | } | ||
48 | |||
49 | do_install () { | ||
50 | SYS_BINDIR=$(dirname ${D}${bindir}) | ||
51 | install -d "${SYS_BINDIR}" | ||
52 | install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${SYS_BINDIR}" | ||
53 | for i in ${SYS_BINDIR}/*; do | ||
54 | chrpath -r "\$ORIGIN/../lib" ${i} | ||
55 | done | ||
56 | |||
57 | # Uses SDK's CC as linker so linked binaries works out of box. | ||
58 | create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld" "CC" | ||
59 | |||
60 | ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d | ||
61 | mkdir "${ENV_SETUP_DIR}" | ||
62 | ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh" | ||
63 | cat <<- EOF > "${ENV_SETUP_SH}" | ||
64 | export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo" | ||
65 | mkdir -p "\$CARGO_HOME" | ||
66 | # Init the default target once, it might be otherwise user modified. | ||
67 | if [ ! -f "\$CARGO_HOME/config" ]; then | ||
68 | touch "\$CARGO_HOME/config" | ||
69 | echo "[build]" >> "\$CARGO_HOME/config" | ||
70 | echo 'target = "'${TARGET_SYS}'"' >> "\$CARGO_HOME/config" | ||
71 | echo '# TARGET_SYS' >> "\$CARGO_HOME/config" | ||
72 | echo '[target.'${TARGET_SYS}']' >> "\$CARGO_HOME/config" | ||
73 | echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" | ||
74 | fi | ||
75 | |||
76 | # Keep the below off as long as HTTP/2 is disabled. | ||
77 | export CARGO_HTTP_MULTIPLEXING=false | ||
78 | |||
79 | export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt" | ||
80 | EOF | ||
81 | } | ||
82 | |||
83 | PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin" | ||
84 | FILES:${PN} += "${base_prefix}/environment-setup.d ${PKG_SYS_BINDIR}" | ||
85 | |||