Skip to content

Commit 5586f62

Browse files
committed
add lerc
1 parent 9af3b74 commit 5586f62

File tree

6 files changed

+75
-6
lines changed

6 files changed

+75
-6
lines changed

config/lib.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,13 @@
265265
"libsodium"
266266
]
267267
},
268+
"lerc": {
269+
"source": "lerc",
270+
"static-libs-unix": [
271+
"libLerc.a"
272+
],
273+
"cpp-library": true
274+
},
268275
"libacl": {
269276
"source": "libacl",
270277
"static-libs-unix": [
@@ -498,6 +505,9 @@
498505
"lib-depends": [
499506
"zlib",
500507
"libjpeg"
508+
],
509+
"lib-suggests-unix": [
510+
"lerc"
501511
]
502512
},
503513
"libuuid": {

config/source.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,16 @@
465465
"path": "COPYING"
466466
}
467467
},
468+
"lerc": {
469+
"type": "ghtar",
470+
"repo": "Esri/lerc",
471+
"prefer-stable": true,
472+
"provide-pre-built": true,
473+
"license": {
474+
"type": "file",
475+
"path": "LICENSE"
476+
}
477+
},
468478
"libevent": {
469479
"type": "ghrel",
470480
"repo": "libevent/libevent",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\linux\library;
6+
7+
class lerc extends LinuxLibraryBase
8+
{
9+
use \SPC\builder\unix\library\lerc;
10+
11+
public const NAME = 'lerc';
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\macos\library;
6+
7+
class lerc extends MacOSLibraryBase
8+
{
9+
use \SPC\builder\unix\library\lerc;
10+
11+
public const NAME = 'lerc';
12+
}

src/SPC/builder/unix/library/lerc.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\unix\library;
6+
7+
use SPC\exception\FileSystemException;
8+
use SPC\exception\RuntimeException;
9+
use SPC\util\executor\UnixCMakeExecutor;
10+
11+
trait lerc
12+
{
13+
/**
14+
* @throws FileSystemException
15+
* @throws RuntimeException
16+
*/
17+
protected function build(): void
18+
{
19+
UnixCMakeExecutor::create($this)
20+
->build();
21+
}
22+
}

src/SPC/builder/unix/library/libtiff.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use SPC\exception\FileSystemException;
88
use SPC\exception\RuntimeException;
9+
use SPC\store\FileSystem;
910
use SPC\util\executor\UnixAutoconfExecutor;
1011

1112
trait libtiff
@@ -16,6 +17,7 @@ trait libtiff
1617
*/
1718
protected function build(): void
1819
{
20+
FileSystem::replaceFileStr($this->source_dir . '/configure', '-lwebp', '-lwebp -lsharpyuv');
1921
UnixAutoconfExecutor::create($this)
2022
->configure(
2123
// zlib deps
@@ -24,17 +26,18 @@ protected function build(): void
2426
"--with-zlib-lib-dir={$this->getLibDir()}",
2527
// libjpeg deps
2628
'--enable-jpeg',
27-
'--disable-old-jpeg',
28-
'--disable-jpeg12',
2929
"--with-jpeg-include-dir={$this->getIncludeDir()}",
3030
"--with-jpeg-lib-dir={$this->getLibDir()}",
31-
// We disabled lzma, zstd, webp, libdeflate by default to reduce the size of the binary
32-
'--disable-lzma',
33-
'--disable-zstd',
34-
'--disable-webp',
31+
'--disable-old-jpeg',
32+
'--disable-jpeg12',
3533
'--disable-libdeflate',
3634
'--disable-cxx',
35+
'--without-x',
3736
)
37+
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
38+
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
39+
->optionalLib('webp', '--enable-webp', '--disable-webp')
40+
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
3841
->make();
3942
$this->patchPkgconfPrefix(['libtiff-4.pc']);
4043
}

0 commit comments

Comments
 (0)