Skip to content

Commit

Permalink
Add aom patch for alpine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywhalecc committed Dec 20, 2024
1 parent adbe2e8 commit 0712f76
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SPC/store/SourcePatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use SPC\builder\BuilderBase;
use SPC\builder\linux\LinuxBuilder;
use SPC\builder\linux\SystemUtil;
use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
Expand All @@ -27,6 +28,7 @@ public static function init(): void
FileSystem::addSourceExtractHook('libyaml', [SourcePatcher::class, 'patchLibYaml']);
FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchImapLicense']);
FileSystem::addSourceExtractHook('ext-imagick', [SourcePatcher::class, 'patchImagickWith84']);
FileSystem::addSourceExtractHook('libaom', [SourcePatcher::class, 'patchLibaomForAlpine']);
}

/**
Expand Down Expand Up @@ -393,6 +395,15 @@ public static function patchImagickWith84(): bool
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.
*
Expand Down
13 changes: 13 additions & 0 deletions src/globals/patch/libaom_posix_implict.patch
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 0712f76

Please sign in to comment.