mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
nghttp3
This commit is contained in:
parent
42f356d322
commit
ba0796c9ea
@ -618,6 +618,25 @@
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"nghttp3": {
|
||||
"source": "nghttp3",
|
||||
"static-libs-unix": [
|
||||
"libnghttp3.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"nghttp3.lib"
|
||||
],
|
||||
"headers": [
|
||||
"nghttp3"
|
||||
],
|
||||
"lib-depends": [
|
||||
"zlib",
|
||||
"openssl"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"onig": {
|
||||
"source": "onig",
|
||||
"static-libs-unix": [
|
||||
|
||||
@ -703,6 +703,16 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"nghttp3": {
|
||||
"type": "ghrel",
|
||||
"repo": "ngtcp2/nghttp3",
|
||||
"match": "nghttp3.+\\.tar\\.xz",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"onig": {
|
||||
"type": "ghrel",
|
||||
"repo": "kkos/oniguruma",
|
||||
|
||||
12
src/SPC/builder/linux/library/nghttp3.php
Normal file
12
src/SPC/builder/linux/library/nghttp3.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class nghttp3 extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\nghttp3;
|
||||
|
||||
public const NAME = 'nghttp3';
|
||||
}
|
||||
29
src/SPC/builder/macos/library/nghttp3.php
Normal file
29
src/SPC/builder/macos/library/nghttp3.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (c) 2022 Yun Dou <dixyes@gmail.com>
|
||||
*
|
||||
* lwmbs is licensed under Mulan PSL v2. You can use this
|
||||
* software according to the terms and conditions of the
|
||||
* Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at:
|
||||
*
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
|
||||
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class nghttp3 extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\nghttp3;
|
||||
|
||||
public const NAME = 'nghttp3';
|
||||
}
|
||||
55
src/SPC/builder/unix/library/nghttp3.php
Normal file
55
src/SPC/builder/unix/library/nghttp3.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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,
|
||||
'libxml2' => null,
|
||||
'libev' => null,
|
||||
'libcares' => null,
|
||||
'libngtcp2' => null,
|
||||
'libbpf' => null,
|
||||
'libevent-openssl' => null,
|
||||
'jansson' => null,
|
||||
'jemalloc' => null,
|
||||
'systemd' => null,
|
||||
'cunit' => null,
|
||||
]);
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv([
|
||||
'CFLAGS' => $this->getLibExtraCFlags(),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs()
|
||||
])
|
||||
->execWithEnv(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-lib-only ' .
|
||||
'--with-boost=no ' .
|
||||
$args . ' ' .
|
||||
'--prefix='
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['libnghttp3.pc']);
|
||||
}
|
||||
}
|
||||
39
src/SPC/builder/windows/library/nghttp3.php
Normal file
39
src/SPC/builder/windows/library/nghttp3.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\windows\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class nghttp3 extends WindowsLibraryBase
|
||||
{
|
||||
public const NAME = 'nghttp3';
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
// reset cmake
|
||||
FileSystem::resetDir($this->source_dir . '\build');
|
||||
|
||||
// start build
|
||||
cmd()->cd($this->source_dir)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
'-B build ' .
|
||||
'-A x64 ' .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DENABLE_SHARED_LIB=OFF ' .
|
||||
'-DENABLE_STATIC_LIB=ON ' .
|
||||
'-DBUILD_STATIC_LIBS=ON ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DENABLE_STATIC_CRT=ON ' .
|
||||
'-DENABLE_LIB_ONLY=ON ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
||||
)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user