Skip to content

Commit

Permalink
vendor a patch to work around the openssl 3.3.2 perl issue
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk committed Sep 3, 2024
1 parent 6b8fded commit e4ae927
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions cryptography-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN \
COPY --from=staticnodejs /out/ /staticnode/
ADD install_openssl.sh /root/install_openssl.sh
ADD openssl-version.sh /root/openssl-version.sh
ADD list-util-pairs-25367.patch /root/list-util-pairs-25367.patch
RUN ./install_openssl.sh

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal
Expand Down
4 changes: 4 additions & 0 deletions cryptography-linux/install_openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ curl -#LO "${OPENSSL_URL}/${OPENSSL_VERSION}/${OPENSSL_VERSION}.tar.gz"
echo "${OPENSSL_SHA256} ${OPENSSL_VERSION}.tar.gz" | sha256sum -c -
tar zxf ${OPENSSL_VERSION}.tar.gz
pushd ${OPENSSL_VERSION}
# Patch to work around OpenSSL 3.3.2 requiring a newer perl than manylinux2014
if [ -f /etc/redhat-release ] && grep -q "CentOS Linux release 7" /etc/redhat-release; then
git apply ../list-util-pairs-25367.patch
fi
./config $OPENSSL_BUILD_FLAGS --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
make depend
make -j4
Expand Down
51 changes: 51 additions & 0 deletions cryptography-linux/list-util-pairs-25367.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/util/mkinstallvars.pl b/util/mkinstallvars.pl
index 52a3d607bd..b67a1c477f 100644
--- a/util/mkinstallvars.pl
+++ b/util/mkinstallvars.pl
@@ -10,8 +10,14 @@
# form, or passed as variable assignments on the command line.
# The result is a Perl module creating the package OpenSSL::safe::installdata.

+use 5.10.0;
+use strict;
+use warnings;
+use Carp;
+
use File::Spec;
-use List::Util qw(pairs);
+#use List::Util qw(pairs);
+sub _pairs (@);

# These are expected to be set up as absolute directories
my @absolutes = qw(PREFIX libdir);
@@ -19,9 +25,9 @@ my @absolutes = qw(PREFIX libdir);
# as subdirectories to PREFIX or LIBDIR. The order of the pairs is important,
# since the LIBDIR subdirectories depend on the calculation of LIBDIR from
# PREFIX.
-my @subdirs = pairs (PREFIX => [ qw(BINDIR LIBDIR INCLUDEDIR APPLINKDIR) ],
- LIBDIR => [ qw(ENGINESDIR MODULESDIR PKGCONFIGDIR
- CMAKECONFIGDIR) ]);
+my @subdirs = _pairs (PREFIX => [ qw(BINDIR LIBDIR INCLUDEDIR APPLINKDIR) ],
+ LIBDIR => [ qw(ENGINESDIR MODULESDIR PKGCONFIGDIR
+ CMAKECONFIGDIR) ]);
# For completeness, other expected variables
my @others = qw(VERSION LDLIBS);

@@ -151,3 +157,17 @@ our \@LDLIBS =

1;
_____
+
+######## Helpers
+
+sub _pairs (@) {
+ croak "Odd number of arguments" if @_ & 1;
+
+ my @pairlist = ();
+
+ while (@_) {
+ my $x = [ shift, shift ];
+ push @pairlist, $x;
+ }
+ return @pairlist;
+}

0 comments on commit e4ae927

Please sign in to comment.