39 lines
1.4 KiB
PHP
Raw Normal View History

2023-09-18 13:43:58 +02:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
trait ldap
{
protected function build(): void
{
2023-10-01 01:06:11 +08:00
$alt = '';
// openssl support
$alt .= $this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '';
// gmp support
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
// libsodium support
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '';
2023-09-18 13:43:58 +02:00
shell()->cd($this->source_dir)
->exec(
$this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) .
2023-09-18 13:43:58 +02:00
' ./configure ' .
'--enable-static ' .
'--disable-shared ' .
'--disable-slapd ' .
'--disable-slurpd ' .
2023-09-18 13:43:58 +02:00
'--without-systemd ' .
'--without-cyrus-sasl ' .
2023-10-01 01:06:11 +08:00
$alt .
2023-09-18 13:43:58 +02:00
'--prefix='
)
->exec('make clean')
// remove tests and doc to prevent compile failed with error: soelim not found
->exec('sed -i -e "s/SUBDIRS= include libraries clients servers tests doc/SUBDIRS= include libraries clients servers/g" Makefile')
2023-09-18 13:43:58 +02:00
->exec("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
}
}