mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 13:55:35 +08:00
Compare commits
7 Commits
2ef64e4597
...
f7080c61d5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7080c61d5 | ||
|
|
26842fba27 | ||
|
|
dce1065af5 | ||
|
|
f0af17abe4 | ||
|
|
fbd56da7ad | ||
|
|
0ef8b8c175 | ||
|
|
230879a0db |
@@ -86,7 +86,7 @@ RUN sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
|
||||
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
||||
|
||||
RUN yum update -y && \
|
||||
yum install -y devtoolset-10-gcc-*
|
||||
yum install -y devtoolset-10-gcc-* devtoolset-10-libatomic-devel
|
||||
RUN echo "source scl_source enable devtoolset-10" >> /etc/bashrc
|
||||
RUN source /etc/bashrc
|
||||
RUN yum install -y which
|
||||
|
||||
@@ -228,8 +228,9 @@
|
||||
],
|
||||
"lib-depends": [
|
||||
"zlib",
|
||||
"libpng",
|
||||
"libjpeg",
|
||||
"libjxl",
|
||||
"libpng",
|
||||
"libwebp",
|
||||
"freetype",
|
||||
"libtiff",
|
||||
@@ -240,8 +241,7 @@
|
||||
"zstd",
|
||||
"xz",
|
||||
"libzip",
|
||||
"libxml2",
|
||||
"libjxl"
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"imap": {
|
||||
@@ -424,11 +424,12 @@
|
||||
"source": "libjxl",
|
||||
"static-libs-unix": [
|
||||
"libjxl.a",
|
||||
"libjxl_dec.a"
|
||||
"libjxl_dec.a",
|
||||
"libjxl_threads.a",
|
||||
"libhwy.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"brotli",
|
||||
"libgif",
|
||||
"libjpeg",
|
||||
"libpng",
|
||||
"libwebp"
|
||||
|
||||
@@ -390,8 +390,12 @@
|
||||
},
|
||||
"jbig": {
|
||||
"type": "url",
|
||||
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/jbig/jbigkit-2.1.tar.gz",
|
||||
"provide-pre-built": true,
|
||||
"alt": {
|
||||
"type": "url",
|
||||
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
|
||||
},
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
|
||||
@@ -4,10 +4,28 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
trait libjxl
|
||||
{
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
$depsContent = file_get_contents($this->source_dir . '/deps.sh');
|
||||
if (str_contains($depsContent, '# return 0')) {
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
UnixCMakeExecutor::create($this)
|
||||
@@ -16,9 +34,10 @@ trait libjxl
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_MANPAGES=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_BENCHMARK=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_PLUGINS=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_SJPEG=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_STATIC=ON')
|
||||
->addConfigureArgs('-DJPEGXL_ENABLE_JNI=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_STATIC=' . (SPCTarget::isStatic() ? 'ON' : 'OFF'))
|
||||
->addConfigureArgs('-DBUILD_TESTING=OFF')
|
||||
->addConfigureArgs('-DJPEGXL_FORCE_SYSTEM_BROTLI=ON')
|
||||
->build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,15 @@ trait libtiff
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$libcpp = SPCTarget::getTargetOS() === 'Darwin' ? '-lc++' : '-lstdc++';
|
||||
$libcpp = SPCTarget::getTargetOS() === 'Linux' ? '-lstdc++' : '-lc++';
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure', '-lwebp', '-lwebp -lsharpyuv');
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure', '-l"$lerc_lib_name"', '-l"$lerc_lib_name" ' . $libcpp);
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
|
||||
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
|
||||
->optionalLib('libwebp', '--enable-webp', '--disable-webp')
|
||||
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
|
||||
->optionalLib('jbig', '--enable-jbig', '--disable-jbig')
|
||||
->configure(
|
||||
// zlib deps
|
||||
'--enable-zlib',
|
||||
@@ -39,11 +44,6 @@ trait libtiff
|
||||
'--disable-cxx',
|
||||
'--without-x',
|
||||
)
|
||||
->optionalLib('lerc', '--enable-lerc', '--disable-lerc')
|
||||
->optionalLib('zstd', '--enable-zstd', '--disable-zstd')
|
||||
->optionalLib('webp', '--enable-webp', '--disable-webp')
|
||||
->optionalLib('xz', '--enable-lzma', '--disable-lzma')
|
||||
->optionalLib('jbig', '--enable-jbig', '--disable-jbig')
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['libtiff-4.pc']);
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ assert(Imagick::queryFormats('WEBP') !== []);
|
||||
assert(Imagick::queryFormats('JPEG') !== []);
|
||||
assert(Imagick::queryFormats('PNG') !== []);
|
||||
assert(Imagick::queryFormats('TIFF') !== []);
|
||||
assert(Imagick::queryFormats('JXL') !== []);
|
||||
|
||||
Reference in New Issue
Block a user