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-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-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',
|
|
|
|
|
'--disable-old-jpeg',
|
|
|
|
|
'--disable-jpeg12',
|
|
|
|
|
"--with-jpeg-include-dir={$this->getIncludeDir()}",
|
|
|
|
|
"--with-jpeg-lib-dir={$this->getLibDir()}",
|
|
|
|
|
// We disabled lzma, zstd, webp, libdeflate by default to reduce the size of the binary
|
|
|
|
|
'--disable-lzma',
|
|
|
|
|
'--disable-zstd',
|
|
|
|
|
'--disable-webp',
|
|
|
|
|
'--disable-libdeflate',
|
|
|
|
|
'--disable-cxx',
|
2025-06-09 14:38:45 +07:00
|
|
|
)
|
2025-06-09 19:32:31 +08:00
|
|
|
->make();
|
2024-03-01 19:19:47 +08:00
|
|
|
$this->patchPkgconfPrefix(['libtiff-4.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|