Skip to content

Commit

Permalink
Prefer system's OpenSSL if library files can be installed
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaba committed Mar 21, 2024
1 parent bb868dc commit 3af0d04
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion bin/pmbp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,7 @@ ($$)
my $archname = $args->{info} ? $Config{archname} : get_perl_archname $perl_command, $perl_version;
my @additional_path;
my @additional_option;
my $retry_with_openssl_dev = 0;
my $retry_with_openssl = 0;
my $dbd_mysql_ssl_dropped;

Expand Down Expand Up @@ -3087,7 +3088,17 @@ ($$)
if ($PlatformIsMacOSX) {
$redo = 1 if xcode_select_install or install_openssl ($perl_version);
} else {
$redo = 1 if install_openssl ($perl_version);
if (not $retry_with_openssl_dev) {
if (install_system_packages [{name => 'openssl-devel',
debian_name => 'libssl-dev'}]) {
$retry_with_openssl_dev = 1;
$redo = 1;
} else {
$redo = 1 if install_openssl ($perl_version);
}
} else {
$redo = 1 if install_openssl ($perl_version);
}
}
}
if ($required_misc{mecab}) {
Expand Down Expand Up @@ -4623,6 +4634,7 @@ ($)
onoutput => sub { $version = $_[0]; 2 }
or $version = undef;
$version =~ s/[\x0D\x0A]+\z// if defined $version;
$version =~ s/\s*\(Library: .+?\)$// if defined $version; # for backcompat and comparison with Net::SSLeay OpenSSL version
return $_OpenSSLVersion = $version;
} # get_openssl_version

Expand Down Expand Up @@ -6949,13 +6961,31 @@ =head2 Commands for pmbp.pl
An example of template file:

#!/bin/bash
set -eo pipefail
cd /myapp
{{INSTALL}}
## Now we can assume there are |perl| and |local/bin/pmbp.pl|.
perl local/bin/pmbp.pl --install-commands "make git"
git clone https://url/of/component
cd component && make deps

This would install an application into C</myapp>.

Another example template file:

#!/bin/bash
set -eo pipefail
rootpath=$(cd `dirname $0` && pwd)
cd $rootpath
{{INSTALL}}
perl local/bin/pmbp.pl --install-make && \
make deps && \
exec $rootpath/bin/local-server

The generated script is expected to be placed in the application
source tree's root directory. It would install the dependencies and
then start the C<bin/local-server> program.

=back

=head2 Commands for Perl interpreter
Expand Down

0 comments on commit 3af0d04

Please sign in to comment.