Add ext-xlswriter

This commit is contained in:
crazywhalecc 2026-03-17 15:13:59 +08:00
parent 5d309ee998
commit 154adc1f48
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,18 @@
ext-xlswriter:
type: php-extension
artifact:
source:
type: pecl
name: xlswriter
metadata:
license-files: [LICENSE]
license: BSD-2-Clause
depends:
- ext-zlib
- ext-zip
suggests:
- openssl
php-extension:
support:
BSD: wip
arg-type: custom

View File

@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace Package\Extension;
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Package\PackageInstaller;
use StaticPHP\Package\PhpExtensionPackage;
#[Extension('xlswriter')]
class xlswriter extends PhpExtensionPackage
{
#[CustomPhpConfigureArg('Darwin')]
#[CustomPhpConfigureArg('Linux')]
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
{
$arg = '--with-xlswriter --enable-reader';
if ($installer->getLibraryPackage('openssl')) {
$arg .= ' --with-openssl=' . $installer->getLibraryPackage('openssl')->getBuildRootPath();
}
return $arg;
}
}