File tree Expand file tree Collapse file tree
src/SPC/builder/unix/library Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,15 +11,28 @@ trait libheif
1111{
1212 public function patchBeforeBuild (): bool
1313 {
14+ $ patched = false ;
1415 if (!str_contains (file_get_contents ($ this ->source_dir . '/CMakeLists.txt ' ), 'libbrotlienc ' )) {
1516 FileSystem::replaceFileStr (
1617 $ this ->source_dir . '/CMakeLists.txt ' ,
1718 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' ,
1819 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc") '
1920 );
20- return true ;
21+ $ patched = true ;
2122 }
22- return false ;
23+ // libheif 1.22+ ships a C-incompatible header: `struct heif_bad_pixel`
24+ $ heif_properties = $ this ->source_dir . '/libheif/api/libheif/heif_properties.h ' ;
25+ if (file_exists ($ heif_properties )
26+ && str_contains (file_get_contents ($ heif_properties ), 'struct heif_bad_pixel { uint32_t row; uint32_t column; }; ' )
27+ ) {
28+ FileSystem::replaceFileStr (
29+ $ heif_properties ,
30+ 'struct heif_bad_pixel { uint32_t row; uint32_t column; }; ' ,
31+ 'typedef struct heif_bad_pixel { uint32_t row; uint32_t column; } heif_bad_pixel; '
32+ );
33+ $ patched = true ;
34+ }
35+ return $ patched ;
2336 }
2437
2538 protected function build (): void
You can’t perform that action at this time.
0 commit comments