Skip to content

Commit 7ac87ec

Browse files
authored
Merge pull request #136 from Exein-io/classes_rename
Classes rename
2 parents 829ea2d + f1037f3 commit 7ac87ec

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

README.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,25 @@ SUMMARY = "GPIO Utilities"
3232
HOMEPAGE = "git://github.com/rust-embedded/gpio-utils"
3333
LICENSE = "MIT"
3434
35-
inherit cargo
35+
inherit cargo_bin
36+
37+
# Enable network for the compile task allowing cargo to download dependencies
38+
do_compile[network] = "1"
3639
3740
SRC_URI = "git://github.com/rust-embedded/gpio-utils.git;protocol=https;branch=master"
3841
SRCREV="02b0658cd7e13e46f6b1a5de3fd9655711749759"
3942
S = "${WORKDIR}/git"
4043
LIC_FILES_CHKSUM = "file://LICENSE-MIT;md5=935a9b2a57ae70704d8125b9c0e39059"
4144
```
4245

43-
As you can see, there is almost no overhead introduced from the `cargo` class
44-
beyond simply inheriting it. The `cargo` class adds the appropriate Rust
46+
As you can see, there is almost no overhead introduced from the `cargo_bin` class
47+
beyond simply inheriting it. The `cargo_bin` class adds the appropriate Rust
4548
dependencies as well as default compile and install steps.
4649

50+
> **Warning**
51+
> In previous versions of `meta-rust-bin` the class `cargo` was used instead
52+
> of `cargo_bin`. Follow this [guide](#updating-from-an-old-meta-rust-bin) if you
53+
> are updating your `meta-rust-bin` layer from an old version.
4754
4855
## Features
4956

@@ -79,12 +86,15 @@ downloads dependencies, so add the following line to the recipe:
7986
do_compile[network] = "1"
8087
```
8188

82-
### Use with Yocto Release 3.4 (honister) and Above
89+
### Updating from an old `meta-rust-bin`
90+
91+
To avoid conflicts with the offical Rust layer of Yocto, the class `cargo` of
92+
`meta-rust-bin` was renamed to `cargo_bin`.
93+
94+
If you are updating `meta-rust-bin` from an old version please make sure to
95+
update the inherited class of your recipe to `cargo_bin`.
8396

84-
Rust is included directly in `openmbedded-core` as of Yocto version 3.4. The
85-
included recipe builds Rust components from the sources. To use binaries from
86-
the `meta-rust-bin` layer instead, set `BBMASK` to exclude the package in your
87-
configuration:
97+
After the update it's safe to remove the previously used `BBMASK`:
8898

8999
```bitbake
90100
BBMASK = "poky/meta/recipes-devtools/rust"

classes/cargo.bbclass renamed to classes/cargo_bin.bbclass

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
inherit rust-common
1+
inherit rust_bin-common
22

33
# Many crates rely on pkg-config to find native versions of their libraries for
44
# linking - do the simple thing and make it generally available.
@@ -75,7 +75,7 @@ create_cargo_config() {
7575
echo "debug = true" >> ${CARGO_HOME}/config
7676
}
7777

78-
cargo_do_configure() {
78+
cargo_bin_do_configure() {
7979
mkdir -p "${B}"
8080
mkdir -p "${CARGO_HOME}"
8181
mkdir -p "${WRAPPER_DIR}"
@@ -111,7 +111,7 @@ cargo_do_configure() {
111111
create_cargo_config
112112
}
113113

114-
cargo_do_compile() {
114+
cargo_bin_do_compile() {
115115
export TARGET_CC="${WRAPPER_DIR}/cc-wrapper.sh"
116116
export TARGET_CXX="${WRAPPER_DIR}/cxx-wrapper.sh"
117117
export CC="${WRAPPER_DIR}/cc-native-wrapper.sh"
@@ -130,7 +130,7 @@ cargo_do_compile() {
130130
cargo build ${CARGO_BUILD_FLAGS}
131131
}
132132

133-
cargo_do_install() {
133+
cargo_bin_do_install() {
134134
if [ "${CARGO_BUILD_TYPE}" = "--release" ]; then
135135
local cargo_bindir="${CARGO_RELEASE_DIR}"
136136
else
File renamed without changes.

conf/layer.conf

+1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ LAYERSERIES_COMPAT_rust-bin-layer = " \
1616
hardknott \
1717
honister \
1818
kirkstone \
19+
langdale \
1920
"

recipes-devtools/rust/cargo-bin-cross.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LICENSE = "Apache-2.0 | MIT"
44
SECTION = "devel"
55

66
inherit cross
7-
inherit rust-common
7+
inherit rust_bin-common
88

99
PN = "cargo-bin-cross-${TARGET_ARCH}"
1010

recipes-devtools/rust/rust-bin-cross.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LICENSE = "Apache-2.0 | MIT"
44
SECTION = "devel"
55

66
inherit cross
7-
inherit rust-common
7+
inherit rust_bin-common
88

99
# Required to link binaries
1010
DEPENDS += "gcc-cross-${TARGET_ARCH}"

0 commit comments

Comments
 (0)