2023-05-10 02:04:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
2025-03-30 14:01:31 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
2025-03-29 23:15:55 +08:00
|
|
|
use SPC\store\FileSystem;
|
2023-05-10 02:04:08 +08:00
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('imagick')]
|
|
|
|
|
class imagick extends Extension
|
|
|
|
|
{
|
2025-03-30 14:01:31 +08:00
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
*/
|
|
|
|
|
public function patchBeforeMake(): bool
|
2025-03-29 23:15:55 +08:00
|
|
|
{
|
2025-03-30 14:01:31 +08:00
|
|
|
// replace php_config.h HAVE_OMP_PAUSE_RESOURCE_ALL line to #define HAVE_OMP_PAUSE_RESOURCE_ALL 0
|
|
|
|
|
FileSystem::replaceFileLineContainsString(SOURCE_PATH . '/php-src/main/php_config.h', 'HAVE_OMP_PAUSE_RESOURCE_ALL', '#define HAVE_OMP_PAUSE_RESOURCE_ALL 0');
|
2025-03-29 23:15:55 +08:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 02:04:08 +08:00
|
|
|
public function getUnixConfigureArg(): string
|
|
|
|
|
{
|
|
|
|
|
return '--with-imagick=' . BUILD_ROOT_PATH;
|
|
|
|
|
}
|
|
|
|
|
}
|