add ext-ldap (openldap) support

This commit is contained in:
DubbleClick
2023-09-18 13:43:58 +02:00
committed by Jerry Ma
parent e3a4cd6e1d
commit 059c32e59c
10 changed files with 101 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class ldap extends LinuxLibraryBase
{
use \SPC\builder\unix\library\ldap;
public const NAME = 'ldap';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class ldap extends MacOSLibraryBase
{
use \SPC\builder\unix\library\ldap;
public const NAME = 'ldap';
}

View File

@@ -39,8 +39,8 @@ trait curl
} else {
$extra .= '-DUSE_NGHTTP2=OFF ';
}
// TODO: ldap is not supported yet
$extra .= '-DCURL_DISABLE_LDAP=ON ';
// lib:ldap
$extra .= $this->builder->getLib('ldap') ? '-DCURL_DISABLE_LDAP=OFF ' : '-DCURL_DISABLE_LDAP=ON ';
// lib:zstd
$extra .= $this->builder->getLib('zstd') ? '-DCURL_ZSTD=ON ' : '-DCURL_ZSTD=OFF ';
// lib:idn2

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
trait ldap
{
protected function build(): void
{
shell()->cd($this->source_dir)
->exec(
$this->builder->configure_env . ' ' .
'LDFLAGS="-static"' .
' ./configure ' .
'--enable-static ' .
'--disable-shared ' .
'--disable-slapd ' .
'--without-systemd ' .
($this->builder->getLib('openssl') ? '--with-tls=openssl ' : '') .
'--prefix='
)
->exec('make clean')
->exec('make depend')
->exec("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
}
}

View File

@@ -57,15 +57,14 @@ trait postgresql
'--with-ssl=openssl ' .
'--with-readline ' .
'--with-libxml ' .
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
'--without-ldap ' .
'--without-libxslt ' .
'--without-lz4 ' .
'--without-zstd ' .
'--without-perl ' .
'--without-python ' .
'--without-pam ' .
'--without-ldap ' .
'--without-bonjour ' .
'--without-tcl '
);