mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 18:35:35 +08:00
Remove openmp support for imagemagick
This commit is contained in:
@@ -5,23 +5,11 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\builder\linux\LinuxBuilder;
|
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('imagick')]
|
#[CustomExt('imagick')]
|
||||||
class imagick extends Extension
|
class imagick extends Extension
|
||||||
{
|
{
|
||||||
public function patchBeforeMake(): bool
|
|
||||||
{
|
|
||||||
// imagick may call omp_pause_all which requires -lgomp
|
|
||||||
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
|
||||||
if ($this->builder instanceof LinuxBuilder) {
|
|
||||||
$extra_libs .= (empty($extra_libs) ? '' : ' ') . '-lgomp ';
|
|
||||||
}
|
|
||||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(): string
|
||||||
{
|
{
|
||||||
return '--with-imagick=' . BUILD_ROOT_PATH;
|
return '--with-imagick=' . BUILD_ROOT_PATH;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ trait imagemagick
|
|||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
// TODO: imagemagick build with bzip2 failed with bugs, we need to fix it in the future
|
// TODO: imagemagick build with bzip2 failed with bugs, we need to fix it in the future
|
||||||
$extra = '--without-jxl --without-x --enable-openmp --without-bzlib ';
|
$extra = '--without-jxl --without-x --disable-openmp --without-bzlib ';
|
||||||
$required_libs = '';
|
$required_libs = '';
|
||||||
$optional_libs = [
|
$optional_libs = [
|
||||||
'libzip' => 'zip',
|
'libzip' => 'zip',
|
||||||
|
|||||||
@@ -90,10 +90,6 @@ class SPCConfigUtil
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// patch: imagick (imagemagick wrapper) for linux needs -lgomp
|
|
||||||
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux') {
|
|
||||||
$short_name[] = '-lgomp';
|
|
||||||
}
|
|
||||||
return implode(' ', $short_name);
|
return implode(' ', $short_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ $test_os = [
|
|||||||
// 'macos-13',
|
// 'macos-13',
|
||||||
// 'macos-14',
|
// 'macos-14',
|
||||||
'ubuntu-latest',
|
'ubuntu-latest',
|
||||||
'windows-latest',
|
// 'windows-latest',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
@@ -40,7 +40,7 @@ $prefer_pre_built = false;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'pgsql,pdo_pgsql',
|
'Linux', 'Darwin' => 'imagick',
|
||||||
'Windows' => 'pgsql,pdo_pgsql',
|
'Windows' => 'pgsql,pdo_pgsql',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user