On Wed, 29 Jan 2025 at 09:09, Zoltán Böszörményi <[email protected]> wrote:
> +Subject: [PATCH 1/2] Make openssl the default signing crypto
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Idea taken from the Fedora 41 rpm specfile, extended to build.rs
> +to make it actually build. Give credit where credit is due: the
> +Cargo.toml part of this patch is identical to the Fedora version.
> +
> +Signed-off-by: Fabio Valentini <[email protected]>
> +Signed-off-by: Zoltán Böszörményi <[email protected]>
> +Upstream-Status: Inappropriate [Yocto specific]
> +---
> + Cargo.toml | 5 +----
> + build.rs   | 8 +-------
> + 2 files changed, 2 insertions(+), 11 deletions(-)
> +
> +diff --git a/Cargo.toml b/Cargo.toml
> +index 7832878..1024cad 100644
> +--- a/Cargo.toml
> ++++ b/Cargo.toml
> +@@ -43,11 +43,8 @@ crate-type = ["cdylib"]
> +
> + # We explicitly do not want to enable Sequoia's decompression support.
> + # Hence we only select a crypto backend.
> +-default = ["crypto-nettle"]
> ++default = ["crypto-openssl"]
> + crypto-nettle = ["sequoia-openpgp/crypto-nettle"]
> + crypto-rust = ["sequoia-openpgp/crypto-rust"]
> +-crypto-cng = ["sequoia-openpgp/crypto-cng"]
> + crypto-openssl = ["sequoia-openpgp/crypto-openssl"]
> +-crypto-botan = ["sequoia-openpgp/crypto-botan"]
> +-crypto-botan2 = ["sequoia-openpgp/crypto-botan2"]
> +
> +diff --git a/build.rs b/build.rs
> +index 1fdef4e..cdbbe88 100644
> +--- a/build.rs
> ++++ b/build.rs
> +@@ -30,16 +30,10 @@ impl PkgConfigTemplate {
> +             ("VERSION".to_string(), env!("CARGO_PKG_VERSION").to_string()),
> +             ("HOMEPAGE".to_string(), 
> env!("CARGO_PKG_HOMEPAGE").to_string()),
> +             ("REQUIRES".to_string(),
> +-             if cfg!(feature = "crypto-botan") {
> +-                 "botan-3"
> +-             } else if cfg!(feature = "crypto-botan2") {
> +-                 "botan-2"
> +-             } else if cfg!(feature = "crypto-nettle") {
> ++             if cfg!(feature = "crypto-nettle") {
> +                  "nettle"
> +              } else if cfg!(feature = "crypto-openssl") {
> +                  "libssl"
> +-             } else if cfg!(feature = "crypto-cng") {
> +-                 ""
> +              } else if cfg!(feature = "crypto-rust") {
> +                  ""
> +              } else {

I don't understand. It seems like this changes the default crypto
choice, but why not simply pass openssl selection as a parameter from
the recipe?

> + Cargo.lock | 1049 +++++++++++++++++++++++++++++++---------------------

If this is updated correctly, then the change to cargo class in
another patch should not be necessary.

Also, this file is going to be a royal pain to keep updated with
sequoia version updates. Another reason not to patch rust sources when
it can be avoided.



> +++ b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.6.0.bb
> @@ -0,0 +1,40 @@
> +SUMMARY = "An OpenPGP backend for rpm using Sequoia PGP"
> +HOMEPAGE = "https://sequoia-pgp.org/";
> +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)"

This is very elaborate, how was it determined? How to ensure it remains correct?

> +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f0ff5ff7747cf7d394079c6ae87f5f0c"
> +
> +DEPENDS = "openssl"
> +
> +inherit pkgconfig rust cargo cargo-update-recipe-crates
> +
> +CARGO_USE_OFFLINE_FLAG = "1"

As explained above, this should not be needed if Cargo.lock is correct.

> +export CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = "true"

Why? Things like this need a comment in the recipe.

> +do_compile:prepend () {
> +       mkdir -p ${S}/target/release
> +}

Why?

> +do_install () {
> +       mkdir -p ${D}${libdir}
> +       install -m0755 
> ${B}/target/${RUST_TARGET_SYS}/release/librpm_sequoia.so 
> ${D}${libdir}/librpm_sequoia.so.1
> +       ln -s librpm_sequoia.so.1 ${D}${libdir}/librpm_sequoia.so
> +
> +       mkdir -p ${D}${libdir}/pkgconfig
> +       install -m644 ${S}/target/release/rpm-sequoia.pc 
> ${D}${libdir}/pkgconfig
> +}

Why can't we use upstream's standard install procedure? Also,
cargo.bbclass has an install function, why is it completely replaced?

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#210354): 
https://lists.openembedded.org/g/openembedded-core/message/210354
Mute This Topic: https://lists.openembedded.org/mt/110874796/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to