Add bzip2 support for imagick

This commit is contained in:
crazywhalecc 2025-03-30 14:02:44 +08:00
parent 936413a6d9
commit 6ea1d06460
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 4 additions and 3 deletions

View File

@ -210,12 +210,12 @@
"libwebp", "libwebp",
"freetype", "freetype",
"libtiff", "libtiff",
"libheif" "libheif",
"bzip2"
], ],
"lib-suggests": [ "lib-suggests": [
"zstd", "zstd",
"xz", "xz",
"bzip2",
"libzip", "libzip",
"libxml2" "libxml2"
] ]

View File

@ -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 --disable-openmp --without-bzlib '; $extra = '--without-jxl --without-x --disable-openmp ';
$required_libs = ''; $required_libs = '';
$optional_libs = [ $optional_libs = [
'libzip' => 'zip', 'libzip' => 'zip',
@ -31,6 +31,7 @@ trait imagemagick
'xz' => 'lzma', 'xz' => 'lzma',
'zstd' => 'zstd', 'zstd' => 'zstd',
'freetype' => 'freetype', 'freetype' => 'freetype',
'bzip2' => 'bzlib',
]; ];
foreach ($optional_libs as $lib => $option) { foreach ($optional_libs as $lib => $option) {
$extra .= $this->builder->getLib($lib) ? "--with-{$option} " : "--without-{$option} "; $extra .= $this->builder->getLib($lib) ? "--with-{$option} " : "--without-{$option} ";