2023-05-10 02:04:08 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
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-29 23:15:55 +08:00
|
|
|
public function patchBeforeBuildconf(): bool
|
|
|
|
|
{
|
|
|
|
|
// destroy imagick build conf to avoid libgomp build error
|
2025-03-29 23:29:45 +08:00
|
|
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/imagick/config.m4', '#include <omp.h>', '#include <NEVER_INCLUDE_OMP_H>');
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|