mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add ext-gd
This commit is contained in:
parent
38715bba21
commit
61d50cd28b
@ -51,6 +51,19 @@ ext-ftp:
|
||||
type: php-extension
|
||||
suggests:
|
||||
- ext-openssl
|
||||
ext-gd:
|
||||
type: php-extension
|
||||
depends:
|
||||
- zlib
|
||||
- libpng
|
||||
- ext-zlib
|
||||
suggests:
|
||||
- libavif
|
||||
- libwebp
|
||||
- libjpeg
|
||||
- freetype
|
||||
php-extension:
|
||||
arg-type: custom
|
||||
ext-mbregex:
|
||||
type: php-extension
|
||||
depends:
|
||||
|
||||
26
src/Package/Extension/gd.php
Normal file
26
src/Package/Extension/gd.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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('gd')]
|
||||
class gd extends PhpExtensionPackage
|
||||
{
|
||||
#[CustomPhpConfigureArg('Darwin')]
|
||||
#[CustomPhpConfigureArg('Linux')]
|
||||
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||
{
|
||||
$arg = '--enable-gd' . ($shared ? '=shared' : '');
|
||||
$arg .= $installer->getLibraryPackage('freetype') ? ' --with-freetype' : '';
|
||||
$arg .= $installer->getLibraryPackage('libjpeg') ? ' --with-jpeg' : '';
|
||||
$arg .= $installer->getLibraryPackage('libwebp') ? ' --with-webp' : '';
|
||||
$arg .= $installer->getLibraryPackage('libavif') ? ' --with-avif' : '';
|
||||
return $arg;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user