-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add libaom, libde265, libheif support, for imagick AVIF format support #575
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0aa28f1
Add libaom, libde265, libheif support, for imagick AVIF format support
crazywhalecc 641630c
Fix aom optimization
crazywhalecc a1e7652
Fix aom build command
crazywhalecc ecf9593
Fix libheif build command
crazywhalecc a06d742
Fix libheif build
crazywhalecc d0d0206
cs fix
crazywhalecc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\linux\library; | ||
|
||
class libaom extends LinuxLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libaom; | ||
|
||
public const NAME = 'libaom'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\linux\library; | ||
|
||
class libde265 extends LinuxLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libde265; | ||
|
||
public const NAME = 'libde265'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\linux\library; | ||
|
||
class libheif extends LinuxLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libheif; | ||
|
||
public const NAME = 'libheif'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\macos\library; | ||
|
||
class libaom extends MacOSLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libaom; | ||
|
||
public const NAME = 'libaom'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\macos\library; | ||
|
||
class libde265 extends MacOSLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libde265; | ||
|
||
public const NAME = 'libde265'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\macos\library; | ||
|
||
use SPC\store\FileSystem; | ||
|
||
class libheif extends MacOSLibraryBase | ||
{ | ||
use \SPC\builder\unix\library\libheif; | ||
|
||
public const NAME = 'libheif'; | ||
|
||
public function patchBeforeBuild(): bool | ||
{ | ||
if (!str_contains(file_get_contents($this->source_dir . '/CMakeLists.txt'), 'libbrotlienc')) { | ||
FileSystem::replaceFileStr( | ||
$this->source_dir . '/CMakeLists.txt', | ||
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")', | ||
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc")' | ||
); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\unix\library; | ||
|
||
use SPC\exception\FileSystemException; | ||
use SPC\exception\RuntimeException; | ||
use SPC\store\FileSystem; | ||
|
||
trait libaom | ||
{ | ||
/** | ||
* @throws RuntimeException | ||
* @throws FileSystemException | ||
*/ | ||
protected function build(): void | ||
{ | ||
// CMake needs a clean build directory | ||
FileSystem::resetDir($this->source_dir . '/builddir'); | ||
// Start build | ||
shell()->cd($this->source_dir . '/builddir') | ||
->exec( | ||
'cmake ' . | ||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . | ||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . | ||
'-DCMAKE_BUILD_TYPE=Release ' . | ||
'-DBUILD_SHARED_LIBS=OFF ' . | ||
'-DAOM_TARGET_CPU=generic ' . | ||
'..' | ||
) | ||
->exec("cmake --build . -j {$this->builder->concurrency}") | ||
->exec('make install'); | ||
$this->patchPkgconfPrefix(['aom.pc']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\unix\library; | ||
|
||
use SPC\exception\FileSystemException; | ||
use SPC\exception\RuntimeException; | ||
use SPC\store\FileSystem; | ||
|
||
trait libde265 | ||
{ | ||
/** | ||
* @throws RuntimeException | ||
* @throws FileSystemException | ||
*/ | ||
protected function build(): void | ||
{ | ||
// CMake needs a clean build directory | ||
FileSystem::resetDir($this->source_dir . '/build'); | ||
// Start build | ||
shell()->cd($this->source_dir . '/build') | ||
->exec( | ||
'cmake ' . | ||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . | ||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . | ||
'-DCMAKE_BUILD_TYPE=Release ' . | ||
'-DBUILD_SHARED_LIBS=OFF ' . | ||
'-DENABLE_SDL=OFF ' . // Disable SDL, currently not supported | ||
'..' | ||
) | ||
->exec("cmake --build . -j {$this->builder->concurrency}") | ||
->exec('make install'); | ||
$this->patchPkgconfPrefix(['libde265.pc']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace SPC\builder\unix\library; | ||
|
||
use SPC\exception\FileSystemException; | ||
use SPC\exception\RuntimeException; | ||
use SPC\store\FileSystem; | ||
|
||
trait libheif | ||
{ | ||
/** | ||
* @throws RuntimeException | ||
* @throws FileSystemException | ||
*/ | ||
protected function build(): void | ||
{ | ||
// CMake needs a clean build directory | ||
FileSystem::resetDir($this->source_dir . '/build'); | ||
// Start build | ||
shell()->cd($this->source_dir . '/build') | ||
->exec( | ||
'cmake ' . | ||
'--preset=release ' . | ||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . | ||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . | ||
'-DCMAKE_BUILD_TYPE=Release ' . | ||
'-DBUILD_SHARED_LIBS=OFF ' . | ||
'-DWITH_EXAMPLES=OFF ' . | ||
'-DWITH_GDK_PIXBUF=OFF ' . | ||
'-DBUILD_TESTING=OFF ' . | ||
'-DWITH_LIBSHARPYUV=ON ' . // optional: libwebp | ||
'-DENABLE_PLUGIN_LOADING=OFF ' . | ||
'..' | ||
) | ||
->exec("cmake --build . -j {$this->builder->concurrency}") | ||
->exec('make install'); | ||
$this->patchPkgconfPrefix(['libheif.pc']); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe should we use the latest tag instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. But I haven't figured out how to get the latest tag yet. Maybe we need to customize the XML parsing of
https://storage.googleapis.com/aom-releases/
.