This commit is contained in:
DubbleClick 2025-07-18 13:51:33 +07:00
parent c364970e05
commit 5c44703f53
6 changed files with 75 additions and 6 deletions

View File

@ -265,6 +265,13 @@
"libsodium"
]
},
"lerc": {
"source": "lerc",
"static-libs-unix": [
"libLerc.a"
],
"cpp-library": true
},
"libacl": {
"source": "libacl",
"static-libs-unix": [
@ -498,6 +505,9 @@
"lib-depends": [
"zlib",
"libjpeg"
],
"lib-suggests-unix": [
"lerc"
]
},
"libuuid": {

View File

@ -466,6 +466,16 @@
"path": "COPYING"
}
},
"lerc": {
"type": "ghtar",
"repo": "Esri/lerc",
"prefer-stable": true,
"provide-pre-built": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libevent": {
"type": "ghrel",
"repo": "libevent/libevent",

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class lerc extends LinuxLibraryBase
{
use \SPC\builder\unix\library\lerc;
public const NAME = 'lerc';
}

View File

@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class lerc extends MacOSLibraryBase
{
use \SPC\builder\unix\library\lerc;
public const NAME = 'lerc';
}

View File

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\util\executor\UnixCMakeExecutor;
trait lerc
{
/**
* @throws FileSystemException
* @throws RuntimeException
*/
protected function build(): void
{
UnixCMakeExecutor::create($this)
->build();
}
}

View File

@ -6,6 +6,7 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixAutoconfExecutor;
trait libtiff
@ -16,6 +17,7 @@ trait libtiff
*/
protected function build(): void
{
FileSystem::replaceFileStr($this->source_dir . '/configure', '-lwebp', '-lwebp -lsharpyuv');
UnixAutoconfExecutor::create($this)
->configure(
// zlib deps
@ -24,17 +26,18 @@ trait libtiff
"--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-old-jpeg',
'--disable-jpeg12',
'--disable-libdeflate',
'--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')
->make();
$this->patchPkgconfPrefix(['libtiff-4.pc']);
}