Hi, I'm using zeroetier-one recipe as base: https://layers.openembedded.org/layerindex/recipe/210085/ and would like to upgrade to 1.14 release. In the latest release there is subdirectory rustybits which compile some rust code.
I'm not sure how to adjust recipe in order to find a rust cross-compiler etc. I've tried to steal some parts from cargo bbclass but it make things even worse ;). Any ideas how to make it work please? Thanks. Updated recipe: LICENSE = "ZeroTier_BSL_1.1 & MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=11bbae9cacaf61dd7fc10035f6f5c68e \ file://LICENSE.txt;md5=33322cad2f266673d999241243910f44 \ file://attic/historic/anode/LICENSE.txt;md5=d32239bcb673463ab874e80d47fae504 \ file://debian/copyright;md5=f4a6ffbe72aad9cedd587bcb18904813 \ file://ext/http-parser/LICENSE-MIT;md5=20d989143ee48a92dacde4f06bbcb59a \ file://ext/libnatpmp/LICENSE;md5=63b8bf0fd09f4909d823a94c6e6fc06b \ file://ext/miniupnpc/LICENSE;md5=4a95d5317ee6dac993b7598848c72c1e \ " # detected but not included license # file://ext/hiredis-0.14.1/COPYING;md5=d84d659a35c666d23233e54503aaea51 # file://ext/redis-plus-plus-1.1.1/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 FILESEXTRAPATHS:prepend := "${THISDIR}/files/:" BASEDEPENDS:append = " cargo-bin-native rust-bin-cross-aarch64" SRC_URI = "git://github.com/zerotier/ZeroTierOne;protocol=https;branch=dev" SRC_URI:append = " file://0001-systemd-fix-zerotier-hanging-on-shutdown.patch" # Modify these as desired PV = "1.14.0+git${SRCPV}" SRCREV = "91e7ce87f09ac1cfdeaf6ff22c3cedcd93574c86" S = "${WORKDIR}/git" # NOTE: spec file indicates the license may be "ZeroTier BSL 1.1" EXTRA_OEMAKE = " \ DESTDIR=${D} \ ZT_DEBUG=1 \ STRIP=echo \ " do_compile[network] = "1" do_install() { oe_runmake install # install service file install -d ${D}${systemd_unitdir}/system install -c -m 0644 ${S}/debian/zerotier-one.service ${D}${systemd_unitdir}/system } inherit systemd SYSTEMD_SERVICE_${PN} = "zerotier-one.service" # Do not enable by default. zerotier requires manual setup anyway # Before setting up systemctl enable zerotier-one ; systemctl start zerotier-one SYSTEMD_AUTO_ENABLE = "disable" FILES:${PN}:append = " ${systemd_system_unitdir}/*" Try with bbappend: WRAPPER_DIR = "${WORKDIR}/wrappers" inherit rust_bin-common do_compile:prepend() { mkdir -p "${WRAPPER_DIR}" # Yocto provides the C compiler in ${CC} but that includes options beyond # the compiler binary. cargo/rustc expect a single binary, so we put ${CC} # in a wrapper script. echo "#!/bin/sh" >"${WRAPPER_DIR}/cc-wrapper.sh" echo "${CC} \"\$@\"" >>"${WRAPPER_DIR}/cc-wrapper.sh" chmod +x "${WRAPPER_DIR}/cc-wrapper.sh" echo "#!/bin/sh" >"${WRAPPER_DIR}/cxx-wrapper.sh" echo "${CXX} \"\$@\"" >>"${WRAPPER_DIR}/cxx-wrapper.sh" chmod +x "${WRAPPER_DIR}/cxx-wrapper.sh" echo "#!/bin/sh" >"${WRAPPER_DIR}/cc-native-wrapper.sh" echo "${BUILD_CC} \"\$@\"" >>"${WRAPPER_DIR}/cc-native-wrapper.sh" chmod +x "${WRAPPER_DIR}/cc-native-wrapper.sh" echo "#!/bin/sh" >"${WRAPPER_DIR}/cxx-native-wrapper.sh" echo "${BUILD_CXX} \"\$@\"" >>"${WRAPPER_DIR}/cxx-native-wrapper.sh" chmod +x "${WRAPPER_DIR}/cxx-native-wrapper.sh" echo "#!/bin/sh" >"${WRAPPER_DIR}/linker-wrapper.sh" echo "${CC} ${LDFLAGS} \"\$@\"" >>"${WRAPPER_DIR}/linker-wrapper.sh" chmod +x "${WRAPPER_DIR}/linker-wrapper.sh" echo "#!/bin/sh" >"${WRAPPER_DIR}/linker-native-wrapper.sh" echo "${BUILD_CC} ${BUILD_LDFLAGS} \"\$@\"" >>"${WRAPPER_DIR}/linker-native-wrapper.sh" chmod +x "${WRAPPER_DIR}/linker-native-wrapper.sh" export TARGET_CC="${WRAPPER_DIR}/cc-wrapper.sh" export TARGET_CXX="${WRAPPER_DIR}/cxx-wrapper.sh" export CC="${WRAPPER_DIR}/cc-native-wrapper.sh" export CXX="${WRAPPER_DIR}/cxx-native-wrapper.sh" export TARGET_LD="${WRAPPER_DIR}/linker-wrapper.sh" export LD="${WRAPPER_DIR}/linker-native-wrapper.sh" export PKG_CONFIG_ALLOW_CROSS="1" export LDFLAGS="" export RUSTFLAGS="${RUSTFLAGS}" export SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" # This "DO_NOT_USE_THIS" option of cargo is currently the only way to # configure a different linker for host and target builds when RUST_BUILD == # RUST_TARGET. export __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" export CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" export CARGO_UNSTABLE_HOST_CONFIG="true" export CARGO_TARGET_APPLIES_TO_HOST="false" export CARGO_TARGET_${@rust_target(d, 'TARGET').replace('-','_').upper()}_LINKER="${WRAPPER_DIR}/linker-wrapper.sh" export CARGO_HOST_LINKER="${WRAPPER_DIR}/linker-native-wrapper.sh" export CARGO_BUILD_FLAGS="-C rpath" export CARGO_PROFILE_RELEASE_DEBUG="true" # The CC crate defaults to using CFLAGS when compiling everything. We can # give it custom flags for compiling on the host. export HOST_CXXFLAGS="" export HOST_CFLAGS="" bbnote "which rustc:" `which rustc` bbnote "rustc --version" `rustc --version` bbnote "which cargo:" `which cargo` bbnote "cargo --version" `cargo --version` bbnote cargo build ${CARGO_BUILD_FLAGS} } BR, marek -- as simple and primitive as possible ------------------------------------------------- Marek Belisko - OPEN-NANDRA Freelance Developer Ruska Nova Ves 219 | Presov, 08005 Slovak Republic Tel: +421 915 052 184 skype: marekwhite twitter: #opennandra web: http://open-nandra.com
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#63742): https://lists.yoctoproject.org/g/yocto/message/63742 Mute This Topic: https://lists.yoctoproject.org/mt/108109571/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-