commit:     f70d8bd41578ec2ba2841a6b1304ec332882fc38
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Sat Oct  2 05:53:03 2021 +0000
Commit:     Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
CommitDate: Sat Oct  2 22:18:54 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=f70d8bd4

dev-perl/Net-SSLeay: Added

Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/libressl/pull/356
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>

 dev-perl/Net-SSLeay/Manifest                       |  1 +
 dev-perl/Net-SSLeay/Net-SSLeay-1.900.0.ebuild      | 64 ++++++++++++++++++++++
 .../files/Net-SSLeay-1.88-fix-libdir.patch         | 27 +++++++++
 .../files/Net-SSLeay-1.88-fix-network-tests.patch  | 17 ++++++
 .../files/Net-SSLeay-1.900.0-libressl.patch        | 24 ++++++++
 5 files changed, 133 insertions(+)

diff --git a/dev-perl/Net-SSLeay/Manifest b/dev-perl/Net-SSLeay/Manifest
new file mode 100644
index 0000000..5937ab9
--- /dev/null
+++ b/dev-perl/Net-SSLeay/Manifest
@@ -0,0 +1 @@
+DIST Net-SSLeay-1.90.tar.gz 534246 BLAKE2B 
2510fa886db8b7c5f185aa1145ae1b50b7c4101a9bd80e17c8c1d77718765f288c9180464d831775c35aa94b5a6f6c8f717ecaeb4974f7280829b63f10567f22
 SHA512 
8a5f251b5ef1d8c2d619d984594a7a22ddeed2e5e726fe683a45f299d7878f4ca8ffab00480ebf5ef7a94ae1fcf6be05dfdaa68b8bfe2ad68443150765adb891

diff --git a/dev-perl/Net-SSLeay/Net-SSLeay-1.900.0.ebuild 
b/dev-perl/Net-SSLeay/Net-SSLeay-1.900.0.ebuild
new file mode 100644
index 0000000..5d4c2b8
--- /dev/null
+++ b/dev-perl/Net-SSLeay/Net-SSLeay-1.900.0.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DIST_AUTHOR=CHRISN
+DIST_VERSION=1.90
+DIST_EXAMPLES=("examples/*")
+inherit multilib perl-module
+
+DESCRIPTION="Perl extension for using OpenSSL"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 
sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="minimal examples"
+
+RDEPEND="
+       dev-libs/openssl:0=
+       virtual/perl-MIME-Base64
+"
+BDEPEND="${RDEPEND}
+       virtual/perl-ExtUtils-MakeMaker
+       test? (
+               !minimal? (
+                       dev-perl/Test-Exception
+                       dev-perl/Test-Warn
+                       dev-perl/Test-NoWarnings
+               )
+               virtual/perl-Test-Simple
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-1.88-fix-network-tests.patch"
+       "${FILESDIR}/${PN}-1.88-fix-libdir.patch"
+       "${FILESDIR}/${P}-libressl.patch"
+)
+
+PERL_RM_FILES=(
+       # Hateful author tests
+       't/local/01_pod.t'
+       't/local/02_pod_coverage.t'
+       't/local/kwalitee.t'
+)
+
+src_configure() {
+       if use test && has network ${DIST_TEST_OVERRIDE:-${DIST_TEST:-do 
parallel}}; then
+               export NETWORK_TESTS=yes
+       else
+               use test && einfo "Network tests will be skipped without 
DIST_TEST_OVERRIDE=~network"
+               export NETWORK_TESTS=no
+       fi
+       export LIBDIR=$(get_libdir)
+       perl-module_src_configure
+}
+
+src_compile() {
+       mymake=(
+               OPTIMIZE="${CFLAGS}"
+               OPENSSL_PREFIX="${EPREFIX}"/usr
+       )
+       perl-module_src_compile
+}

diff --git a/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-libdir.patch 
b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-libdir.patch
new file mode 100644
index 0000000..d78acb9
--- /dev/null
+++ b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-libdir.patch
@@ -0,0 +1,27 @@
+Bug: https://bugs.gentoo.org/416339
+
+The previous patch for the above bug report used $ENV{LIBDIR} but this
+wasn't enough to help with cross-compiling. We could use $ENV{SYSROOT}
+but this results in a bogus RPATH entry. It is better to simply trust
+the toolchain, which may have its own sysroot applied.
+
+Cross-compiling Perl modules requires additional hackery but at least
+that hackery will work now. :)
+
+Chewi
+2017/12/03
+
+diff -Naur a/Makefile.PL b/Makefile.PL
+--- a/Makefile.PL      2017-10-13 01:38:01.000000000 +0100
++++ b/Makefile.PL      2017-12-03 10:52:27.304861804 +0000
+@@ -141,10 +141,8 @@
+         cccdlflags => '',
+     };
+     for ("$prefix/include", "$prefix/inc32", '/usr/kerberos/include') {
+-      push @{$opts->{inc_paths}}, $_ if -f "$_/openssl/ssl.h";
+     }
+     for ($prefix, "$prefix/lib64", "$prefix/lib", "$prefix/out32dll") {
+-      push @{$opts->{lib_paths}}, $_ if -d $_;
+     }
+ 
+     my $rsaref  = $self->ssleay_is_rsaref;

diff --git a/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-network-tests.patch 
b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-network-tests.patch
new file mode 100644
index 0000000..a98c4c8
--- /dev/null
+++ b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.88-fix-network-tests.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile.PL b/Makefile.PL
+index 31d9c74..91ac2b4 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -12,11 +12,7 @@ use Symbol qw(gensym);
+ # the Net-SSLeay loadable object on Windows
+ my $win_link_statically = 0;
+ 
+-my $tests = prompt(
+-  "Do you want to run external tests?\n".
+-  "These tests *will* *fail* if you do not have network connectivity.",
+-  'n',
+-) =~ /^y/i ? 't/*/*.t t/*/*/*.t' : 't/local/*.t t/handle/local/*.t';
++my $tests = ( 'yes' eq ( $ENV{NETWORK_TESTS} || '' ) ) ? 't/*/*.t t/*/*/*.t' 
: 't/local/*.t t/handle/local/*.t';
+ 
+ my %eumm_args = (
+   NAME => 'Net::SSLeay',

diff --git a/dev-perl/Net-SSLeay/files/Net-SSLeay-1.900.0-libressl.patch 
b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.900.0-libressl.patch
new file mode 100644
index 0000000..dc5b69c
--- /dev/null
+++ b/dev-perl/Net-SSLeay/files/Net-SSLeay-1.900.0-libressl.patch
@@ -0,0 +1,24 @@
+From 3cea3697bfc75ab3e5f4725eb1588ed9c4bff27a Mon Sep 17 00:00:00 2001
+From: Alexander Bluhm <alexander.bl...@gmx.net>
+Date: Mon, 30 Aug 2021 21:31:20 +0200
+Subject: [PATCH] Use SSL_SESSION_get_master_key() for LibreSSL.
+
+Since version 2.7 LibreSSL implements SSL_SESSION_get_master_key().
+Use this instead of accessing internal struct fields.
+---
+ SSLeay.xs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/SSLeay.xs b/SSLeay.xs
+index c2257fa..5377ba6 100644
+--- a/SSLeay.xs
++++ b/SSLeay.xs
+@@ -6281,7 +6281,7 @@ SSL_total_renegotiations(ssl)
+   OUTPUT:
+   RETVAL
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && 
!defined(LIBRESSL_VERSION_NUMBER)) || (LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
+ void
+ SSL_SESSION_get_master_key(s)
+      SSL_SESSION *   s

Reply via email to