Skip to content

Commit d35cbd7

Browse files
authored
Add Windows builders for libaom and brotli (#1072)
2 parents c03508a + d076df6 commit d35cbd7

File tree

6 files changed

+86
-6
lines changed

6 files changed

+86
-6
lines changed

config/lib.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@
143143
"zlib"
144144
],
145145
"lib-suggests": [
146-
"libpng",
147-
"bzip2",
148-
"brotli"
146+
"libpng"
149147
]
150148
},
151149
"gettext": {
@@ -355,6 +353,9 @@
355353
"static-libs-unix": [
356354
"libaom.a"
357355
],
356+
"static-libs-windows": [
357+
"aom.lib"
358+
],
358359
"cpp-library": true
359360
},
360361
"libargon2": {

src/SPC/ConsoleApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
final class ConsoleApplication extends Application
3636
{
37-
public const string VERSION = '2.8.3';
37+
public const string VERSION = '2.8.4';
3838

3939
public function __construct()
4040
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ protected function build(): void
1313
{
1414
$cmake = UnixCMakeExecutor::create($this)
1515
->optionalLib('libpng', ...cmake_boolean_args('FT_DISABLE_PNG', true))
16-
->optionalLib('bzip2', ...cmake_boolean_args('FT_DISABLE_BZIP2', true))
17-
->optionalLib('brotli', ...cmake_boolean_args('FT_DISABLE_BROTLI', true))
16+
->addConfigureArgs('-DFT_DISABLE_BZIP2=ON')
17+
->addConfigureArgs('-DFT_DISABLE_BROTLI=ON')
1818
->addConfigureArgs('-DFT_DISABLE_HARFBUZZ=ON');
1919

2020
// fix cmake 4.0 compatibility
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\windows\library;
6+
7+
use SPC\store\FileSystem;
8+
9+
class brotli extends WindowsLibraryBase
10+
{
11+
public const NAME = 'brotli';
12+
13+
protected function build(): void
14+
{
15+
// reset cmake
16+
FileSystem::resetDir($this->source_dir . '\build');
17+
18+
// start build
19+
cmd()->cd($this->source_dir)
20+
->execWithWrapper(
21+
$this->builder->makeSimpleWrapper('cmake'),
22+
'-B build ' .
23+
'-A x64 ' .
24+
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
25+
'-DCMAKE_BUILD_TYPE=Release ' .
26+
'-DBUILD_SHARED_LIBS=OFF ' .
27+
'-DBROTLI_BUILD_TOOLS=OFF ' .
28+
'-DBROTLI_BUNDLED_MODE=OFF ' .
29+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
30+
)
31+
->execWithWrapper(
32+
$this->builder->makeSimpleWrapper('cmake'),
33+
"--build build --config Release --target install -j{$this->builder->concurrency}"
34+
);
35+
}
36+
}

src/SPC/builder/windows/library/freetype.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ protected function build(): void
2424
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
2525
'-DCMAKE_BUILD_TYPE=Release ' .
2626
'-DBUILD_SHARED_LIBS=OFF ' .
27+
'-DFT_DISABLE_BROTLI=TRUE ' .
28+
'-DFT_DISABLE_BZIP2=TRUE ' .
2729
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
2830
)
2931
->execWithWrapper(
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\windows\library;
6+
7+
use SPC\store\FileSystem;
8+
9+
class libaom extends WindowsLibraryBase
10+
{
11+
public const NAME = 'libaom';
12+
13+
protected function build(): void
14+
{
15+
// libaom source tree contains a build/cmake/ directory with its own
16+
// cmake modules, so we must use a different name for the build dir.
17+
FileSystem::resetDir($this->source_dir . '\builddir');
18+
19+
// start build
20+
cmd()->cd($this->source_dir)
21+
->execWithWrapper(
22+
$this->builder->makeSimpleWrapper('cmake'),
23+
'-S . -B builddir ' .
24+
'-A x64 ' .
25+
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
26+
'-DCMAKE_BUILD_TYPE=Release ' .
27+
'-DBUILD_SHARED_LIBS=OFF ' .
28+
'-DAOM_TARGET_CPU=generic ' .
29+
'-DENABLE_DOCS=OFF ' .
30+
'-DENABLE_EXAMPLES=OFF ' .
31+
'-DENABLE_TESTDATA=OFF ' .
32+
'-DENABLE_TESTS=OFF ' .
33+
'-DENABLE_TOOLS=OFF ' .
34+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
35+
)
36+
->execWithWrapper(
37+
$this->builder->makeSimpleWrapper('cmake'),
38+
"--build builddir --config Release --target install -j{$this->builder->concurrency}"
39+
);
40+
}
41+
}

0 commit comments

Comments
 (0)