Files
static-php-cli/src/SPC/builder/unix/library/libjxl.php

40 lines
1.4 KiB
PHP
Raw Normal View History

2025-07-20 00:10:30 +07:00
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\store\FileSystem;
2025-07-20 00:10:30 +07:00
use SPC\util\executor\UnixCMakeExecutor;
use SPC\util\SPCTarget;
2025-07-20 00:10:30 +07:00
trait libjxl
{
public function patchBeforeBuild(): bool
{
FileSystem::replaceFileStr(
$this->source_dir . '/deps.sh',
['return 0', 'download_github third_party/brotli', 'download_github third_party/zlib', 'download_github third_party/libpng'],
['# return 0', '# download_github third_party/brotli', '# download_github third_party/zlib', '# download_github third_party/libpng'],
);
shell()->cd($this->source_dir)
->exec('./deps.sh');
return true;
}
2025-07-20 00:10:30 +07:00
protected function build(): void
{
UnixCMakeExecutor::create($this)
->addConfigureArgs('-DJPEGXL_ENABLE_TOOLS=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_EXAMPLES=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_MANPAGES=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_BENCHMARK=OFF')
->addConfigureArgs('-DJPEGXL_ENABLE_PLUGINS=OFF')
2025-07-20 02:17:00 +07:00
->addConfigureArgs('-DJPEGXL_ENABLE_JNI=OFF')
2025-07-20 01:17:58 +07:00
->addConfigureArgs('-DJPEGXL_STATIC=' . (SPCTarget::isStatic() ? 'ON' : 'OFF'))
->addConfigureArgs('-DJPEGXL_FORCE_SYSTEM_BROTLI=ON')
2025-07-20 10:37:37 +07:00
->addConfigureArgs('-DBUILD_TESTING=OFF')
2025-07-20 00:10:30 +07:00
->build();
}
}