summaryrefslogtreecommitdiff
path: root/dev-util/librnp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-03 02:07:18 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-03 02:07:18 +0000
commit7f4b508a2da3c371c7e770aa6ab83b0c4237cd1c (patch)
tree81d78cbf05f5daa7d57418d32f44b0149a56a765 /dev-util/librnp
parentd4f65848c7ecabb56e2f93889cbd20078cd347f7 (diff)
gentoo auto-resync : 03:12:2024 - 02:07:18
Diffstat (limited to 'dev-util/librnp')
-rw-r--r--dev-util/librnp/Manifest2
-rw-r--r--dev-util/librnp/files/librnp-0.17.1-libcxx-fix.patch94
-rw-r--r--dev-util/librnp/librnp-0.17.1-r2.ebuild87
3 files changed, 183 insertions, 0 deletions
diff --git a/dev-util/librnp/Manifest b/dev-util/librnp/Manifest
index 9c1b205fa2ce..e38accff4d1a 100644
--- a/dev-util/librnp/Manifest
+++ b/dev-util/librnp/Manifest
@@ -1,3 +1,5 @@
+AUX librnp-0.17.1-libcxx-fix.patch 3794 BLAKE2B 39125d9f2562c35f04a1859e65e73ae57df0512ddc1f978ce4655a4018d1c1fe53eb186987854847fa5955052142569a724dfb0e26e4e1a52b8258fc1520f5bd SHA512 7f0b1d94d8c97db90cf6759701d231045574f9e860342fda2a8599a5d9e526fcb918d886e16270cd98b23c7fc3b0c5e9ef51888bb842b975c1f736c75a79918f
DIST librnp-0.17.1.tar.gz 3515288 BLAKE2B 279cd5c669b469112066c4754a9a5a5c9fbe3ba225be4f85bc507aad9f29cfa166f90cb3dfe83ea8e29964fdfbbf926438fb36bb345da494ed7f70586fa8d7b6 SHA512 0224f79e4dd4b72ddd9c191218327da5485ed1d81321cc3a167cfeea68c00e47cec9151a4177e65e5560039345db3a52e41a093adfdf833f57e867bc559494a5
EBUILD librnp-0.17.1-r1.ebuild 1877 BLAKE2B 24396a654d81d72342f9fb4b8b059043f62cfa030deee7f38ab0aa43987553fe70118c74f286a28519705bbf5ab482d53154535dcf29822d3942aecd850c1261 SHA512 1b53ab95d4534bb46eb020b9fd5e4d82cfcdc40ca3895e0b0d2a48837971a0ea9352ec28277a4458a4e6815b869d231cf8e2bc29f64418deb6b9db6260bd9190
+EBUILD librnp-0.17.1-r2.ebuild 1927 BLAKE2B 35299c544c579961f88ef746b04a3e0adbb592045555cc55cec415e177bbd2733c15238657b48c9b5cb6456730f76e494e4fa9b6729c6d5bf4bae186c7a52d1d SHA512 90bccc83ca0c67434bbdc0ab74cb66451e7ced16be494e543b2546fd3bbf14d86b53665104e994369a949330721153a577fa2b8833bf6e4bfa87d458ecde67f5
MISC metadata.xml 430 BLAKE2B 739d6cddc56f385ad2b1679f6b3d9ba567ce77ec536894ca3861ad7ad127fd60c395db49b31d89963df12c03d8cf69fc6f083f5d3361b790079952c1e76ccf03 SHA512 ad7b3e6332741e1f2eae9e158d5ca767f5985a8f5c86eb5f21b7ee0214b9c7fdd2e90beddf1a9287218edf35aff39bd7ff1a4f1d15eb10552ab664738f8d1959
diff --git a/dev-util/librnp/files/librnp-0.17.1-libcxx-fix.patch b/dev-util/librnp/files/librnp-0.17.1-libcxx-fix.patch
new file mode 100644
index 000000000000..f10e1c5e7046
--- /dev/null
+++ b/dev-util/librnp/files/librnp-0.17.1-libcxx-fix.patch
@@ -0,0 +1,94 @@
+# This patch is fetched from upstream https://github.com/rnpgp/rnp
+# The patch is added to the tree by <Denis Pronin> dannftk@yandex.ru
+
+From 20419f739f632fb30666650544f0055e8d4f1afa Mon Sep 17 00:00:00 2001
+From: Maxim Samsonov <m.samsonov@computer.org>
+Date: Wed, 19 Jun 2024 16:52:08 +0300
+Subject: [PATCH] Removed lookup against basic_string<uint8_t>
+
+---
+ src/lib/types.h | 5 +----
+ src/lib/utils.cpp | 17 +----------------
+ src/librekey/key_store_g10.cpp | 8 ++++----
+ src/libsexpp | 2 +-
+ 4 files changed, 7 insertions(+), 25 deletions(-)
+
+diff --git a/src/lib/types.h b/src/lib/types.h
+index f0c25d3d..a7eac3a1 100644
+--- a/src/lib/types.h
++++ b/src/lib/types.h
+@@ -71,9 +71,6 @@ class id_str_pair {
+ static int lookup(const id_str_pair pair[],
+ const std::vector<uint8_t> &bytes,
+ int notfound = 0);
+- static int lookup(const id_str_pair pair[],
+- const std::basic_string<uint8_t> &bytes,
+- int notfound = 0);
+ };
+
+ /** pgp_fingerprint_t */
+diff --git a/src/lib/utils.cpp b/src/lib/utils.cpp
+index 3c6216c6..fd526379 100644
+--- a/src/lib/utils.cpp
++++ b/src/lib/utils.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2021, [Ribose Inc](https://www.ribose.com).
++ * Copyright (c) 2021, 2024 [Ribose Inc](https://www.ribose.com).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -63,18 +63,3 @@ id_str_pair::lookup(const id_str_pair pair[], const std::vector<uint8_t> &bytes,
+ }
+ return notfound;
+ }
+-
+-int
+-id_str_pair::lookup(const id_str_pair pair[],
+- const std::basic_string<uint8_t> &bytes,
+- int notfound)
+-{
+- while (pair && pair->str) {
+- if ((strlen(pair->str) == bytes.size()) &&
+- !memcmp(pair->str, bytes.data(), bytes.size())) {
+- return pair->id;
+- }
+- pair++;
+- }
+- return notfound;
+-}
+diff --git a/src/librekey/key_store_g10.cpp b/src/librekey/key_store_g10.cpp
+index e646f02f..21136866 100644
+--- a/src/librekey/key_store_g10.cpp
++++ b/src/librekey/key_store_g10.cpp
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2017-2022, [Ribose Inc](https://www.ribose.com).
++ * Copyright (c) 2017-2024, [Ribose Inc](https://www.ribose.com).
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+@@ -311,12 +311,12 @@ read_curve(const sexp_list_t *list, const std::string &name, pgp_ec_key_t &key)
+
+ const auto &bytes = data->get_string();
+ pgp_curve_t curve = static_cast<pgp_curve_t>(
+- id_str_pair::lookup(g10_curve_aliases, data->get_string(), PGP_CURVE_UNKNOWN));
++ id_str_pair::lookup(g10_curve_aliases, (const char *) bytes.data(), PGP_CURVE_UNKNOWN));
+ if (curve != PGP_CURVE_UNKNOWN) {
+ key.curve = curve;
+ return true;
+ }
+- RNP_LOG("Unknown curve: %.*s", (int) bytes.size(), (char *) bytes.data());
++ RNP_LOG("Unknown curve: %.*s", (int) bytes.size(), (const char *) bytes.data());
+ return false;
+ }
+
+@@ -807,7 +807,7 @@ g23_parse_seckey(pgp_key_pkt_t &seckey,
+
+ auto & alg_bt = alg_s_exp->sexp_string_at(0)->get_string();
+ pgp_pubkey_alg_t alg = static_cast<pgp_pubkey_alg_t>(
+- id_str_pair::lookup(g10_alg_aliases, alg_bt.c_str(), PGP_PKA_NOTHING));
++ id_str_pair::lookup(g10_alg_aliases, (const char *) alg_bt.data(), PGP_PKA_NOTHING));
+ if (alg == PGP_PKA_NOTHING) {
+ RNP_LOG(
+ "Unsupported algorithm: '%.*s'", (int) alg_bt.size(), (const char *) alg_bt.data());
diff --git a/dev-util/librnp/librnp-0.17.1-r2.ebuild b/dev-util/librnp/librnp-0.17.1-r2.ebuild
new file mode 100644
index 000000000000..622351d9190f
--- /dev/null
+++ b/dev-util/librnp/librnp-0.17.1-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake multiprocessing
+
+DESCRIPTION="High performance C++ OpenPGP library"
+HOMEPAGE="https://www.rnpgp.org/ https://github.com/rnpgp/rnp"
+SRC_URI="https://github.com/rnpgp/rnp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${P/*lib/}"
+
+LICENSE="Apache-2.0 BSD BSD-2"
+SLOT="0/0.16.1"
+KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~x86"
+
+IUSE="+botan man test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="app-arch/bzip2
+ dev-libs/json-c:=
+ >=dev-libs/sexpp-0.8.7
+ sys-libs/zlib
+ botan? ( dev-libs/botan:3= )
+ !botan? ( >=dev-libs/openssl-1.1.1:= )"
+DEPEND="${RDEPEND}
+ test? ( dev-cpp/gtest )"
+BDEPEND="man? ( dev-ruby/asciidoctor )"
+
+PATCHES=( "${FILESDIR}"/${P}-libcxx-fix.patch )
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTING=$(usex test on off)
+
+ -DCRYPTO_BACKEND=$(usex botan botan3 openssl)
+
+ -DDOWNLOAD_GTEST=off
+
+ -DENABLE_COVERAGE=off
+ -DENABLE_DOC=$(usex man on off)
+ -DENABLE_FUZZERS=off
+ -DENABLE_SANITIZERS=off
+
+ -DSYSTEM_LIBSEXPP=on
+ )
+
+ if use botan; then
+ local mycmakeargs+=(
+ -DENABLE_AEAD=on
+ -DENABLE_BLOWFISH=on
+ -DENABLE_BRAINPOOL=on
+ -DENABLE_CAST5=on
+ -DENABLE_IDEA=on
+ -DENABLE_RIPEMD160=on
+ -DENABLE_SM2=on
+ -DENABLE_TWOFISH=on
+ )
+
+ # OpenSSL support is still not as complete as botan.
+ # https://github.com/rnpgp/rnp/issues/1877 SM2,
+ # https://github.com/openssl/openssl/issues/2046 TWOFISH (won't be implemented).
+ else
+ local mycmakeargs+=(
+ -DENABLE_AEAD=on
+ -DENABLE_BLOWFISH=on
+ -DENABLE_BRAINPOOL=on
+ -DENABLE_CAST5=on
+ -DENABLE_IDEA=on
+ -DENABLE_RIPEMD160=on
+ -DENABLE_SM2=off
+ -DENABLE_TWOFISH=off
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ cd "${BUILD_DIR}"/src/tests || die
+ ctest -j$(makeopts_jobs) -R .* --output-on-failure || die
+}
+
+src_install() {
+ cmake_src_install
+ find "${D}" -name '*.a' -delete || die
+}