commit:     e04225e470ac4931dfab508f185485f0602aac7f
Author:     Sandino Araico Sanchez <sandino <AT> sandino <DOT> net>
AuthorDate: Sat May  1 05:00:11 2021 +0000
Commit:     Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
CommitDate: Thu May  6 19:15:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=e04225e4

=dev-libs/libp11-0.4.11 libressl support

Signed-off-by: Sandino Araico Sanchez <sandino <AT> sandino.net>
Bug: https://bugs.gentoo.org/692240
Closes: https://github.com/gentoo/libressl/pull/331
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>

 dev-libs/libp11/files/libp11-0.4.11-libressl.patch | 13 +++++++++
 dev-libs/libp11/libp11-0.4.11.ebuild               | 31 ++++++++++++++++++++++
 dev-libs/libp11/metadata.xml                       | 20 ++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/dev-libs/libp11/files/libp11-0.4.11-libressl.patch 
b/dev-libs/libp11/files/libp11-0.4.11-libressl.patch
new file mode 100644
index 0000000..9f285b1
--- /dev/null
+++ b/dev-libs/libp11/files/libp11-0.4.11-libressl.patch
@@ -0,0 +1,13 @@
+diff -puriN libp11-0.4.11.orig/src/p11_rsa.c libp11-0.4.11/src/p11_rsa.c
+--- libp11-0.4.11.orig/src/p11_rsa.c   2020-10-11 08:41:00.000000000 -0500
++++ libp11-0.4.11/src/p11_rsa.c        2021-01-15 06:00:38.000000000 -0600
+@@ -336,7 +336,7 @@ int pkcs11_get_key_size(PKCS11_KEY *key)
+       return RSA_size(rsa);
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10100005L || defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100005L || ( 
defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3000000L )
+ 
+ int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))
+               (int flen, const unsigned char *from,
+

diff --git a/dev-libs/libp11/libp11-0.4.11.ebuild 
b/dev-libs/libp11/libp11-0.4.11.ebuild
new file mode 100644
index 0000000..0aa9077
--- /dev/null
+++ b/dev-libs/libp11/libp11-0.4.11.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="Abstraction layer to simplify PKCS#11 API"
+HOMEPAGE="https://github.com/opensc/libp11/wiki";
+SRC_URI="https://github.com/OpenSC/${PN}/releases/download/${P}/${P}.tar.gz";
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="bindist doc static-libs"
+
+RDEPEND="dev-libs/openssl:0=[bindist=]"
+DEPEND="${RDEPEND}
+       virtual/pkgconfig
+       doc? ( app-doc/doxygen )"
+PATCHES="${FILESDIR}/libp11-0.4.11-libressl.patch"
+
+src_configure() {
+       econf \
+               --enable-shared \
+               $(use_enable static-libs static) \
+               $(use_enable doc api-doc)
+}
+
+src_install() {
+       default
+       find "${D}" -name '*.la' -delete || die
+}

diff --git a/dev-libs/libp11/metadata.xml b/dev-libs/libp11/metadata.xml
new file mode 100644
index 0000000..aa000f7
--- /dev/null
+++ b/dev-libs/libp11/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <name>Lars Wendler</name>
+               <email>[email protected]</email>
+       </maintainer>
+       <longdescription>
+               Library implementing a small layer on top of PKCS#11 API to make
+               using PKCS#11 implementations easier.
+       </longdescription>
+       <use>
+               <flag name="doc">Generate and install API documentation for the 
package.</flag>
+       </use>
+       <upstream>
+               <remote-id type="cpe">cpe:/a:opensc-project:opensc</remote-id>
+               <remote-id type="github">opensc/libp11</remote-id>
+               <remote-id type="sourceforge">opensc</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to