2025. 01. 29. 10:05 keltezéssel, Alexander Kanavin írta:
On Wed, 29 Jan 2025 at 09:09, Zoltán Böszörményi <zbos...@gmail.com> 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 <decatho...@gmail.com>
+Signed-off-by: Zoltán Böszörményi <zbos...@gmail.com>
+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?

For the same reason your own half baked recipe has it.
https://git.yoctoproject.org/poky-contrib/tree/meta/recipes-devtools/rpm/rpm-sequoia_1.5.0.bb?h=akanavin/package-version-updates-later

| Caused by:
|   process didn't exit successfully: `/home/zozo/yocto-5.2/tmp-sicom/work/corei7-64-oe-linux/rpm-sequoia/1.6.0/build/target/release/build/rpm-sequoia-cae33956cd11baf0/build-script-build` (exit status: 101)
|   --- stderr
|   thread 'main' panicked at build.rs:119:36:
|   Creating "/home/zozo/yocto-5.2/tmp-sicom/work/corei7-64-oe-linux/rpm-sequoia/1.6.0/sources-unpack/git/target/release/rpm-sequoia.pc" (CARGO_TARGET_DIR: None): Os { code: 2, kind: NotFound, message: "No such file or directory" }
|   stack backtrace:
|      0: rust_begin_unwind
|      1: core::panicking::panic_fmt
|      2: core::result::unwrap_failed
|      3: core::result::Result<T,E>::expect
|                at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1059:23
|      4: build_script_build::main
|                at ./build.rs:119:18
|      5: core::ops::function::FnOnce::call_once
|                at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
|   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a 
verbose backtrace.



+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 (#210356): 
https://lists.openembedded.org/g/openembedded-core/message/210356
Mute This Topic: https://lists.openembedded.org/mt/110874796/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to