File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 44
55namespace SPC \builder \macos \library ;
66
7+ use SPC \store \FileSystem ;
8+
79class libheif extends MacOSLibraryBase
810{
911 use \SPC \builder \unix \library \libheif;
1012
1113 public const NAME = 'libheif ' ;
14+
15+ public function patchBeforeBuild (): bool
16+ {
17+ if (!str_contains (file_get_contents ($ this ->source_dir . '/CMakeLists.txt ' ), 'libbrotlienc ' )) {
18+ FileSystem::replaceFileStr (
19+ $ this ->source_dir . '/CMakeLists.txt ' ,
20+ 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' ,
21+ 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc") '
22+ );
23+ return true ;
24+ }
25+ return false ;
26+ }
1227}
Original file line number Diff line number Diff line change 44
55namespace SPC \builder \unix \library ;
66
7- use SPC \builder \macos \MacOSBuilder ;
87use SPC \exception \FileSystemException ;
98use SPC \exception \RuntimeException ;
109use SPC \store \FileSystem ;
1110
1211trait libheif
1312{
14- public function patchBeforeBuild (): bool
15- {
16- if ($ this ->builder instanceof MacOSBuilder && !str_contains (file_get_contents ($ this ->source_dir . '/CMakeLists.txt ' ), 'libbrotlienc ' )) {
17- FileSystem::replaceFileStr (
18- $ this ->source_dir . '/CMakeLists.txt ' ,
19- 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' ,
20- 'list(APPEND REQUIRES_PRIVATE "libbrotlidec") ' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc") '
21- );
22- return true ;
23- }
24- return false ;
25- }
2613 /**
2714 * @throws RuntimeException
2815 * @throws FileSystemException
You can’t perform that action at this time.
0 commit comments