diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2023-12-29 11:44:28 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-30 11:03:08 +0000 |
commit | 781bd05a4bc4ca0f8015f103ec33eb7474ccf647 (patch) | |
tree | 39351abdf2f32cf9ed52ac4c260d5e3dab678110 /meta-selftest | |
parent | 6bc41cf96f6b6fed559b686ca600e6b0db09444b (diff) | |
download | poky-781bd05a4bc4ca0f8015f103ec33eb7474ccf647.tar.gz |
meta-selftest: hello-rs: Simple rust test recipe
(From OE-Core rev: 885e8e1fbfce79170ff7544dec5406d724da2560)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
3 files changed, 54 insertions, 0 deletions
diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc new file mode 100644 index 0000000000..9646482b28 --- /dev/null +++ b/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc | |||
@@ -0,0 +1,8 @@ | |||
1 | # Autogenerated with 'bitbake -c update_crates hello-rs' | ||
2 | |||
3 | # from Cargo.lock | ||
4 | SRC_URI += " \ | ||
5 | crate://crates.io/figlet-rs/0.1.5 \ | ||
6 | " | ||
7 | |||
8 | SRC_URI[figlet-rs-0.1.5.sha256sum] = "4742a071cd9694fc86f9fa1a08fa3e53d40cc899d7ee532295da2d085639fbc5" | ||
diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch new file mode 100644 index 0000000000..7569ccef7b --- /dev/null +++ b/meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From 3aea1ece0ca6ac0bf0ffe42736827af22966f767 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alex Kiernan <alexk@zuma.ai> | ||
3 | Date: Wed, 27 Dec 2023 09:55:48 +0000 | ||
4 | Subject: [PATCH] Greet "OE-Core" | ||
5 | |||
6 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> | ||
7 | Upstream-Status: Inappropriate | ||
8 | --- | ||
9 | src/main.rs | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/src/main.rs b/src/main.rs | ||
13 | index f4a310758b19..224eca65c38d 100644 | ||
14 | --- a/src/main.rs | ||
15 | +++ b/src/main.rs | ||
16 | @@ -3,7 +3,7 @@ use hello_lib::greet; | ||
17 | |||
18 | fn main() { | ||
19 | let standard_font = FIGfont::standard().unwrap(); | ||
20 | - let greeting = greet(None); | ||
21 | + let greeting = greet(Some("OE-Core")); | ||
22 | let figure = standard_font.convert(&greeting); | ||
23 | println!("{}", figure.unwrap()); | ||
24 | } | ||
diff --git a/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb new file mode 100644 index 0000000000..9a136f2978 --- /dev/null +++ b/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "Simple hello world example" | ||
2 | HOMEPAGE = "https://github.com/akiernan/hello-bin" | ||
3 | LICENSE = "Unlicense" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680" | ||
5 | |||
6 | SRC_URI = "git://github.com/akiernan/hello-bin.git;protocol=https;branch=main;subpath=rust \ | ||
7 | file://0001-Greet-OE-Core.patch \ | ||
8 | git://github.com/akiernan/hello-lib.git;protocol=https;branch=main;name=hello-lib;destsuffix=hello-lib;type=git-dependency \ | ||
9 | " | ||
10 | SRCREV = "d3d096eda182644868f8e7458dcfa538ff637db3" | ||
11 | |||
12 | SRCREV_FORMAT .= "_hello-lib" | ||
13 | SRCREV_hello-lib = "59c84574e844617043cf337bc8fa537cf87ad8ae" | ||
14 | |||
15 | S = "${WORKDIR}/rust" | ||
16 | |||
17 | inherit cargo cargo-update-recipe-crates ptest-cargo | ||
18 | |||
19 | # Remove this when the recipe is reproducible | ||
20 | EXCLUDE_FROM_WORLD = "1" | ||
21 | |||
22 | require ${BPN}-crates.inc | ||