Skip to content

Commit 0aa28f1

Browse files
committed
Add libaom, libde265, libheif support, for imagick AVIF format support
1 parent d4ec366 commit 0aa28f1

File tree

14 files changed

+284
-31
lines changed

14 files changed

+284
-31
lines changed

config/ext.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,19 @@
560560
"source": "rar",
561561
"cpp-extension": true
562562
},
563+
"rdkafka": {
564+
"support": {
565+
"BSD": "wip",
566+
"Windows": "wip"
567+
},
568+
"type": "external",
569+
"source": "ext-rdkafka",
570+
"arg-type": "custom",
571+
"cpp-extension": true,
572+
"lib-depends": [
573+
"librdkafka"
574+
]
575+
},
563576
"readline": {
564577
"support": {
565578
"Windows": "wip",
@@ -708,19 +721,6 @@
708721
"zlib"
709722
]
710723
},
711-
"rdkafka": {
712-
"support": {
713-
"BSD": "wip",
714-
"Windows": "wip"
715-
},
716-
"type": "external",
717-
"source": "ext-rdkafka",
718-
"arg-type": "custom",
719-
"cpp-extension": true,
720-
"lib-depends": [
721-
"librdkafka"
722-
]
723-
},
724724
"swoole": {
725725
"support": {
726726
"Windows": "no",

config/lib.json

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@
176176
"libjpeg",
177177
"libwebp",
178178
"freetype",
179-
"libtiff"
179+
"libtiff",
180+
"libheif"
180181
],
181182
"lib-suggests": [
182183
"zstd",
@@ -208,6 +209,13 @@
208209
"libsodium"
209210
]
210211
},
212+
"libaom": {
213+
"source": "libaom",
214+
"static-libs-unix": [
215+
"libaom.a"
216+
],
217+
"cpp-library": true
218+
},
211219
"libargon2": {
212220
"source": "libargon2",
213221
"static-libs-unix": [
@@ -235,6 +243,13 @@
235243
"ares_rules.h"
236244
]
237245
},
246+
"libde265": {
247+
"source": "libde265",
248+
"static-libs-unix": [
249+
"libde265.a"
250+
],
251+
"cpp-library": true
252+
},
238253
"libevent": {
239254
"source": "libevent",
240255
"static-libs-unix": [
@@ -276,6 +291,17 @@
276291
"fficonfig.h"
277292
]
278293
},
294+
"libheif": {
295+
"source": "libheif",
296+
"static-libs-unix": [
297+
"libheif.a"
298+
],
299+
"lib-depends": [
300+
"libde265",
301+
"libwebp",
302+
"libaom"
303+
]
304+
},
279305
"libiconv": {
280306
"source": "libiconv",
281307
"static-libs-unix": [
@@ -355,6 +381,18 @@
355381
"openssl"
356382
]
357383
},
384+
"librdkafka": {
385+
"source": "librdkafka",
386+
"static-libs-unix": [
387+
"librdkafka.a",
388+
"librdkafka++.a",
389+
"librdkafka-static.a"
390+
],
391+
"cpp-library": true,
392+
"lib-suggests": [
393+
"zstd"
394+
]
395+
},
358396
"libsodium": {
359397
"source": "libsodium",
360398
"static-libs-unix": [
@@ -558,18 +596,6 @@
558596
"pkg-config": {
559597
"source": "pkg-config"
560598
},
561-
"librdkafka": {
562-
"source": "librdkafka",
563-
"static-libs-unix": [
564-
"librdkafka.a",
565-
"librdkafka++.a",
566-
"librdkafka-static.a"
567-
],
568-
"cpp-library": true,
569-
"lib-suggests": [
570-
"zstd"
571-
]
572-
},
573599
"postgresql": {
574600
"source": "postgresql",
575601
"static-libs-unix": [

config/source.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@
303303
"path": "LICENSE"
304304
}
305305
},
306+
"libaom": {
307+
"type": "git",
308+
"rev": "main",
309+
"url": "https://aomedia.googlesource.com/aom",
310+
"provide-pre-built": true,
311+
"license": {
312+
"type": "file",
313+
"path": "LICENSE"
314+
}
315+
},
306316
"libargon2": {
307317
"type": "git",
308318
"rev": "master",
@@ -338,6 +348,17 @@
338348
"path": "LICENSE.md"
339349
}
340350
},
351+
"libde265": {
352+
"type": "ghrel",
353+
"repo": "strukturag/libde265",
354+
"match": "libde265-.+\\.tar\\.gz",
355+
"prefer-stable": true,
356+
"provide-pre-built": true,
357+
"license": {
358+
"type": "file",
359+
"path": "COPYING"
360+
}
361+
},
341362
"libevent": {
342363
"type": "ghrel",
343364
"repo": "libevent/libevent",
@@ -368,6 +389,17 @@
368389
"path": "LICENSE"
369390
}
370391
},
392+
"libheif": {
393+
"type": "ghrel",
394+
"repo": "strukturag/libheif",
395+
"match": "libheif-.+\\.tar\\.gz",
396+
"prefer-stable": true,
397+
"provide-pre-built": true,
398+
"license": {
399+
"type": "file",
400+
"path": "COPYING"
401+
}
402+
},
371403
"libiconv": {
372404
"type": "filelist",
373405
"url": "https://ftp.gnu.org/gnu/libiconv/",
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 libaom extends LinuxLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libaom;
10+
11+
public const NAME = 'libaom';
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\linux\library;
6+
7+
class libde265 extends LinuxLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libde265;
10+
11+
public const NAME = 'libde265';
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\linux\library;
6+
7+
class libheif extends LinuxLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libheif;
10+
11+
public const NAME = 'libheif';
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 libaom extends MacOSLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libaom;
10+
11+
public const NAME = 'libaom';
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 libde265 extends MacOSLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libde265;
10+
11+
public const NAME = 'libde265';
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 libheif extends MacOSLibraryBase
8+
{
9+
use \SPC\builder\unix\library\libheif;
10+
11+
public const NAME = 'libheif';
12+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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\store\FileSystem;
10+
11+
trait libaom
12+
{
13+
/**
14+
* @throws RuntimeException
15+
* @throws FileSystemException
16+
*/
17+
protected function build(): void
18+
{
19+
// CMake needs a clean build directory
20+
FileSystem::resetDir($this->source_dir . '/builddir');
21+
// Start build
22+
shell()->cd($this->source_dir . '/builddir')
23+
->exec(
24+
'cmake ' .
25+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
26+
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
27+
'-DCMAKE_BUILD_TYPE=Release ' .
28+
'-DBUILD_SHARED_LIBS=OFF ' .
29+
'..'
30+
)
31+
->exec("cmake --build . -j {$this->builder->concurrency}")
32+
->exec('make install');
33+
$this->patchPkgconfPrefix(['aom.pc']);
34+
}
35+
}

0 commit comments

Comments
 (0)