mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge remote-tracking branch 'origin/main' into fix/icurel
This commit is contained in:
commit
635fbae3c9
@ -635,9 +635,6 @@
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"ngtcp2"
|
||||
]
|
||||
},
|
||||
"ngtcp2": {
|
||||
@ -655,6 +652,10 @@
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"nghttp3",
|
||||
"brotli"
|
||||
]
|
||||
},
|
||||
"onig": {
|
||||
|
||||
@ -81,7 +81,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
foreach ($libSpecs as $libName => $arr) {
|
||||
$lib = $this->getLib($libName);
|
||||
if ($lib === null && str_starts_with($libName, 'lib')) {
|
||||
$lib = $this->getExt(substr($libName, 3));
|
||||
$lib = $this->getLib(substr($libName, 3));
|
||||
}
|
||||
|
||||
$arr = $arr ?? [];
|
||||
|
||||
@ -96,4 +96,13 @@ class openssl extends LinuxLibraryBase
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||
}
|
||||
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true): string
|
||||
{
|
||||
$libFiles = parent::getStaticLibFiles($style, $recursive);
|
||||
if (!str_contains('-ldl -lpthread', $libFiles)) {
|
||||
$libFiles .= ' -ldl -lpthread';
|
||||
}
|
||||
return $libFiles;
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
foreach ($lib_specs as $libName => $arr) {
|
||||
$lib = $this->getLib($libName);
|
||||
if ($lib === null && str_starts_with($libName, 'lib')) {
|
||||
$lib = $this->getExt(substr($libName, 3));
|
||||
$lib = $this->getLib(substr($libName, 3));
|
||||
}
|
||||
|
||||
$arr = $arr ?? [];
|
||||
|
||||
@ -31,6 +31,12 @@ trait nghttp2
|
||||
'jemalloc' => null,
|
||||
'systemd' => null,
|
||||
]);
|
||||
if ($brotli = $this->builder->getLib('brotli')) {
|
||||
/* @phpstan-ignore-next-line */
|
||||
$args .= ' --with-libbrotlidec=yes LIBBROTLIDEC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIDEC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||
/* @phpstan-ignore-next-line */
|
||||
$args .= ' --with-libbrotlienc=yes LIBBROTLIENC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIENC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||
}
|
||||
|
||||
[,,$destdir] = SEPARATED_PATH;
|
||||
|
||||
|
||||
@ -6,22 +6,15 @@ namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
|
||||
trait nghttp3
|
||||
{
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$args = $this->builder->makeAutoconfArgs(static::NAME, [
|
||||
'zlib' => null,
|
||||
'openssl' => null,
|
||||
]);
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
@ -34,7 +27,6 @@ trait nghttp3
|
||||
'--disable-shared ' .
|
||||
'--with-pic ' .
|
||||
'--enable-lib-only ' .
|
||||
$args . ' ' .
|
||||
'--prefix='
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
|
||||
@ -18,12 +18,17 @@ trait ngtcp2
|
||||
protected function build(): void
|
||||
{
|
||||
$args = $this->builder->makeAutoconfArgs(static::NAME, [
|
||||
'zlib' => null,
|
||||
'openssl' => null,
|
||||
'libxml2' => null,
|
||||
'libev' => null,
|
||||
'jemalloc' => null,
|
||||
'libnghttp3' => null,
|
||||
]);
|
||||
if ($brotli = $this->builder->getLib('brotli')) {
|
||||
/* @phpstan-ignore-next-line */
|
||||
$args .= ' --with-libbrotlidec=yes LIBBROTLIDEC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIDEC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||
/* @phpstan-ignore-next-line */
|
||||
$args .= ' --with-libbrotlienc=yes LIBBROTLIENC_CFLAGS="-I' . BUILD_ROOT_PATH . '/include" LIBBROTLIENC_LIBS="' . $brotli->getStaticLibFiles() . '"';
|
||||
}
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
@ -43,8 +48,6 @@ trait ngtcp2
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['libngtcp2.pc']);
|
||||
$this->patchPkgconfPrefix(['libngtcp2_crypto_ossl.pc']);
|
||||
$this->patchLaDependencyPrefix(['libngtcp2.la', 'libngtcp2_crypto_ossl.la']);
|
||||
$this->patchPkgconfPrefix(['libngtcp2.pc', 'libngtcp2_crypto_ossl.pc']);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user