mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
Add ngtcp2, remove suggested libs
This commit is contained in:
@@ -11,9 +11,6 @@ ngtcp2:
|
|||||||
license: MIT
|
license: MIT
|
||||||
depends:
|
depends:
|
||||||
- openssl
|
- openssl
|
||||||
suggests:
|
|
||||||
- nghttp3
|
|
||||||
- brotli
|
|
||||||
headers:
|
headers:
|
||||||
- ngtcp2
|
- ngtcp2
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
@@ -22,3 +19,5 @@ ngtcp2:
|
|||||||
static-libs@unix:
|
static-libs@unix:
|
||||||
- libngtcp2.a
|
- libngtcp2.a
|
||||||
- libngtcp2_crypto_ossl.a
|
- libngtcp2_crypto_ossl.a
|
||||||
|
static-libs@windows:
|
||||||
|
- ngtcp2.lib
|
||||||
|
|||||||
@@ -8,10 +8,27 @@ use StaticPHP\Attribute\Package\BuildFor;
|
|||||||
use StaticPHP\Attribute\Package\Library;
|
use StaticPHP\Attribute\Package\Library;
|
||||||
use StaticPHP\Package\LibraryPackage;
|
use StaticPHP\Package\LibraryPackage;
|
||||||
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
use StaticPHP\Runtime\Executor\WindowsCMakeExecutor;
|
||||||
|
|
||||||
#[Library('ngtcp2')]
|
#[Library('ngtcp2')]
|
||||||
class ngtcp2
|
class ngtcp2
|
||||||
{
|
{
|
||||||
|
#[BuildFor('Windows')]
|
||||||
|
public function buildWin(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
WindowsCMakeExecutor::create($lib)
|
||||||
|
->addConfigureArgs(
|
||||||
|
'-DENABLE_SHARED_LIB=OFF',
|
||||||
|
'-DENABLE_STATIC_LIB=ON',
|
||||||
|
'-DBUILD_STATIC_LIBS=ON',
|
||||||
|
'-DBUILD_SHARED_LIBS=OFF',
|
||||||
|
'-DENABLE_STATIC_CRT=ON',
|
||||||
|
'-DENABLE_LIB_ONLY=ON',
|
||||||
|
'-DENABLE_OPENSSL=ON',
|
||||||
|
)
|
||||||
|
->build();
|
||||||
|
}
|
||||||
|
|
||||||
#[BuildFor('Linux')]
|
#[BuildFor('Linux')]
|
||||||
#[BuildFor('Darwin')]
|
#[BuildFor('Darwin')]
|
||||||
public function build(LibraryPackage $lib): void
|
public function build(LibraryPackage $lib): void
|
||||||
@@ -26,18 +43,6 @@ class ngtcp2
|
|||||||
]),
|
]),
|
||||||
'--with-openssl=no'
|
'--with-openssl=no'
|
||||||
)
|
)
|
||||||
->optionalPackage('nghttp3', ...ac_with_args('libnghttp3', true))
|
|
||||||
->optionalPackage(
|
|
||||||
'brotli',
|
|
||||||
fn (LibraryPackage $brotli) => implode(' ', [
|
|
||||||
'--with-brotlidec=yes',
|
|
||||||
"LIBBROTLIDEC_CFLAGS=\"-I{$brotli->getIncludeDir()}\"",
|
|
||||||
"LIBBROTLIDEC_LIBS=\"{$brotli->getStaticLibFiles()}\"",
|
|
||||||
'--with-libbrotlienc=yes',
|
|
||||||
"LIBBROTLIENC_CFLAGS=\"-I{$brotli->getIncludeDir()}\"",
|
|
||||||
"LIBBROTLIENC_LIBS=\"{$brotli->getStaticLibFiles()}\"",
|
|
||||||
])
|
|
||||||
)
|
|
||||||
->appendEnv(['PKG_CONFIG' => '$PKG_CONFIG --static'])
|
->appendEnv(['PKG_CONFIG' => '$PKG_CONFIG --static'])
|
||||||
->configure('--enable-lib-only')
|
->configure('--enable-lib-only')
|
||||||
->make();
|
->make();
|
||||||
|
|||||||
Reference in New Issue
Block a user