mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 23:05:41 +08:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd2dc5bce4 | ||
|
|
8650ce4f8f | ||
|
|
9fdfef5057 | ||
|
|
18c5ccfe9d | ||
|
|
d064e1353c | ||
|
|
3c89ce6c7f | ||
|
|
07ea1e2887 | ||
|
|
f0b5e4f59e | ||
|
|
a54021bf19 | ||
|
|
dce63d3c87 | ||
|
|
47ab5d7584 | ||
|
|
b2182b4fe1 | ||
|
|
1d5aec037b | ||
|
|
6b5f702719 | ||
|
|
7bdcda1d62 | ||
|
|
66840a8eed | ||
|
|
98773ee5a6 | ||
|
|
719d818fd1 | ||
|
|
b8444070ee | ||
|
|
5b4f4f8e55 | ||
|
|
22d263c0a8 | ||
|
|
150d866c15 | ||
|
|
c051a48d56 | ||
|
|
b965ffcd82 | ||
|
|
7f863d182f | ||
|
|
d1041c57dc | ||
|
|
14b822a185 | ||
|
|
7204d277b4 | ||
|
|
5a0fd40dc4 | ||
|
|
59a6e27532 | ||
|
|
6b3b841c0e | ||
|
|
e6591ffe9c | ||
|
|
e316971764 | ||
|
|
d55278714f | ||
|
|
cb7eca9049 | ||
|
|
5b8c9e6f09 |
@@ -142,6 +142,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
|
|||||||
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
||||||
; EXTRA_CFLAGS for `configure` and `make` php
|
; EXTRA_CFLAGS for `configure` and `make` php
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
|
||||||
|
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
|
||||||
|
MACOSX_DEPLOYMENT_TARGET=12.0
|
||||||
|
|
||||||
[freebsd]
|
[freebsd]
|
||||||
; compiler environments
|
; compiler environments
|
||||||
|
|||||||
@@ -567,6 +567,13 @@
|
|||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"unix-only": true
|
"unix-only": true
|
||||||
},
|
},
|
||||||
|
"pcov": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "pcov",
|
||||||
|
"target": [
|
||||||
|
"shared"
|
||||||
|
]
|
||||||
|
},
|
||||||
"pdo": {
|
"pdo": {
|
||||||
"type": "builtin"
|
"type": "builtin"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -771,8 +771,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libwebp": {
|
"libwebp": {
|
||||||
"type": "url",
|
"type": "ghtagtar",
|
||||||
"url": "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz",
|
"repo": "webmproject/libwebp",
|
||||||
|
"match": "v1\\.\\d+\\.\\d+$",
|
||||||
"provide-pre-built": true,
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
@@ -780,8 +781,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libxml2": {
|
"libxml2": {
|
||||||
"type": "url",
|
"type": "ghtagtar",
|
||||||
"url": "https://github.com/GNOME/libxml2/archive/refs/tags/v2.12.5.tar.gz",
|
"repo": "GNOME/libxml2",
|
||||||
|
"match": "v2\\.\\d+\\.\\d+$",
|
||||||
|
"provide-pre-built": false,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "Copyright"
|
"path": "Copyright"
|
||||||
@@ -963,6 +966,15 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pcov": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/pcov",
|
||||||
|
"filename": "pcov.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pdo_sqlsrv": {
|
"pdo_sqlsrv": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/pdo_sqlsrv",
|
"url": "https://pecl.php.net/get/pdo_sqlsrv",
|
||||||
@@ -1160,9 +1172,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"xdebug": {
|
"xdebug": {
|
||||||
"type": "url",
|
"type": "pie",
|
||||||
"url": "https://pecl.php.net/get/xdebug",
|
"repo": "xdebug/xdebug",
|
||||||
"filename": "xdebug.tgz",
|
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const string VERSION = '2.7.8';
|
public const string VERSION = '2.7.11';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\toolchain\ToolchainManager;
|
||||||
|
use SPC\toolchain\ZigToolchain;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('imagick')]
|
#[CustomExt('imagick')]
|
||||||
@@ -19,7 +21,9 @@ class imagick extends Extension
|
|||||||
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
||||||
{
|
{
|
||||||
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
|
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
|
||||||
if (str_contains(getenv('PATH'), 'rh/devtoolset') || str_contains(getenv('PATH'), 'rh/gcc-toolset')) {
|
if (ToolchainManager::getToolchainClass() !== ZigToolchain::class &&
|
||||||
|
(str_contains(getenv('PATH'), 'rh/devtoolset') || str_contains(getenv('PATH'), 'rh/gcc-toolset'))
|
||||||
|
) {
|
||||||
$static .= ' -l:libstdc++.a';
|
$static .= ' -l:libstdc++.a';
|
||||||
$shared = str_replace('-lstdc++', '', $shared);
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('maxminddb')]
|
#[CustomExt('maxminddb')]
|
||||||
@@ -12,15 +13,13 @@ class maxminddb extends Extension
|
|||||||
{
|
{
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
if (!is_link(SOURCE_PATH . '/php-src/ext/maxminddb')) {
|
if (!is_dir(SOURCE_PATH . '/php-src/ext/maxminddb')) {
|
||||||
$original = $this->source_dir;
|
$original = $this->source_dir;
|
||||||
if (PHP_OS_FAMILY === 'Windows') {
|
FileSystem::copyDir($original . '/ext', SOURCE_PATH . '/php-src/ext/maxminddb');
|
||||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D maxminddb ' . $original . '\ext');
|
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
|
||||||
} else {
|
|
||||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s ' . $original . '/ext maxminddb');
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,9 @@ EOF
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getExtraEnv(): array
|
||||||
|
{
|
||||||
|
return ['CFLAGS' => '-std=c17'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,9 @@ class mongodb extends Extension
|
|||||||
$arg .= $this->builder->getLib('zlib') ? ' --with-mongodb-zlib=yes ' : ' --with-mongodb-zlib=bundled ';
|
$arg .= $this->builder->getLib('zlib') ? ' --with-mongodb-zlib=yes ' : ' --with-mongodb-zlib=bundled ';
|
||||||
return clean_spaces($arg);
|
return clean_spaces($arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getExtraEnv(): array
|
||||||
|
{
|
||||||
|
return ['CFLAGS' => '-std=c17'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class pgsql extends Extension
|
|||||||
protected function getExtraEnv(): array
|
protected function getExtraEnv(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'CFLAGS' => '-Wno-int-conversion',
|
'CFLAGS' => '-std=c17 -Wno-int-conversion',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ namespace SPC\builder\linux\library;
|
|||||||
|
|
||||||
use SPC\builder\linux\SystemUtil;
|
use SPC\builder\linux\SystemUtil;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\toolchain\GccNativeToolchain;
|
||||||
|
use SPC\toolchain\ToolchainManager;
|
||||||
use SPC\util\executor\UnixAutoconfExecutor;
|
use SPC\util\executor\UnixAutoconfExecutor;
|
||||||
use SPC\util\SPCTarget;
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
@@ -15,26 +17,19 @@ class liburing extends LinuxLibraryBase
|
|||||||
|
|
||||||
public function patchBeforeBuild(): bool
|
public function patchBeforeBuild(): bool
|
||||||
{
|
{
|
||||||
if (!SystemUtil::isMuslDist()) {
|
if (SystemUtil::isMuslDist()) {
|
||||||
return false;
|
FileSystem::replaceFileStr($this->source_dir . '/configure', 'realpath -s', 'realpath');
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
FileSystem::replaceFileStr($this->source_dir . '/configure', 'realpath -s', 'realpath');
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
$use_libc = SPCTarget::getLibc() !== 'glibc' || version_compare(SPCTarget::getLibcVersion(), '2.30', '>=');
|
$use_libc = ToolchainManager::getToolchainClass() !== GccNativeToolchain::class || version_compare(SPCTarget::getLibcVersion(), '2.30', '>=');
|
||||||
$make = UnixAutoconfExecutor::create($this);
|
$make = UnixAutoconfExecutor::create($this);
|
||||||
|
|
||||||
if (!$use_libc) {
|
if ($use_libc) {
|
||||||
$make->appendEnv([
|
|
||||||
'CC' => 'gcc', // libc-less version fails to compile with clang or zig
|
|
||||||
'CXX' => 'g++',
|
|
||||||
'AR' => 'ar',
|
|
||||||
'LD' => 'ld',
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
$make->appendEnv([
|
$make->appendEnv([
|
||||||
'CFLAGS' => '-D_GNU_SOURCE',
|
'CFLAGS' => '-D_GNU_SOURCE',
|
||||||
]);
|
]);
|
||||||
@@ -51,7 +46,7 @@ class liburing extends LinuxLibraryBase
|
|||||||
$use_libc ? '--use-libc' : '',
|
$use_libc ? '--use-libc' : '',
|
||||||
)
|
)
|
||||||
->configure()
|
->configure()
|
||||||
->make('library', 'install ENABLE_SHARED=0', with_clean: false);
|
->make('library ENABLE_SHARED=0', 'install ENABLE_SHARED=0', with_clean: false);
|
||||||
|
|
||||||
$this->patchPkgconfPrefix();
|
$this->patchPkgconfPrefix();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class openssl extends LinuxLibraryBase
|
|||||||
"{$zlib_extra}" .
|
"{$zlib_extra}" .
|
||||||
'enable-pie ' .
|
'enable-pie ' .
|
||||||
'no-legacy ' .
|
'no-legacy ' .
|
||||||
|
'no-tests ' .
|
||||||
"linux-{$arch}"
|
"linux-{$arch}"
|
||||||
)
|
)
|
||||||
->exec('make clean')
|
->exec('make clean')
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ trait gmp
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
UnixAutoconfExecutor::create($this)->configure()->make();
|
UnixAutoconfExecutor::create($this)
|
||||||
|
->appendEnv([
|
||||||
|
'CFLAGS' => '-std=c17',
|
||||||
|
])
|
||||||
|
->configure()
|
||||||
|
->make();
|
||||||
$this->patchPkgconfPrefix(['gmp.pc']);
|
$this->patchPkgconfPrefix(['gmp.pc']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,13 +29,17 @@ trait libjxl
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||||
$cmake->addConfigureArgs(
|
$cflags = getenv('SPC_DEFAULT_C_FLAGS') ?: getenv('CFLAGS') ?: '';
|
||||||
'-DCXX_MAVX512F_SUPPORTED:BOOL=FALSE',
|
$has_avx512 = str_contains($cflags, '-mavx512') || str_contains($cflags, '-march=x86-64-v4');
|
||||||
'-DCXX_MAVX512DQ_SUPPORTED:BOOL=FALSE',
|
if (!$has_avx512) {
|
||||||
'-DCXX_MAVX512CD_SUPPORTED:BOOL=FALSE',
|
$cmake->addConfigureArgs(
|
||||||
'-DCXX_MAVX512BW_SUPPORTED:BOOL=FALSE',
|
'-DCXX_MAVX512F_SUPPORTED:BOOL=FALSE',
|
||||||
'-DCXX_MAVX512VL_SUPPORTED:BOOL=FALSE'
|
'-DCXX_MAVX512DQ_SUPPORTED:BOOL=FALSE',
|
||||||
);
|
'-DCXX_MAVX512CD_SUPPORTED:BOOL=FALSE',
|
||||||
|
'-DCXX_MAVX512BW_SUPPORTED:BOOL=FALSE',
|
||||||
|
'-DCXX_MAVX512VL_SUPPORTED:BOOL=FALSE'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmake->build();
|
$cmake->build();
|
||||||
|
|||||||
@@ -10,8 +10,25 @@ trait libwebp
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
|
$code = 'int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
|
||||||
|
$cc = getenv('CC') ?: 'gcc';
|
||||||
|
[$ret] = shell()->execWithResult("echo '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
|
||||||
|
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64' && PHP_OS_FAMILY === 'Linux';
|
||||||
|
|
||||||
UnixCMakeExecutor::create($this)
|
UnixCMakeExecutor::create($this)
|
||||||
->addConfigureArgs('-DWEBP_BUILD_EXTRAS=ON')
|
->addConfigureArgs(
|
||||||
|
'-DWEBP_BUILD_EXTRAS=OFF',
|
||||||
|
'-DWEBP_BUILD_ANIM_UTILS=OFF',
|
||||||
|
'-DWEBP_BUILD_CWEBP=OFF',
|
||||||
|
'-DWEBP_BUILD_DWEBP=OFF',
|
||||||
|
'-DWEBP_BUILD_GIF2WEBP=OFF',
|
||||||
|
'-DWEBP_BUILD_IMG2WEBP=OFF',
|
||||||
|
'-DWEBP_BUILD_VWEBP=OFF',
|
||||||
|
'-DWEBP_BUILD_WEBPINFO=OFF',
|
||||||
|
'-DWEBP_BUILD_WEBPMUX=OFF',
|
||||||
|
'-DWEBP_BUILD_FUZZTEST=OFF',
|
||||||
|
$disableAvx2 ? '-DWEBP_ENABLE_SIMD=OFF' : ''
|
||||||
|
)
|
||||||
->build();
|
->build();
|
||||||
// patch pkgconfig
|
// patch pkgconfig
|
||||||
$this->patchPkgconfPrefix(patch_option: PKGCONF_PATCH_PREFIX | PKGCONF_PATCH_LIBDIR);
|
$this->patchPkgconfPrefix(patch_option: PKGCONF_PATCH_PREFIX | PKGCONF_PATCH_LIBDIR);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ trait ncurses
|
|||||||
|
|
||||||
UnixAutoconfExecutor::create($this)
|
UnixAutoconfExecutor::create($this)
|
||||||
->appendEnv([
|
->appendEnv([
|
||||||
|
'CFLAGS' => '-std=c17',
|
||||||
'LDFLAGS' => SPCTarget::isStatic() ? '-static' : '',
|
'LDFLAGS' => SPCTarget::isStatic() ? '-static' : '',
|
||||||
])
|
])
|
||||||
->configure(
|
->configure(
|
||||||
@@ -29,7 +30,7 @@ trait ncurses
|
|||||||
'--without-tests',
|
'--without-tests',
|
||||||
'--without-dlsym',
|
'--without-dlsym',
|
||||||
'--without-debug',
|
'--without-debug',
|
||||||
'-enable-symlinks',
|
'--enable-symlinks',
|
||||||
"--bindir={$this->getBinDir()}",
|
"--bindir={$this->getBinDir()}",
|
||||||
"--includedir={$this->getIncludeDir()}",
|
"--includedir={$this->getIncludeDir()}",
|
||||||
"--libdir={$this->getLibDir()}",
|
"--libdir={$this->getLibDir()}",
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class curl extends WindowsLibraryBase
|
|||||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||||
'-DBUILD_STATIC_LIBS=ON ' .
|
'-DBUILD_STATIC_LIBS=ON ' .
|
||||||
'-DCURL_STATICLIB=ON ' .
|
|
||||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||||
'-DBUILD_CURL_EXE=OFF ' . // disable curl.exe
|
'-DBUILD_CURL_EXE=OFF ' . // disable curl.exe
|
||||||
'-DBUILD_TESTING=OFF ' . // disable tests
|
'-DBUILD_TESTING=OFF ' . // disable tests
|
||||||
@@ -42,9 +41,9 @@ class curl extends WindowsLibraryBase
|
|||||||
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
|
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
|
||||||
'-DCURL_ENABLE_SSL=ON ' .
|
'-DCURL_ENABLE_SSL=ON ' .
|
||||||
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
|
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
|
||||||
|
'-DSHARE_LIB_OBJECT=OFF ' . // disable shared lib object
|
||||||
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
|
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
|
||||||
'-DENABLE_IPV6=ON ' . // enable ipv6
|
'-DENABLE_IPV6=ON ' . // enable ipv6
|
||||||
'-DNGHTTP2_CFLAGS="/DNGHTTP2_STATICLIB" ' .
|
|
||||||
$alt
|
$alt
|
||||||
)
|
)
|
||||||
->execWithWrapper(
|
->execWithWrapper(
|
||||||
@@ -53,5 +52,7 @@ class curl extends WindowsLibraryBase
|
|||||||
);
|
);
|
||||||
// move libcurl.lib to libcurl_a.lib
|
// move libcurl.lib to libcurl_a.lib
|
||||||
rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib');
|
rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib');
|
||||||
|
|
||||||
|
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\curl\curl.h', '#ifdef CURL_STATICLIB', '#if 1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,11 +29,16 @@ class nghttp2 extends WindowsLibraryBase
|
|||||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||||
'-DENABLE_STATIC_CRT=ON ' .
|
'-DENABLE_STATIC_CRT=ON ' .
|
||||||
'-DENABLE_LIB_ONLY=ON ' .
|
'-DENABLE_LIB_ONLY=ON ' .
|
||||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||||
|
'-DENABLE_STATIC_CRT=ON ' .
|
||||||
|
'-DENABLE_DOC=OFF ' .
|
||||||
|
'-DBUILD_TESTING=OFF '
|
||||||
)
|
)
|
||||||
->execWithWrapper(
|
->execWithWrapper(
|
||||||
$this->builder->makeSimpleWrapper('cmake'),
|
$this->builder->makeSimpleWrapper('cmake'),
|
||||||
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\nghttp2\nghttp2.h', '#ifdef NGHTTP2_STATICLIB', '#if 1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -572,6 +572,44 @@ class FileSystem
|
|||||||
return file_put_contents($file, implode('', $lines));
|
return file_put_contents($file, implode('', $lines));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Move file or directory, handling cross-device scenarios
|
||||||
|
* Uses rename() if possible, falls back to copy+delete for cross-device moves
|
||||||
|
*
|
||||||
|
* @param string $source Source path
|
||||||
|
* @param string $dest Destination path
|
||||||
|
*/
|
||||||
|
public static function moveFileOrDir(string $source, string $dest): void
|
||||||
|
{
|
||||||
|
$source = self::convertPath($source);
|
||||||
|
$dest = self::convertPath($dest);
|
||||||
|
|
||||||
|
// Check if source and dest are on the same device to avoid cross-device rename errors
|
||||||
|
$source_stat = @stat($source);
|
||||||
|
$dest_parent = dirname($dest);
|
||||||
|
$dest_stat = @stat($dest_parent);
|
||||||
|
|
||||||
|
// Only use rename if on same device
|
||||||
|
if ($source_stat !== false && $dest_stat !== false && $source_stat['dev'] === $dest_stat['dev']) {
|
||||||
|
if (@rename($source, $dest)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fall back to copy + delete for cross-device moves or if rename failed
|
||||||
|
if (is_dir($source)) {
|
||||||
|
self::copyDir($source, $dest);
|
||||||
|
self::removeDir($source);
|
||||||
|
} else {
|
||||||
|
if (!copy($source, $dest)) {
|
||||||
|
throw new FileSystemException("Failed to copy file from {$source} to {$dest}");
|
||||||
|
}
|
||||||
|
if (!unlink($source)) {
|
||||||
|
throw new FileSystemException("Failed to remove source file: {$source}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static function extractArchive(string $filename, string $target): void
|
private static function extractArchive(string $filename, string $target): void
|
||||||
{
|
{
|
||||||
// Create base dir
|
// Create base dir
|
||||||
@@ -648,36 +686,6 @@ class FileSystem
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Move file or directory, handling cross-device scenarios
|
|
||||||
* Uses rename() if possible, falls back to copy+delete for cross-device moves
|
|
||||||
*
|
|
||||||
* @param string $source Source path
|
|
||||||
* @param string $dest Destination path
|
|
||||||
*/
|
|
||||||
private static function moveFileOrDir(string $source, string $dest): void
|
|
||||||
{
|
|
||||||
$source = self::convertPath($source);
|
|
||||||
$dest = self::convertPath($dest);
|
|
||||||
|
|
||||||
// Try rename first (fast, atomic)
|
|
||||||
if (@rename($source, $dest)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_dir($source)) {
|
|
||||||
self::copyDir($source, $dest);
|
|
||||||
self::removeDir($source);
|
|
||||||
} else {
|
|
||||||
if (!copy($source, $dest)) {
|
|
||||||
throw new FileSystemException("Failed to copy file from {$source} to {$dest}");
|
|
||||||
}
|
|
||||||
if (!unlink($source)) {
|
|
||||||
throw new FileSystemException("Failed to remove source file: {$source}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unzip file with stripping top-level directory
|
* Unzip file with stripping top-level directory
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class SourcePatcher
|
|||||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchFfiCentos7FixO3strncmp']);
|
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchFfiCentos7FixO3strncmp']);
|
||||||
FileSystem::addSourceExtractHook('sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
FileSystem::addSourceExtractHook('sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||||
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||||
|
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVPhp85']);
|
||||||
FileSystem::addSourceExtractHook('yaml', [__CLASS__, 'patchYamlWin32']);
|
FileSystem::addSourceExtractHook('yaml', [__CLASS__, 'patchYamlWin32']);
|
||||||
FileSystem::addSourceExtractHook('libyaml', [__CLASS__, 'patchLibYaml']);
|
FileSystem::addSourceExtractHook('libyaml', [__CLASS__, 'patchLibYaml']);
|
||||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchImapLicense']);
|
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchImapLicense']);
|
||||||
@@ -432,6 +433,23 @@ class SourcePatcher
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fix the compilation issue of pdo_sqlsrv with php 8.5
|
||||||
|
*/
|
||||||
|
public static function patchSQLSRVPhp85(): bool
|
||||||
|
{
|
||||||
|
$source_dir = SOURCE_PATH . '/php-src/ext/pdo_sqlsrv';
|
||||||
|
if (!file_exists($source_dir . '/config.m4') && is_dir($source_dir . '/source/pdo_sqlsrv')) {
|
||||||
|
FileSystem::moveFileOrDir($source_dir . '/LICENSE', $source_dir . '/source/pdo_sqlsrv/LICENSE');
|
||||||
|
FileSystem::moveFileOrDir($source_dir . '/source/shared', $source_dir . '/source/pdo_sqlsrv/shared');
|
||||||
|
FileSystem::moveFileOrDir($source_dir . '/source/pdo_sqlsrv', SOURCE_PATH . '/pdo_sqlsrv');
|
||||||
|
FileSystem::removeDir($source_dir);
|
||||||
|
FileSystem::moveFileOrDir(SOURCE_PATH . '/pdo_sqlsrv', $source_dir);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static function patchYamlWin32(): bool
|
public static function patchYamlWin32(): bool
|
||||||
{
|
{
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yaml/config.w32', "lib.substr(lib.length - 6, 6) == '_a.lib'", "lib.substr(lib.length - 6, 6) == '_a.lib' || 'yes' == 'yes'");
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yaml/config.w32', "lib.substr(lib.length - 6, 6) == '_a.lib'", "lib.substr(lib.length - 6, 6) == '_a.lib' || 'yes' == 'yes'");
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ class GoXcaddy extends CustomPackage
|
|||||||
'macos' => 'darwin',
|
'macos' => 'darwin',
|
||||||
default => throw new \InvalidArgumentException('Unsupported OS: ' . $name),
|
default => throw new \InvalidArgumentException('Unsupported OS: ' . $name),
|
||||||
};
|
};
|
||||||
$go_version = '1.25.0';
|
[$go_version] = explode("\n", Downloader::curlExec('https://go.dev/VERSION?m=text'));
|
||||||
$config = [
|
$config = [
|
||||||
'type' => 'url',
|
'type' => 'url',
|
||||||
'url' => "https://go.dev/dl/go{$go_version}.{$os}-{$arch}.tar.gz",
|
'url' => "https://go.dev/dl/{$go_version}.{$os}-{$arch}.tar.gz",
|
||||||
];
|
];
|
||||||
Downloader::downloadPackage($name, $config, $force);
|
Downloader::downloadPackage($name, $config, $force);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ declare(strict_types=1);
|
|||||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||||
$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',
|
||||||
@@ -23,19 +23,19 @@ $test_php_version = [
|
|||||||
|
|
||||||
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
|
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
|
||||||
$test_os = [
|
$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',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
$zts = false;
|
$zts = true;
|
||||||
|
|
||||||
$no_strip = false;
|
$no_strip = false;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ $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' => 'maxminddb',
|
'Linux', 'Darwin' => 'curl',
|
||||||
'Windows' => 'bcmath',
|
'Windows' => 'bcmath',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,8 +66,8 @@ $with_suggested_libs = false;
|
|||||||
|
|
||||||
// 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' => 'libwebp',
|
||||||
'Windows' => '',
|
'Windows' => 'nghttp2',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Please change your test base combination. We recommend testing with `common`.
|
// Please change your test base combination. We recommend testing with `common`.
|
||||||
|
|||||||
Reference in New Issue
Block a user