bf6705fb7f
* Convert to new override syntax This is the result of automated script (0.9.0) conversion: oe-core/scripts/contrib/convert-overrides.py . converting the metadata to use ":" as the override character instead of "_". Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> * Manually fix the conversion Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> * layer.conf: Update layer compatibility with only dunfell and newer. Add honister to mark the layers as compatible with honister now that it uses the new override syntax. Drop zeus and older which are missing a support for newer override syntax which was backported only to 1.46 branch (used by dunfell) and newer, e.g.: https://git.openembedded.org/bitbake/commit/?h=1.46&id=c5418eae56cc50dbae7951c055434a0c456c53a4 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> * CI: use YOCTO_BRANCH instead of yocto-${YOCTO_VERSION} for poky checkout * using latest revision in branch is often better than sticking to some point releases Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> * CI: switch to hardknott branch * gatesgarth is already EOL, better to use something supported Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
75 lines
2.2 KiB
PHP
75 lines
2.2 KiB
PHP
SUMMARY = "Cargo, a package manager for Rust cross canadian flavor."
|
|
|
|
RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config"
|
|
|
|
HOST_SYS = "${HOST_ARCH}-unknown-linux-gnu"
|
|
CARGO_RUST_TARGET_CCLD = "${RUST_BUILD_CCLD}"
|
|
|
|
require recipes-devtools/rust/rust-common.inc
|
|
require cargo.inc
|
|
|
|
CARGO = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"
|
|
BASEDEPENDS:remove = "cargo-native"
|
|
|
|
export RUST_TARGET_PATH="${WORKDIR}/targets/"
|
|
|
|
RUSTLIB = " \
|
|
-L ${STAGING_DIR_NATIVE}/${SDKPATHNATIVE}/usr/lib/${TARGET_SYS}/rustlib/${HOST_SYS}/lib \
|
|
"
|
|
|
|
DEPENDS += "rust-native \
|
|
rust-cross-canadian-${TRANSLATED_TARGET_ARCH} \
|
|
virtual/nativesdk-${HOST_PREFIX}compilerlibs \
|
|
nativesdk-openssl nativesdk-zlib \
|
|
virtual/nativesdk-libc \
|
|
"
|
|
|
|
inherit cross-canadian
|
|
|
|
PN = "cargo-cross-canadian-${TRANSLATED_TARGET_ARCH}"
|
|
|
|
LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}"
|
|
|
|
python do_rust_gen_targets () {
|
|
wd = d.getVar('WORKDIR') + '/targets/'
|
|
|
|
rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH'))
|
|
rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH'))
|
|
}
|
|
|
|
do_compile:prepend () {
|
|
PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
|
}
|
|
|
|
do_install () {
|
|
SYS_BINDIR=$(dirname ${D}${bindir})
|
|
install -d "${SYS_BINDIR}"
|
|
install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${SYS_BINDIR}"
|
|
for i in ${SYS_BINDIR}/*; do
|
|
chrpath -r "\$ORIGIN/../lib" ${i}
|
|
done
|
|
|
|
ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
|
|
mkdir "${ENV_SETUP_DIR}"
|
|
ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
|
|
cat <<- EOF > "${ENV_SETUP_SH}"
|
|
export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo"
|
|
mkdir -p "\$CARGO_HOME"
|
|
# Init the default target once, it might be otherwise user modified.
|
|
if [ ! -f "\$CARGO_HOME/config" ]; then
|
|
touch "\$CARGO_HOME/config"
|
|
echo "[build]" >> "\$CARGO_HOME/config"
|
|
echo 'target = "'${TARGET_SYS}'"' >> "\$CARGO_HOME/config"
|
|
fi
|
|
|
|
# Keep the below off as long as HTTP/2 is disabled.
|
|
export CARGO_HTTP_MULTIPLEXING=false
|
|
|
|
export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt"
|
|
EOF
|
|
}
|
|
|
|
PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin"
|
|
FILES:${PN} += "${base_prefix}/environment-setup.d ${PKG_SYS_BINDIR}"
|
|
|