update libraries to honour user flags

This commit is contained in:
henderkes
2026-05-11 10:05:33 +07:00
parent 6e3267273b
commit efdd2a74a5
13 changed files with 117 additions and 12 deletions

View File

@@ -72,6 +72,10 @@ class opcache extends PhpExtensionPackage
) {
$opcache_jit = ' --disable-opcache-jit';
}
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
// PHP 8.5+ has opcache built-in
if ($phpVersionID < 80500) {
return '--enable-opcache' . ($shared ? '=shared' : '') . $opcache_jit;
}
return trim($opcache_jit);
}
}

View File

@@ -6,14 +6,27 @@ namespace Package\Extension;
use Package\Target\php;
use StaticPHP\Attribute\Package\BeforeStage;
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Attribute\PatchDescription;
use StaticPHP\Package\PackageInstaller;
use StaticPHP\Package\PhpExtensionPackage;
use StaticPHP\Util\FileSystem;
#[Extension('spx')]
class spx extends PhpExtensionPackage
{
#[CustomPhpConfigureArg('Linux')]
#[CustomPhpConfigureArg('Darwin')]
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
{
$arg = '--enable-SPX' . ($shared ? '=shared' : '');
if ($installer->getLibraryPackage('zlib') !== null) {
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
}
return $arg;
}
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-spx')]
#[PatchDescription('Fix spx extension compile error when building as static')]
public function patchBeforeBuildconf(): bool