mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
26 lines
663 B
PHP
26 lines
663 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\extension;
|
||
|
|
|
||
|
|
use SPC\builder\Extension;
|
||
|
|
use SPC\builder\macos\MacOSBuilder;
|
||
|
|
use SPC\exception\FileSystemException;
|
||
|
|
use SPC\store\FileSystem;
|
||
|
|
use SPC\util\CustomExt;
|
||
|
|
|
||
|
|
#[CustomExt('bz2')]
|
||
|
|
class bz2 extends Extension
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @throws FileSystemException
|
||
|
|
*/
|
||
|
|
public function patchBeforeConfigure(): bool
|
||
|
|
{
|
||
|
|
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
|
||
|
|
FileSystem::replaceFile(SOURCE_PATH . '/php-src/configure', REPLACE_FILE_PREG, '/-lbz2/', $this->getLibFilesString() . $frameworks);
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|