diff options
Diffstat (limited to 'meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb')
| -rw-r--r-- | meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb new file mode 100644 index 0000000000..577acfdc86 --- /dev/null +++ b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.9.0.bb | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | SUMMARY = "An OpenPGP backend for rpm using Sequoia PGP" | ||
| 2 | HOMEPAGE = "https://sequoia-pgp.org/" | ||
| 3 | |||
| 4 | # The license line is taken verbatim from Fedora's specfile | ||
| 5 | # with formatting differences for Yocto. (AND -> &, OR -> |) | ||
| 6 | # https://src.fedoraproject.org/rpms/rust-rpm-sequoia/blob/rawhide/f/rust-rpm-sequoia.spec | ||
| 7 | LICENSE = "LGPL-2.0-or-later & Apache-2.0 & BSL-1.0 & MIT & Unicode-DFS-2016 & (Apache-2.0 | MIT) & (MIT | Apache-2.0 | Zlib) & (Unlicense | MIT)" | ||
| 8 | |||
| 9 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0ff5ff7747cf7d394079c6ae87f5f0c" | ||
| 10 | |||
| 11 | DEPENDS = "openssl" | ||
| 12 | |||
| 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;tag=v${PV} \ | ||
| 16 | file://0001-Use-optional-env-vars-to-force-runtime-paths-in-test.patch \ | ||
| 17 | file://0001-tests-build-lib-for-symbols-tests-conditionally.patch \ | ||
| 18 | file://run-ptest \ | ||
| 19 | " | ||
| 20 | SRCREV = "cd090b02119565c6d171fa9a892790c966cf10ef" | ||
| 21 | |||
| 22 | require ${BPN}-crates.inc | ||
| 23 | |||
| 24 | CARGO_BUILD_FLAGS += "--no-default-features --features crypto-openssl" | ||
| 25 | CARGO_INSTALL_LIBRARIES = "1" | ||
| 26 | |||
| 27 | do_compile:prepend () { | ||
| 28 | # rpm-sequoia.pc is generated in the source directory | ||
| 29 | # but the target directory does not exist there. | ||
| 30 | mkdir -p ${S}/target/${BUILD_DIR} | ||
| 31 | |||
| 32 | # From rpm-sequoia's README.md: | ||
| 33 | # | ||
| 34 | # We also set two environment variables when calling `cargo build`: | ||
| 35 | # * `PREFIX` is the prefix that will be used in the generated | ||
| 36 | # `rpm-sequoia.pc` file. It defaults to `/usr/local`. | ||
| 37 | # * `LIBDIR` is the installed library path listed in the generated | ||
| 38 | # metadata. It can be an absolute path or one based on `${prefix}`, | ||
| 39 | # and defaults to `${prefix}/lib`. | ||
| 40 | |||
| 41 | export PREFIX="${prefix}" | ||
| 42 | export LIBDIR="${libdir}" | ||
| 43 | } | ||
| 44 | |||
| 45 | # By default, ptest binaries contain host build dir paths. | ||
| 46 | # Use custom environment variables to force these paths to match the target instead. | ||
| 47 | do_compile_ptest_cargo:prepend() { | ||
| 48 | os.environ["FORCE_RUNTIME_PATH_LIB"] = d.getVar("libdir") | ||
| 49 | os.environ["FORCE_RUNTIME_PATH_SRC"] = d.getVar("PTEST_PATH") | ||
| 50 | } | ||
| 51 | |||
| 52 | do_install:append () { | ||
| 53 | # Move the library to the correct location expected by rpm-sequoia.pc | ||
| 54 | mkdir -p ${D}${libdir} | ||
| 55 | mv ${D}${rustlibdir}/librpm_sequoia.so ${D}${libdir}/librpm_sequoia.so.1 | ||
| 56 | ln -s librpm_sequoia.so.1 ${D}${libdir}/librpm_sequoia.so | ||
| 57 | |||
| 58 | rmdir -p --ignore-fail-on-non-empty ${D}${rustlibdir} | ||
| 59 | |||
| 60 | # rpm-sequoia does not install its pkgconfig file. Do it manually. | ||
| 61 | mkdir -p ${D}${libdir}/pkgconfig | ||
| 62 | install -m644 ${S}/target/${BUILD_DIR}/rpm-sequoia.pc ${D}${libdir}/pkgconfig | ||
| 63 | } | ||
| 64 | |||
| 65 | do_install_ptest:append () { | ||
| 66 | install -d ${D}${PTEST_PATH}/src | ||
| 67 | install -m 644 ${S}/src/symbols.txt ${D}${PTEST_PATH}/src/symbols.txt | ||
| 68 | } | ||
| 69 | |||
| 70 | # Tests need objdump | ||
| 71 | # ptest requires a symlinked library that is only present in the -dev package, | ||
| 72 | # so we add the -dev to runtime dependencies. | ||
| 73 | # The "dev-deps" QA check is skipped to avoid warnings about this dev package dependency. | ||
| 74 | RDEPENDS:${PN}-ptest += "binutils ${PN}-dev" | ||
| 75 | INSANE_SKIP:${PN}-ptest += "dev-deps" | ||
| 76 | |||
| 77 | RDEPENDS:${PN} = "rpm-sequoia-crypto-policy" | ||
| 78 | PACKAGE_WRITE_DEPS += "rpm-sequoia-crypto-policy-native" | ||
| 79 | |||
| 80 | BBCLASSEXTEND = "native" | ||
