Skip to content

Commit d0d0206

Browse files
committed
cs fix
1 parent a06d742 commit d0d0206

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/SPC/builder/macos/library/libheif.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,24 @@
44

55
namespace SPC\builder\macos\library;
66

7+
use SPC\store\FileSystem;
8+
79
class 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
}

src/SPC/builder/unix/library/libheif.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,12 @@
44

55
namespace SPC\builder\unix\library;
66

7-
use SPC\builder\macos\MacOSBuilder;
87
use SPC\exception\FileSystemException;
98
use SPC\exception\RuntimeException;
109
use SPC\store\FileSystem;
1110

1211
trait 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

0 commit comments

Comments
 (0)