mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
fix: icu-static-win, ext-swoole, krb5, sqlsrv with grpc (#1087)
This commit is contained in:
@@ -462,10 +462,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"krb5": {
|
"krb5": {
|
||||||
"type": "ghtagtar",
|
"type": "url",
|
||||||
"repo": "krb5/krb5",
|
"url": "https://web.mit.edu/kerberos/dist/krb5/1.22/krb5-1.22.2.tar.gz",
|
||||||
"match": "krb5.+-final",
|
|
||||||
"prefer-stable": true,
|
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "NOTICE"
|
"path": "NOTICE"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const string VERSION = '2.8.4';
|
public const string VERSION = '2.8.5';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ class grpc extends Extension
|
|||||||
'zend_ce_exception,',
|
'zend_ce_exception,',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Fix include path conflict with pdo_sqlsrv: grpc's PHP ext dir is added to the global include path via
|
||||||
|
$grpc_php_dir = "{$this->source_dir}/src/php/ext/grpc";
|
||||||
|
if (file_exists("{$grpc_php_dir}/version.h")) {
|
||||||
|
copy("{$grpc_php_dir}/version.h", "{$grpc_php_dir}/php_grpc_version.h");
|
||||||
|
unlink("{$grpc_php_dir}/version.h");
|
||||||
|
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.h", '#include "version.h"', '#include "php_grpc_version.h"');
|
||||||
|
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.c", '#include "version.h"', '#include "php_grpc_version.h"');
|
||||||
|
}
|
||||||
|
|
||||||
$config_m4 = <<<'M4'
|
$config_m4 = <<<'M4'
|
||||||
PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])])
|
PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])])
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class swoole extends Extension
|
|||||||
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
||||||
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
|
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
|
||||||
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
|
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
|
||||||
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring --enable-uring-socket' : '';
|
$arg .= $this->builder->getLib('liburing') && getenv('SPC_LIBC') !== 'glibc' ? ' --enable-iouring --enable-uring-socket' : '--disable-iouring';
|
||||||
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
|
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
|
||||||
|
|
||||||
// enable additional features that require the pdo extension, but conflict with pdo_* extensions
|
// enable additional features that require the pdo extension, but conflict with pdo_* extensions
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ trait krb5
|
|||||||
{
|
{
|
||||||
$origin_source_dir = $this->source_dir;
|
$origin_source_dir = $this->source_dir;
|
||||||
$this->source_dir .= '/src';
|
$this->source_dir .= '/src';
|
||||||
|
shell()->cd($this->source_dir)->exec('ls -lah');
|
||||||
|
if (!file_exists($this->source_dir . '/configure')) {
|
||||||
shell()->cd($this->source_dir)->exec('autoreconf -if');
|
shell()->cd($this->source_dir)->exec('autoreconf -if');
|
||||||
|
}
|
||||||
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
|
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
|
||||||
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
|
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
|
||||||
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
|
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ trait libjpeg
|
|||||||
->addConfigureArgs(
|
->addConfigureArgs(
|
||||||
'-DENABLE_STATIC=ON',
|
'-DENABLE_STATIC=ON',
|
||||||
'-DENABLE_SHARED=OFF',
|
'-DENABLE_SHARED=OFF',
|
||||||
'-DWITH_SYSTEM_ZLIB=ON'
|
'-DWITH_SYSTEM_ZLIB=ON',
|
||||||
|
'-DWITH_TOOLS=OFF',
|
||||||
|
'-DWITH_TESTS=OFF',
|
||||||
|
'-DWITH_SIMD=OFF',
|
||||||
)
|
)
|
||||||
->build();
|
->build();
|
||||||
// patch pkgconfig
|
// patch pkgconfig
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ class icu_static_win extends WindowsLibraryBase
|
|||||||
|
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
copy("{$this->source_dir}\\x64-windows-static\\lib\\icudt.lib", "{$this->getLibDir()}\\icudt.lib");
|
copy("{$this->source_dir}\\lib\\icudt.lib", "{$this->getLibDir()}\\icudt.lib");
|
||||||
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuin.lib", "{$this->getLibDir()}\\icuin.lib");
|
copy("{$this->source_dir}\\lib\\icuin.lib", "{$this->getLibDir()}\\icuin.lib");
|
||||||
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuio.lib", "{$this->getLibDir()}\\icuio.lib");
|
copy("{$this->source_dir}\\lib\\icuio.lib", "{$this->getLibDir()}\\icuio.lib");
|
||||||
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuuc.lib", "{$this->getLibDir()}\\icuuc.lib");
|
copy("{$this->source_dir}\\lib\\icuuc.lib", "{$this->getLibDir()}\\icuuc.lib");
|
||||||
|
|
||||||
// create libpq folder in buildroot/includes/libpq
|
// create libpq folder in buildroot/includes/libpq
|
||||||
if (!file_exists("{$this->getIncludeDir()}\\unicode")) {
|
if (!file_exists("{$this->getIncludeDir()}\\unicode")) {
|
||||||
mkdir("{$this->getIncludeDir()}\\unicode");
|
mkdir("{$this->getIncludeDir()}\\unicode");
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystem::copyDir("{$this->source_dir}\\x64-windows-static\\include\\unicode", "{$this->getIncludeDir()}\\unicode");
|
FileSystem::copyDir("{$this->source_dir}\\include\\unicode", "{$this->getIncludeDir()}\\unicode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ class UnixCMakeExecutor extends Executor
|
|||||||
$cflags = getenv('SPC_DEFAULT_C_FLAGS');
|
$cflags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||||
$cc = getenv('CC');
|
$cc = getenv('CC');
|
||||||
$cxx = getenv('CCX');
|
$cxx = getenv('CCX');
|
||||||
|
$include = BUILD_INCLUDE_PATH;
|
||||||
logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'");
|
logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'");
|
||||||
$root = BUILD_ROOT_PATH;
|
$root = BUILD_ROOT_PATH;
|
||||||
$pkgConfigExecutable = PkgConfigUtil::findPkgConfig();
|
$pkgConfigExecutable = PkgConfigUtil::findPkgConfig();
|
||||||
@@ -210,6 +211,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|||||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "{$include}")
|
||||||
|
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "{$include}")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil")
|
set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil")
|
||||||
CMAKE;
|
CMAKE;
|
||||||
// Whoops, linux may need CMAKE_AR sometimes
|
// Whoops, linux may need CMAKE_AR sometimes
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ declare(strict_types=1);
|
|||||||
$test_php_version = [
|
$test_php_version = [
|
||||||
// '8.1',
|
// '8.1',
|
||||||
// '8.2',
|
// '8.2',
|
||||||
// '8.3',
|
'8.3',
|
||||||
// '8.4',
|
// '8.4',
|
||||||
'8.5',
|
'8.5',
|
||||||
// 'git',
|
// 'git',
|
||||||
@@ -26,9 +26,9 @@ $test_os = [
|
|||||||
'macos-15-intel', // bin/spc for x86_64
|
'macos-15-intel', // bin/spc for x86_64
|
||||||
'macos-15', // bin/spc for arm64
|
'macos-15', // bin/spc for arm64
|
||||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||||
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
// 'ubuntu-24.04', // bin/spc for x86_64
|
||||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
||||||
// 'windows-2022', // .\bin\spc.ps1
|
// 'windows-2022', // .\bin\spc.ps1
|
||||||
// 'windows-2025',
|
// 'windows-2025',
|
||||||
@@ -43,15 +43,15 @@ $no_strip = false;
|
|||||||
$upx = false;
|
$upx = false;
|
||||||
|
|
||||||
// whether to test frankenphp build, only available for macOS and linux
|
// whether to test frankenphp build, only available for macOS and linux
|
||||||
$frankenphp = true;
|
$frankenphp = false;
|
||||||
|
|
||||||
// prefer downloading pre-built packages to speed up the build process
|
// prefer downloading pre-built packages to speed up the build process
|
||||||
$prefer_pre_built = false;
|
$prefer_pre_built = false;
|
||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'sqlsrv,pdo_sqlsrv',
|
'Linux', 'Darwin' => 'curl,swoole',
|
||||||
'Windows' => 'amqp,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,ds,exif,ffi,fileinfo,filter,ftp,gd,iconv,igbinary,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,rar,redis,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yac,yaml,zip,zlib',
|
'Windows' => 'intl',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
||||||
@@ -66,7 +66,7 @@ $with_suggested_libs = true;
|
|||||||
|
|
||||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||||
$with_libs = match (PHP_OS_FAMILY) {
|
$with_libs = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => '',
|
'Linux', 'Darwin' => 'krb5',
|
||||||
'Windows' => '',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user