43 lines
1.3 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
2025-11-18 17:22:27 +01:00
use SPC\util\SPCConfigUtil;
trait krb5
{
protected function build(): void
{
$this->source_dir .= '/src';
shell()->cd($this->source_dir)->exec('autoreconf -if');
2025-11-18 17:22:27 +01:00
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
UnixAutoconfExecutor::create($this)
2025-11-18 14:35:58 +01:00
->appendEnv([
2025-11-19 10:48:24 +01:00
'CFLAGS' => '-fcommon',
2025-11-18 17:22:27 +01:00
'LIBS' => $config['libs'],
2025-11-18 14:35:58 +01:00
])
->optionalLib('ldap', '--with-ldap', '--without-ldap')
2025-11-18 17:50:49 +01:00
->optionalLib('libedit', '--with-libedit', '--without-libedit')
2025-11-18 14:35:58 +01:00
->configure(
'--disable-nls',
'--disable-rpath',
)
->make();
$this->patchPkgconfPrefix([
'krb5-gssapi.pc',
'krb5.pc',
'kadm-server.pc',
'kadm-client.pc',
'kdb.pc',
'mit-krb5-gssapi.pc',
'mit-krb5.pc',
'gssrpc.pc',
]);
}
}