add openssl patch

This commit is contained in:
crazywhalecc 2024-01-07 11:09:26 +08:00 committed by Jerry Ma
parent d4eb199504
commit d3d8230a09

View File

@ -4,17 +4,25 @@ declare(strict_types=1);
namespace SPC\builder\unix\library; namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
trait ldap trait ldap
{ {
public function patchBeforeBuild(): bool
{
FileSystem::replaceFileStr($this->source_dir . '/configure', '"-lssl -lcrypto', '"-lz -lssl -lcrypto');
return true;
}
protected function build(): void protected function build(): void
{ {
$alt = ''; $alt = '';
// openssl support // openssl support
$alt .= ($this->builder->getLib('openssl') && $this->builder->getExt('zlib')) ? '--with-tls=openssl ' : ''; $alt .= $this->builder->getLib('openssl') ? '--with-tls=openssl ' : '';
// gmp support // gmp support
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : ''; $alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
// libsodium support // libsodium support
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : ''; $alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '--enable-argon2=no ';
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config'); f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig'); f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
@ -24,7 +32,6 @@ trait ldap
'--enable-static ' . '--enable-static ' .
'--disable-shared ' . '--disable-shared ' .
'--disable-slapd ' . '--disable-slapd ' .
'--disable-slurpd ' .
'--without-systemd ' . '--without-systemd ' .
'--without-cyrus-sasl ' . '--without-cyrus-sasl ' .
$alt . $alt .