Compare commits

...

1 Commits

Author SHA1 Message Date
Marc
ca3daad350 Revert "fix libheif" 2026-05-22 16:25:09 +07:00

View File

@@ -11,28 +11,15 @@ trait libheif
{ {
public function patchBeforeBuild(): bool public function patchBeforeBuild(): bool
{ {
$patched = false;
if (!str_contains(file_get_contents($this->source_dir . '/CMakeLists.txt'), 'libbrotlienc')) { if (!str_contains(file_get_contents($this->source_dir . '/CMakeLists.txt'), 'libbrotlienc')) {
FileSystem::replaceFileStr( FileSystem::replaceFileStr(
$this->source_dir . '/CMakeLists.txt', $this->source_dir . '/CMakeLists.txt',
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")', 'list(APPEND REQUIRES_PRIVATE "libbrotlidec")',
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc")' 'list(APPEND REQUIRES_PRIVATE "libbrotlidec")' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc")'
); );
$patched = true; return true;
} }
// libheif 1.22+ ships a C-incompatible header: `struct heif_bad_pixel` return false;
$heif_properties = $this->source_dir . '/libheif/api/libheif/heif_properties.h';
if (file_exists($heif_properties)
&& str_contains(file_get_contents($heif_properties), 'struct heif_bad_pixel { uint32_t row; uint32_t column; };')
) {
FileSystem::replaceFileStr(
$heif_properties,
'struct heif_bad_pixel { uint32_t row; uint32_t column; };',
'typedef struct heif_bad_pixel { uint32_t row; uint32_t column; } heif_bad_pixel;'
);
$patched = true;
}
return $patched;
} }
protected function build(): void protected function build(): void