diff options
3 files changed, 60 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index 710f2a8ab8..3658dd2adb 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc | |||
@@ -80,6 +80,7 @@ PTESTS_FAST = "\ | |||
80 | python3-webcolors \ | 80 | python3-webcolors \ |
81 | qemu \ | 81 | qemu \ |
82 | quilt \ | 82 | quilt \ |
83 | rpm-sequoia \ | ||
83 | sed \ | 84 | sed \ |
84 | slang \ | 85 | slang \ |
85 | wayland \ | 86 | wayland \ |
diff --git a/meta/recipes-devtools/rpm-sequoia/files/0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch b/meta/recipes-devtools/rpm-sequoia/files/0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch new file mode 100644 index 0000000000..d0179fc53c --- /dev/null +++ b/meta/recipes-devtools/rpm-sequoia/files/0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 590937523deea4ad2a2ee0e1ae4412a8f59e0170 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ines KCHELFI <ines.kchelfi@smile.fr> | ||
3 | Date: Thu, 10 Apr 2025 15:14:11 +0200 | ||
4 | Subject: [PATCH] Use optional env vars to force runtime paths in tests | ||
5 | |||
6 | Signed-off-by: Ines KCHELFI <ines.kchelfi@smile.fr> | ||
7 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm-sequoia/pull/86] | ||
8 | --- | ||
9 | tests/symbols.rs | 6 ++++-- | ||
10 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/tests/symbols.rs b/tests/symbols.rs | ||
13 | index c16dd9b..dc4a42c 100644 | ||
14 | --- a/tests/symbols.rs | ||
15 | +++ b/tests/symbols.rs | ||
16 | @@ -14,7 +14,8 @@ fn symbols() -> anyhow::Result<()> { | ||
17 | // OUT_DIR gives us | ||
18 | // `/tmp/rpm-sequoia/debug/build/rpm-sequoia-HASH/out`. | ||
19 | |||
20 | - let out_dir = PathBuf::from(env!("OUT_DIR")); | ||
21 | + let out_dir = PathBuf::from(option_env!("FORCE_RUNTIME_PATH_LIB") | ||
22 | + .unwrap_or(env!("OUT_DIR"))); | ||
23 | let mut build_dir = out_dir; | ||
24 | let lib = loop { | ||
25 | let mut lib = build_dir.clone(); | ||
26 | @@ -53,7 +54,8 @@ fn symbols() -> anyhow::Result<()> { | ||
27 | } | ||
28 | |||
29 | let mut expected_symbols_txt_fn | ||
30 | - = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
31 | + = PathBuf::from(option_env!("FORCE_RUNTIME_PATH_SRC") | ||
32 | + .unwrap_or(env!("CARGO_MANIFEST_DIR"))); | ||
33 | expected_symbols_txt_fn.push("src/symbols.txt"); | ||
34 | |||
35 | let mut expected_symbols_txt = Vec::new(); | ||
diff --git a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb index 57062b100a..6ef626e466 100644 --- a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb +++ b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb | |||
@@ -10,9 +10,12 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0ff5ff7747cf7d394079c6ae87f5f0c" | |||
10 | 10 | ||
11 | DEPENDS = "openssl" | 11 | DEPENDS = "openssl" |
12 | 12 | ||
13 | inherit pkgconfig rust cargo cargo-update-recipe-crates | 13 | inherit pkgconfig rust cargo cargo-update-recipe-crates ptest-cargo |
14 | |||
15 | SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main \ | ||
16 | file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ | ||
17 | " | ||
14 | 18 | ||
15 | SRC_URI = "git://github.com/rpm-software-management/rpm-sequoia.git;protocol=https;branch=main" | ||
16 | 19 | ||
17 | SRCREV = "0667e04ae7fb8cf0490919978d69883d16400e41" | 20 | SRCREV = "0667e04ae7fb8cf0490919978d69883d16400e41" |
18 | 21 | ||
@@ -41,6 +44,13 @@ do_compile:prepend () { | |||
41 | export LIBDIR="${libdir}" | 44 | export LIBDIR="${libdir}" |
42 | } | 45 | } |
43 | 46 | ||
47 | # By default, ptest binaries contain host build dir paths. | ||
48 | # Use custom environment variables to force these paths to match the target instead. | ||
49 | do_compile_ptest_cargo:prepend() { | ||
50 | os.environ["FORCE_RUNTIME_PATH_LIB"] = d.getVar("libdir") | ||
51 | os.environ["FORCE_RUNTIME_PATH_SRC"] = d.getVar("PTEST_PATH") | ||
52 | } | ||
53 | |||
44 | do_install:append () { | 54 | do_install:append () { |
45 | # Move the library to the correct location expected by rpm-sequoia.pc | 55 | # Move the library to the correct location expected by rpm-sequoia.pc |
46 | mkdir -p ${D}${libdir} | 56 | mkdir -p ${D}${libdir} |
@@ -54,6 +64,18 @@ do_install:append () { | |||
54 | install -m644 ${S}/target/release/rpm-sequoia.pc ${D}${libdir}/pkgconfig | 64 | install -m644 ${S}/target/release/rpm-sequoia.pc ${D}${libdir}/pkgconfig |
55 | } | 65 | } |
56 | 66 | ||
67 | do_install_ptest:append () { | ||
68 | install -d ${D}${PTEST_PATH}/src | ||
69 | install -m 644 ${S}/src/symbols.txt ${D}${PTEST_PATH}/src/symbols.txt | ||
70 | } | ||
71 | |||
72 | # Tests need objdump | ||
73 | # ptest requires a symlinked library that is only present in the -dev package, | ||
74 | # so we add the -dev to runtime dependencies. | ||
75 | # The "dev-deps" QA check is skipped to avoid warnings about this dev package dependency. | ||
76 | RDEPENDS:${PN}-ptest += "binutils ${PN}-dev" | ||
77 | INSANE_SKIP:${PN}-ptest += "dev-deps" | ||
78 | |||
57 | RDEPENDS:${PN} = "rpm-sequoia-crypto-policy" | 79 | RDEPENDS:${PN} = "rpm-sequoia-crypto-policy" |
58 | PACKAGE_WRITE_DEPS += "rpm-sequoia-crypto-policy-native" | 80 | PACKAGE_WRITE_DEPS += "rpm-sequoia-crypto-policy-native" |
59 | 81 | ||