This commit is contained in:
crazywhalecc
2026-03-08 16:32:31 +08:00
parent ad0118718f
commit a9e6e4a226
2 changed files with 34 additions and 0 deletions

View File

@@ -20,6 +20,12 @@ ext-curl:
- ext-openssl
php-extension:
arg-type: with
ext-dba:
type: php-extension
suggests:
- qdbm
php-extension:
arg-type: custom
ext-mbregex:
type: php-extension
depends:

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Package\Extension;
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Package\PackageInstaller;
#[Extension('dba')]
class dba
{
#[CustomPhpConfigureArg('Darwin')]
#[CustomPhpConfigureArg('Linux')]
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
{
$qdbm = ($qdbm = $installer->getLibraryPackage('qdbm')) ? (" --with-qdbm={$qdbm->getBuildRootPath()}") : '';
return '--enable-dba' . ($shared ? '=shared' : '') . $qdbm;
}
#[CustomPhpConfigureArg('Windows')]
public function getWindowsConfigureArg(PackageInstaller $installer): string
{
$qdbm = $installer->getLibraryPackage('qdbm') ? ' --with-qdbm' : '';
return '--with-dba' . $qdbm;
}
}