Skip to content

Commit 0712f76

Browse files
committed
Add aom patch for alpine linux
1 parent adbe2e8 commit 0712f76

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/SPC/store/SourcePatcher.php

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

77
use SPC\builder\BuilderBase;
88
use SPC\builder\linux\LinuxBuilder;
9+
use SPC\builder\linux\SystemUtil;
910
use SPC\builder\unix\UnixBuilderBase;
1011
use SPC\exception\FileSystemException;
1112
use SPC\exception\RuntimeException;
@@ -27,6 +28,7 @@ public static function init(): void
2728
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
2829
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
2930
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
31+
FileSystem::addSourceExtractHook('libaom', [SourcePatcher::class, 'patchLibaomForAlpine']);
3032
}
3133

3234
/**
@@ -393,6 +395,15 @@ public static function patchImagickWith84(): bool
393395
return true;
394396
}
395397

398+
public static function patchLibaomForAlpine(): bool
399+
{
400+
if (PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist()) {
401+
SourcePatcher::patchFile('libaom_posix_implict.patch', SOURCE_PATH . '/libaom');
402+
return true;
403+
}
404+
return false;
405+
}
406+
396407
/**
397408
* Patch cli SAPI Makefile for Windows.
398409
*
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
https://bugs.gentoo.org/869419
2+
3+
POSIX_C_SOURCE is needed for ftello.
4+
--- a/CMakeLists.txt
5+
+++ b/CMakeLists.txt
6+
@@ -269,6 +269,7 @@ add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES})
7+
add_dependencies(aom_rtcd aom_version)
8+
9+
if(ENABLE_EXAMPLES)
10+
+ add_definitions(-D_POSIX_C_SOURCE=200112L)
11+
add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES})
12+
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_encoder_stats)
13+
endif()

0 commit comments

Comments
 (0)