mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Compare commits
6 Commits
1ebc58664e
...
f90892c92f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f90892c92f | ||
|
|
5359f3a79a | ||
|
|
42fbf18bba | ||
|
|
ed227ce00e | ||
|
|
6c49d35aec | ||
|
|
238fd7fc74 |
@ -449,9 +449,13 @@
|
||||
},
|
||||
"xsl": {
|
||||
"type": "builtin",
|
||||
"arg-type": "with",
|
||||
"arg-type": "with-prefix",
|
||||
"lib-depends": [
|
||||
"libxslt"
|
||||
],
|
||||
"ext-depends": [
|
||||
"xml",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"yaml": {
|
||||
|
||||
@ -293,6 +293,16 @@
|
||||
"pthreads4w"
|
||||
]
|
||||
},
|
||||
"libxslt": {
|
||||
"source": "libxslt",
|
||||
"static-libs-unix": [
|
||||
"libxslt.a",
|
||||
"libexslt.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"libyaml": {
|
||||
"source": "libyaml",
|
||||
"static-libs-unix": [
|
||||
|
||||
@ -254,6 +254,15 @@
|
||||
"path": "Copyright"
|
||||
}
|
||||
},
|
||||
"libxslt": {
|
||||
"type": "filelist",
|
||||
"url": "https://download.gnome.org/sources/libxslt/1.1/",
|
||||
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"text": "COPYING"
|
||||
}
|
||||
},
|
||||
"libyaml": {
|
||||
"type": "ghrel",
|
||||
"repo": "yaml/libyaml",
|
||||
|
||||
@ -19,21 +19,22 @@ class libxml2 extends LinuxLibraryBase
|
||||
public function build(): void
|
||||
{
|
||||
$enable_zlib = $this->builder->getLib('zlib') ? 'ON' : 'OFF';
|
||||
$enable_icu = $this->builder->getLib('icu') ? 'ON' : 'OFF';
|
||||
// $enable_icu = $this->builder->getLib('icu') ? 'ON' : 'OFF';
|
||||
$enable_xz = $this->builder->getLib('xz') ? 'ON' : 'OFF';
|
||||
|
||||
[, , $destdir] = SEPARATED_PATH;
|
||||
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec(
|
||||
"{$this->builder->configure_env} " . ' cmake ' .
|
||||
"{$this->builder->makeCmakeArgs()} " .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DCMAKE_INSTALL_BINDIR=' . escapeshellarg(BUILD_ROOT_PATH . '/bin') . ' ' .
|
||||
'-DLIBXML2_WITH_ICONV=ON ' .
|
||||
'-DIconv_IS_BUILT_IN=OFF ' .
|
||||
"-DLIBXML2_WITH_ZLIB={$enable_zlib} " .
|
||||
"-DLIBXML2_WITH_ICU={$enable_icu} " .
|
||||
'-DLIBXML2_WITH_ICU=OFF ' .
|
||||
"-DLIBXML2_WITH_LZMA={$enable_xz} " .
|
||||
'-DLIBXML2_WITH_PYTHON=OFF ' .
|
||||
'-DLIBXML2_WITH_PROGRAMS=OFF ' .
|
||||
@ -41,15 +42,6 @@ class libxml2 extends LinuxLibraryBase
|
||||
'..'
|
||||
)
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec("make install DESTDIR={$destdir}");
|
||||
|
||||
if (is_dir(BUILD_INCLUDE_PATH . '/libxml2/libxml')) {
|
||||
if (is_dir(BUILD_INCLUDE_PATH . '/libxml')) {
|
||||
shell()->exec('rm -rf "' . BUILD_INCLUDE_PATH . '/libxml"');
|
||||
}
|
||||
$path = FileSystem::convertPath(BUILD_INCLUDE_PATH . '/libxml2/libxml');
|
||||
$dst_path = FileSystem::convertPath(BUILD_INCLUDE_PATH . '/');
|
||||
shell()->exec('mv "' . $path . '" "' . $dst_path . '"');
|
||||
}
|
||||
->exec('make install');
|
||||
}
|
||||
}
|
||||
|
||||
15
src/SPC/builder/linux/library/libxslt.php
Normal file
15
src/SPC/builder/linux/library/libxslt.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class libxslt extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libxslt;
|
||||
|
||||
public const NAME = 'libxslt';
|
||||
}
|
||||
15
src/SPC/builder/macos/library/libxslt.php
Normal file
15
src/SPC/builder/macos/library/libxslt.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class libxslt extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libxslt;
|
||||
|
||||
public const NAME = 'libxslt';
|
||||
}
|
||||
@ -51,6 +51,7 @@ trait curl
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
// compile!
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec('sed -i.save s@\${CMAKE_C_IMPLICIT_LINK_LIBRARIES}@@ ../CMakeLists.txt')
|
||||
->exec("{$this->builder->configure_env} cmake {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF -DBUILD_CURL_EXE=OFF {$extra} ..")
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
|
||||
@ -7,6 +7,7 @@ namespace SPC\builder\unix\library;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
trait libwebp
|
||||
{
|
||||
@ -17,25 +18,20 @@ trait libwebp
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
[,,$destdir] = SEPARATED_PATH;
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->exec('./autogen.sh')
|
||||
// CMake needs a clean build directory
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
// Start build
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec(
|
||||
"{$this->builder->configure_env} ./configure " .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--prefix= ' .
|
||||
'--enable-libwebpdecoder ' .
|
||||
'--enable-libwebpextras ' .
|
||||
'--disable-tiff ' .
|
||||
'--disable-gl ' .
|
||||
'--disable-sdl ' .
|
||||
'--disable-wic'
|
||||
"{$this->builder->configure_env} cmake " .
|
||||
$this->builder->makeCmakeArgs() . ' ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DWEBP_BUILD_EXTRAS=ON ' .
|
||||
'..'
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . $destdir);
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
// patch pkgconfig
|
||||
$this->patchPkgconfPrefix(['libsharpyuv.pc', 'libwebp.pc', 'libwebpdecoder.pc', 'libwebpdemux.pc', 'libwebpmux.pc'], PKGCONF_PATCH_PREFIX);
|
||||
$this->cleanLaFiles();
|
||||
}
|
||||
|
||||
35
src/SPC/builder/unix/library/libxslt.php
Normal file
35
src/SPC/builder/unix/library/libxslt.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
|
||||
trait libxslt
|
||||
{
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(
|
||||
"{$this->builder->configure_env} ./configure " .
|
||||
'--enable-static --disable-shared ' .
|
||||
'--without-python ' .
|
||||
'--without-mem-debug ' .
|
||||
'--without-crypto ' .
|
||||
'--without-debug ' .
|
||||
'--without-debugger ' .
|
||||
'--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' .
|
||||
'--prefix='
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH));
|
||||
$this->patchPkgconfPrefix(['libexslt.pc']);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user