Add aom patch for alpine linux (#579)

This commit is contained in:
Jerry Ma 2024-12-20 12:18:34 +08:00 committed by GitHub
parent adbe2e80f3
commit 78aea56de4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View File

@ -6,6 +6,7 @@ namespace SPC\store;
use SPC\builder\BuilderBase; use SPC\builder\BuilderBase;
use SPC\builder\linux\LinuxBuilder; use SPC\builder\linux\LinuxBuilder;
use SPC\builder\linux\SystemUtil;
use SPC\builder\unix\UnixBuilderBase; use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\FileSystemException; use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException; use SPC\exception\RuntimeException;
@ -27,6 +28,7 @@ class SourcePatcher
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']); FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']); FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']); FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
FileSystem::addSourceExtractHook('libaom', [SourcePatcher::class, 'patchLibaomForAlpine']);
} }
/** /**
@ -393,6 +395,15 @@ class SourcePatcher
return true; return true;
} }
public static function patchLibaomForAlpine(): bool
{
if (PHP_OS_FAMILY === 'Linux' && SystemUtil::isMuslDist()) {
SourcePatcher::patchFile('libaom_posix_implict.patch', SOURCE_PATH . '/libaom');
return true;
}
return false;
}
/** /**
* Patch cli SAPI Makefile for Windows. * Patch cli SAPI Makefile for Windows.
* *

View File

@ -0,0 +1,13 @@
https://bugs.gentoo.org/869419
POSIX_C_SOURCE is needed for ftello.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,6 +269,7 @@ add_library(aom_rtcd OBJECT ${AOM_RTCD_SOURCES})
add_dependencies(aom_rtcd aom_version)
if(ENABLE_EXAMPLES)
+ add_definitions(-D_POSIX_C_SOURCE=200112L)
add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES})
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_encoder_stats)
endif()