[mixed] refactor with putenv, fix imagemagick and c++ build

This commit is contained in:
crazywhalecc
2023-10-23 00:37:28 +08:00
parent 5934e5e881
commit c84eb723ec
52 changed files with 205 additions and 168 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\builder\linux\LinuxBuilder;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
@@ -17,7 +18,8 @@ trait imagemagick
*/
protected function build(): void
{
$extra = '--without-jxl --without-x --disable-openmp ';
// TODO: imagemagick build with bzip2 failed with bugs, we need to fix it in the future
$extra = '--without-jxl --without-x --disable-openmp --without-bzlib ';
$required_libs = '';
$optional_libs = [
'libzip' => 'zip',
@@ -26,6 +28,7 @@ trait imagemagick
'libwebp' => 'webp',
'libxml2' => 'xml',
'zlib' => 'zlib',
'xz' => 'lzma',
'zstd' => 'zstd',
'freetype' => 'freetype',
];
@@ -38,8 +41,7 @@ trait imagemagick
shell()->cd($this->source_dir)
->exec(
"{$this->builder->configure_env} " .
'LDFLAGS="-static" ' .
($this->builder instanceof LinuxBuilder ? ('LDFLAGS="-static -L' . BUILD_LIB_PATH . '" ') : '') .
"LIBS='{$required_libs}' " .
'./configure ' .
'--enable-static --disable-shared ' .