summaryrefslogtreecommitdiffstats
path: root/meta-selftest
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2023-12-29 11:44:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-30 11:03:08 +0000
commit781bd05a4bc4ca0f8015f103ec33eb7474ccf647 (patch)
tree39351abdf2f32cf9ed52ac4c260d5e3dab678110 /meta-selftest
parent6bc41cf96f6b6fed559b686ca600e6b0db09444b (diff)
downloadpoky-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')
-rw-r--r--meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc8
-rw-r--r--meta-selftest/recipes-extended/hello-rs/hello-rs/0001-Greet-OE-Core.patch24
-rw-r--r--meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb22
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
4SRC_URI += " \
5 crate://crates.io/figlet-rs/0.1.5 \
6"
7
8SRC_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 @@
1From 3aea1ece0ca6ac0bf0ffe42736827af22966f767 Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alexk@zuma.ai>
3Date: Wed, 27 Dec 2023 09:55:48 +0000
4Subject: [PATCH] Greet "OE-Core"
5
6Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
7Upstream-Status: Inappropriate
8---
9 src/main.rs | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/src/main.rs b/src/main.rs
13index 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 @@
1SUMMARY = "Simple hello world example"
2HOMEPAGE = "https://github.com/akiernan/hello-bin"
3LICENSE = "Unlicense"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680"
5
6SRC_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 "
10SRCREV = "d3d096eda182644868f8e7458dcfa538ff637db3"
11
12SRCREV_FORMAT .= "_hello-lib"
13SRCREV_hello-lib = "59c84574e844617043cf337bc8fa537cf87ad8ae"
14
15S = "${WORKDIR}/rust"
16
17inherit cargo cargo-update-recipe-crates ptest-cargo
18
19# Remove this when the recipe is reproducible
20EXCLUDE_FROM_WORLD = "1"
21
22require ${BPN}-crates.inc