mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
fix libtiff libs being defined after configure
This commit is contained in:
parent
ff092b4e9d
commit
52862a3d63
@ -228,8 +228,9 @@
|
||||
],
|
||||
"lib-depends": [
|
||||
"zlib",
|
||||
"libpng",
|
||||
"libjpeg",
|
||||
"libjxl",
|
||||
"libpng",
|
||||
"libwebp",
|
||||
"freetype",
|
||||
"libtiff",
|
||||
@ -240,8 +241,7 @@
|
||||
"zstd",
|
||||
"xz",
|
||||
"libzip",
|
||||
"libxml2",
|
||||
"libjxl"
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"imap": {
|
||||
@ -424,11 +424,12 @@
|
||||
"source": "libjxl",
|
||||
"static-libs-unix": [
|
||||
"libjxl.a",
|
||||
"libjxl_dec.a"
|
||||
"libjxl_dec.a",
|
||||
"libjxl_threads.a",
|
||||
"libhwy.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"brotli",
|
||||
"libgif",
|
||||
"libjpeg",
|
||||
"libpng",
|
||||
"libwebp"
|
||||
|
||||
@ -390,8 +390,12 @@
|
||||
},
|
||||
"jbig": {
|
||||
"type": "url",
|
||||
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/jbig/jbigkit-2.1.tar.gz",
|
||||
"provide-pre-built": true,
|
||||
"alt": {
|
||||
"type": "url",
|
||||
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
|
||||
},
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
|
||||
@ -4,10 +4,28 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
trait libjxl
|
||||
{
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
$depsContent = file_get_contents($this->source_dir . '/deps.sh');
|
||||
if (str_contains($depsContent, '# return 0')) {
|
||||
return false;
|
||||
}
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/deps.sh',
|
||||
'return 0',
|
||||
'# return 0',
|
||||
);
|
||||
shell()->cd($this->source_dir)
|
||||
->exec('./deps.sh');
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
UnixCMakeExecutor::create($this)
|
||||
@ -17,7 +35,7 @@ trait libjxl
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_BENCHMARK=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_PLUGINS=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_SJPEG=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_STATIC=ON')
|
||||
->addConfigureArgs('-DJPEGXL_STATIC=' . SPCTarget::isStatic() ? 'ON' : 'OFF')
|
||||
->addConfigureArgs('-DBUILD_TESTING=OFF')
|
||||
->build();
|
||||
}
|
||||
|
||||
@ -22,6 +22,11 @@ trait libtiff
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure', '-lwebp', '-lwebp -lsharpyuv');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure', '-l"$lerc_lib_name"', '-l"$lerc_lib_name" ' . $libcpp);
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
|
||||
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
|
||||
->optionalLib('libwebp', '--enable-webp', '--disable-webp')
|
||||
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
|
||||
->optionalLib('jbig', '--enable-jbig', '--disable-jbig')
|
||||
->configure(
|
||||
// zlib deps
|
||||
'--enable-zlib',
|
||||
@ -39,11 +44,6 @@ trait libtiff
|
||||
'--disable-cxx',
|
||||
'--without-x',
|
||||
)
|
||||
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
|
||||
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
|
||||
->optionalLib('webp', '--enable-webp', '--disable-webp')
|
||||
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
|
||||
->optionalLib('jbig', '--enable-jbig', '--disable-jbig')
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['libtiff-4.pc']);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user