35 lines
1.3 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
{
shell()->cd($this->source_dir)
->exec(
$this->builder->configure_env . ' ' .
'CC="musl-gcc -I' . BUILD_INCLUDE_PATH . '" ' .
'LDFLAGS="-static -L' . BUILD_LIB_PATH . '" ' .
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? 'LIBS="-lssl -lcrypto -lz" ' : '') .
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 ' .
($this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '') .
($this->builder->getLib('gmp') ? '--with-mp=gmp ' : '') .
($this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '') .
2023-09-18 13:43:58 +02:00
'--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']);
}
}