mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Forward-port #1107
This commit is contained in:
@@ -22,8 +22,14 @@ class decimal extends PhpExtensionPackage
|
|||||||
{
|
{
|
||||||
FileSystem::replaceFileStr(
|
FileSystem::replaceFileStr(
|
||||||
$this->getSourceDir() . '/php_decimal.c',
|
$this->getSourceDir() . '/php_decimal.c',
|
||||||
'zend_module_entry decimal_module_entry',
|
[
|
||||||
'zend_module_entry php_decimal_module_entry'
|
'zend_module_entry decimal_module_entry',
|
||||||
|
'ZEND_GET_MODULE(decimal)',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'zend_module_entry php_decimal_module_entry',
|
||||||
|
'ZEND_GET_MODULE(php_decimal)',
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ use StaticPHP\Package\LibraryPackage;
|
|||||||
use StaticPHP\Package\PackageInstaller;
|
use StaticPHP\Package\PackageInstaller;
|
||||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
use StaticPHP\Runtime\SystemTarget;
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||||
|
use StaticPHP\Toolchain\ZigToolchain;
|
||||||
use StaticPHP\Util\SPCConfigUtil;
|
use StaticPHP\Util\SPCConfigUtil;
|
||||||
|
|
||||||
#[Library('krb5')]
|
#[Library('krb5')]
|
||||||
@@ -17,7 +19,7 @@ class krb5
|
|||||||
{
|
{
|
||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
public function build(LibraryPackage $lib, PackageInstaller $installer): void
|
public function build(LibraryPackage $lib, PackageInstaller $installer, ToolchainInterface $toolchain): void
|
||||||
{
|
{
|
||||||
if (!file_exists($lib->getSourceRoot() . '/configure')) {
|
if (!file_exists($lib->getSourceRoot() . '/configure')) {
|
||||||
shell()->cd($lib->getSourceRoot())->exec('autoreconf -if');
|
shell()->cd($lib->getSourceRoot())->exec('autoreconf -if');
|
||||||
@@ -45,12 +47,15 @@ class krb5
|
|||||||
$extraEnv['LDFLAGS'] = '-framework Kerberos';
|
$extraEnv['LDFLAGS'] = '-framework Kerberos';
|
||||||
$args[] = 'ac_cv_func_secure_getenv=no';
|
$args[] = 'ac_cv_func_secure_getenv=no';
|
||||||
}
|
}
|
||||||
UnixAutoconfExecutor::create($lib)
|
$executor = UnixAutoconfExecutor::create($lib)
|
||||||
->appendEnv($extraEnv)
|
->appendEnv($extraEnv)
|
||||||
->optionalPackage('ldap', '--with-ldap', '--without-ldap')
|
->optionalPackage('ldap', '--with-ldap', '--without-ldap')
|
||||||
->optionalPackage('libedit', '--with-libedit', '--without-libedit')
|
->optionalPackage('libedit', '--with-libedit', '--without-libedit')
|
||||||
->configure(...$args)
|
->configure(...$args);
|
||||||
->make();
|
if ($toolchain instanceof ZigToolchain) {
|
||||||
|
$executor->exec('find . -name Makefile -exec sed -i "s/-Werror=incompatible-pointer-types//g" {} +');
|
||||||
|
}
|
||||||
|
$executor->make();
|
||||||
$lib->patchPkgconfPrefix([
|
$lib->patchPkgconfPrefix([
|
||||||
'krb5-gssapi.pc',
|
'krb5-gssapi.pc',
|
||||||
'krb5.pc',
|
'krb5.pc',
|
||||||
|
|||||||
Reference in New Issue
Block a user