summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/cargo/cargo-cross-canadian.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/cargo/cargo-cross-canadian.inc')
-rw-r--r--meta/recipes-devtools/cargo/cargo-cross-canadian.inc85
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 @@
1SUMMARY = "Cargo, a package manager for Rust cross canadian flavor."
2
3RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config"
4
5HOST_SYS = "${HOST_ARCH}-unknown-linux-gnu"
6CARGO_RUST_TARGET_CCLD = "${RUST_BUILD_CCLD}"
7
8inherit rust-target-config
9require cargo.inc
10
11CARGO = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"
12BASEDEPENDS:remove = "cargo-native"
13
14export RUST_TARGET_PATH="${WORKDIR}/targets/"
15
16RUSTLIB = " \
17 -L ${STAGING_DIR_NATIVE}/${SDKPATHNATIVE}/usr/lib/${TARGET_SYS}/rustlib/${HOST_SYS}/lib \
18"
19
20DEPENDS += "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
27inherit cross-canadian
28
29PN = "cargo-cross-canadian-${TRANSLATED_TARGET_ARCH}"
30
31RUST_TARGETGENS = "BUILD HOST"
32
33do_compile:prepend () {
34 PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
35}
36
37create_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
49do_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
83PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin"
84FILES:${PN} += "${base_prefix}/environment-setup.d ${PKG_SYS_BINDIR}"
85