2024-03-01 19:19:47 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
2025-07-18 13:51:33 +07:00
|
|
|
use SPC\store\FileSystem;
|
2025-06-09 19:32:31 +08:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
2024-03-01 19:19:47 +08:00
|
|
|
|
|
|
|
|
trait libtiff
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2025-07-18 13:51:33 +07:00
|
|
|
FileSystem::replaceFileStr($this->source_dir . '/configure', '-lwebp', '-lwebp -lsharpyuv');
|
2025-06-09 19:32:31 +08:00
|
|
|
UnixAutoconfExecutor::create($this)
|
|
|
|
|
->configure(
|
|
|
|
|
// zlib deps
|
|
|
|
|
'--enable-zlib',
|
|
|
|
|
"--with-zlib-include-dir={$this->getIncludeDir()}",
|
|
|
|
|
"--with-zlib-lib-dir={$this->getLibDir()}",
|
|
|
|
|
// libjpeg deps
|
|
|
|
|
'--enable-jpeg',
|
|
|
|
|
"--with-jpeg-include-dir={$this->getIncludeDir()}",
|
|
|
|
|
"--with-jpeg-lib-dir={$this->getLibDir()}",
|
2025-07-18 13:51:33 +07:00
|
|
|
'--disable-old-jpeg',
|
|
|
|
|
'--disable-jpeg12',
|
2025-06-09 19:32:31 +08:00
|
|
|
'--disable-libdeflate',
|
|
|
|
|
'--disable-cxx',
|
2025-07-18 13:51:33 +07:00
|
|
|
'--without-x',
|
2025-06-09 14:38:45 +07:00
|
|
|
)
|
2025-07-18 13:51:33 +07:00
|
|
|
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
|
|
|
|
|
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
|
|
|
|
|
->optionalLib('webp', '--enable-webp', '--disable-webp')
|
|
|
|
|
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
|
2025-07-18 14:04:55 +07:00
|
|
|
->optionalLib('jbig', '--enable-jbig', '--disable-jbig')
|
2025-06-09 19:32:31 +08:00
|
|
|
->make();
|
2024-03-01 19:19:47 +08:00
|
|
|
$this->patchPkgconfPrefix(['libtiff-4.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|