mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-13 20:05:35 +08:00
Compare commits
14 Commits
2.7.11
...
5ef4623051
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ef4623051 | ||
|
|
e952f1c76a | ||
|
|
09b89a30f9 | ||
|
|
9a681a9fa6 | ||
|
|
f7ca621efe | ||
|
|
6b5200002e | ||
|
|
53f7cdefe0 | ||
|
|
e1a14bbb9f | ||
|
|
9e051c8c80 | ||
|
|
e677be74d7 | ||
|
|
037d224fd7 | ||
|
|
ce44e00bd4 | ||
|
|
0247458853 | ||
|
|
656a58c3fa |
428
composer.lock
generated
428
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -142,8 +142,6 @@ 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
|
||||||
|
|||||||
@@ -236,7 +236,9 @@
|
|||||||
"arg-type-unix": "enable-path",
|
"arg-type-unix": "enable-path",
|
||||||
"cpp-extension": true,
|
"cpp-extension": true,
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"grpc"
|
"zlib",
|
||||||
|
"openssl",
|
||||||
|
"libcares"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"iconv": {
|
"iconv": {
|
||||||
@@ -487,6 +489,36 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"mysqlnd_ed25519": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "mysqlnd_ed25519",
|
||||||
|
"arg-type": "enable",
|
||||||
|
"target": [
|
||||||
|
"shared"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"mysqlnd"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libsodium",
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mysqlnd_parsec": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "mysqlnd_parsec",
|
||||||
|
"arg-type": "enable",
|
||||||
|
"target": [
|
||||||
|
"shared"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"mysqlnd"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libsodium",
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
"oci8": {
|
"oci8": {
|
||||||
"type": "wip",
|
"type": "wip",
|
||||||
"support": {
|
"support": {
|
||||||
|
|||||||
@@ -871,6 +871,24 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mysqlnd_ed25519": {
|
||||||
|
"type": "pie",
|
||||||
|
"repo": "mariadb/mysqlnd_ed25519",
|
||||||
|
"path": "php-src/ext/mysqlnd_ed25519",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mysqlnd_parsec": {
|
||||||
|
"type": "pie",
|
||||||
|
"repo": "mariadb/mysqlnd_parsec",
|
||||||
|
"path": "php-src/ext/mysqlnd_parsec",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ncurses": {
|
"ncurses": {
|
||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://ftp.gnu.org/pub/gnu/ncurses/",
|
"url": "https://ftp.gnu.org/pub/gnu/ncurses/",
|
||||||
|
|||||||
@@ -385,6 +385,9 @@ class Extension
|
|||||||
logger()->info('Shared extension [' . $this->getName() . '] was already built, skipping (' . $this->getName() . '.so)');
|
logger()->info('Shared extension [' . $this->getName() . '] was already built, skipping (' . $this->getName() . '.so)');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((string) Config::getExt($this->getName(), 'type') === 'addon') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
|
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
|
||||||
foreach ($this->dependencies as $dependency) {
|
foreach ($this->dependencies as $dependency) {
|
||||||
if (!$dependency instanceof Extension) {
|
if (!$dependency instanceof Extension) {
|
||||||
|
|||||||
@@ -184,18 +184,18 @@ abstract class LibraryBase
|
|||||||
|
|
||||||
// extract first if not exists
|
// extract first if not exists
|
||||||
if (!is_dir($this->source_dir)) {
|
if (!is_dir($this->source_dir)) {
|
||||||
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-extract');
|
$this->getBuilder()->emitPatchPoint('before-library[' . static::NAME . ']-extract');
|
||||||
SourceManager::initSource(libs: [static::NAME], source_only: true);
|
SourceManager::initSource(libs: [static::NAME], source_only: true);
|
||||||
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-extract');
|
$this->getBuilder()->emitPatchPoint('after-library[' . static::NAME . ']-extract');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->patched && $this->patchBeforeBuild()) {
|
if (!$this->patched && $this->patchBeforeBuild()) {
|
||||||
file_put_contents($this->source_dir . '/.spc.patched', 'PATCHED!!!');
|
file_put_contents($this->source_dir . '/.spc.patched', 'PATCHED!!!');
|
||||||
}
|
}
|
||||||
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-build');
|
$this->getBuilder()->emitPatchPoint('before-library[' . static::NAME . ']-build');
|
||||||
$this->build();
|
$this->build();
|
||||||
$this->installLicense();
|
$this->installLicense();
|
||||||
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-build');
|
$this->getBuilder()->emitPatchPoint('after-library[' . static::NAME . ']-build');
|
||||||
return LIB_STATUS_OK;
|
return LIB_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,19 +346,19 @@ abstract class LibraryBase
|
|||||||
*/
|
*/
|
||||||
protected function installLicense(): void
|
protected function installLicense(): void
|
||||||
{
|
{
|
||||||
FileSystem::createDir(BUILD_ROOT_PATH . '/source-licenses/' . $this->getName());
|
|
||||||
$source = Config::getLib($this->getName(), 'source');
|
$source = Config::getLib($this->getName(), 'source');
|
||||||
|
FileSystem::createDir(BUILD_ROOT_PATH . "/source-licenses/{$source}");
|
||||||
$license_files = Config::getSource($source)['license'] ?? [];
|
$license_files = Config::getSource($source)['license'] ?? [];
|
||||||
if (is_assoc_array($license_files)) {
|
if (is_assoc_array($license_files)) {
|
||||||
$license_files = [$license_files];
|
$license_files = [$license_files];
|
||||||
}
|
}
|
||||||
foreach ($license_files as $index => $license) {
|
foreach ($license_files as $index => $license) {
|
||||||
if ($license['type'] === 'text') {
|
if ($license['type'] === 'text') {
|
||||||
FileSystem::writeFile(BUILD_ROOT_PATH . '/source-licenses/' . $this->getName() . "/{$index}.txt", $license['text']);
|
FileSystem::writeFile(BUILD_ROOT_PATH . "/source-licenses/{$source}/{$index}.txt", $license['text']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($license['type'] === 'file') {
|
if ($license['type'] === 'file') {
|
||||||
copy($this->source_dir . '/' . $license['path'], BUILD_ROOT_PATH . '/source-licenses/' . $this->getName() . "/{$index}.txt");
|
copy($this->source_dir . '/' . $license['path'], BUILD_ROOT_PATH . "/source-licenses/{$source}/{$index}.txt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,8 +375,17 @@ abstract class LibraryBase
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||||
|
$search_paths = array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path));
|
||||||
foreach (Config::getLib(static::NAME, 'pkg-configs', []) as $name) {
|
foreach (Config::getLib(static::NAME, 'pkg-configs', []) as $name) {
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/pkgconfig/{$name}.pc")) {
|
$found = false;
|
||||||
|
foreach ($search_paths as $path) {
|
||||||
|
if (file_exists($path . "/{$name}.pc")) {
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/SPC/builder/extension/mysqlnd_ed25519.php
Normal file
22
src/SPC/builder/extension/mysqlnd_ed25519.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('mysqlnd_ed25519')]
|
||||||
|
class mysqlnd_ed25519 extends Extension
|
||||||
|
{
|
||||||
|
public function getConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-mysqlnd_ed25519' . ($shared ? '=shared' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return $this->getConfigureArg();
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/SPC/builder/extension/mysqlnd_parsec.php
Normal file
22
src/SPC/builder/extension/mysqlnd_parsec.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('mysqlnd_parsec')]
|
||||||
|
class mysqlnd_parsec extends Extension
|
||||||
|
{
|
||||||
|
public function getConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--enable-mysqlnd_parsec' . ($shared ? '=shared' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return $this->getConfigureArg();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ class swoole extends Extension
|
|||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
$patched = parent::patchBeforeMake();
|
$patched = parent::patchBeforeMake();
|
||||||
|
FileSystem::replaceFileStr($this->source_dir . '/ext-src/php_swoole_private.h', 'PHP_VERSION_ID > 80500', 'PHP_VERSION_ID >= 80600');
|
||||||
if ($this->builder instanceof MacOSBuilder) {
|
if ($this->builder instanceof MacOSBuilder) {
|
||||||
// Fix swoole with event extension <util.h> conflict bug
|
// Fix swoole with event extension <util.h> conflict bug
|
||||||
$util_path = shell()->execWithResult('xcrun --show-sdk-path', false)[1][0] . '/usr/include/util.h';
|
$util_path = shell()->execWithResult('xcrun --show-sdk-path', false)[1][0] . '/usr/include/util.h';
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ trait UnixLibraryTrait
|
|||||||
$files = array_map(fn ($x) => "{$x}.pc", $conf_pc);
|
$files = array_map(fn ($x) => "{$x}.pc", $conf_pc);
|
||||||
}
|
}
|
||||||
foreach ($files as $name) {
|
foreach ($files as $name) {
|
||||||
$realpath = realpath(BUILD_ROOT_PATH . '/lib/pkgconfig/' . $name);
|
$realpath = realpath(BUILD_LIB_PATH . '/pkgconfig/' . $name);
|
||||||
if ($realpath === false) {
|
if ($realpath === false) {
|
||||||
throw new PatchException('pkg-config prefix patcher', 'Cannot find library [' . static::NAME . '] pkgconfig file [' . $name . '] in ' . BUILD_LIB_PATH . '/pkgconfig/ !');
|
throw new PatchException('pkg-config prefix patcher', 'Cannot find library [' . static::NAME . '] pkgconfig file [' . $name . '] in ' . BUILD_LIB_PATH . '/pkgconfig/ !');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ trait libwebp
|
|||||||
{
|
{
|
||||||
protected function build(): void
|
protected function build(): void
|
||||||
{
|
{
|
||||||
$code = 'int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
|
$code = '#include <immintrin.h>
|
||||||
|
int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
|
||||||
$cc = getenv('CC') ?: 'gcc';
|
$cc = getenv('CC') ?: 'gcc';
|
||||||
[$ret] = shell()->execWithResult("echo '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
|
[$ret] = shell()->execWithResult("printf '%s' '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
|
||||||
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64' && PHP_OS_FAMILY === 'Linux';
|
$disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64' && PHP_OS_FAMILY === 'Linux';
|
||||||
|
|
||||||
UnixCMakeExecutor::create($this)
|
UnixCMakeExecutor::create($this)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ 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
|
||||||
@@ -41,9 +42,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(
|
||||||
@@ -52,7 +53,5 @@ 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,16 +29,11 @@ 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');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,9 @@ class Downloader
|
|||||||
if (($rel['prerelease'] ?? false) === true && ($source['prefer-stable'] ?? false)) {
|
if (($rel['prerelease'] ?? false) === true && ($source['prefer-stable'] ?? false)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (($rel['draft'] ?? false) === true && (($source['prefer-stable'] ?? false) || !$rel['tarball_url'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!($source['match'] ?? null)) {
|
if (!($source['match'] ?? null)) {
|
||||||
$url = $rel['tarball_url'] ?? null;
|
$url = $rel['tarball_url'] ?? null;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -408,13 +408,13 @@ class FileSystem
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$sub_file = self::convertPath($dir . '/' . $v);
|
$sub_file = self::convertPath($dir . '/' . $v);
|
||||||
if (is_dir($sub_file)) {
|
if (is_link($sub_file) || is_file($sub_file)) {
|
||||||
# 如果是 目录 且 递推 , 则递推添加下级文件
|
if (!unlink($sub_file)) {
|
||||||
if (!self::removeDir($sub_file)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} elseif (is_link($sub_file) || is_file($sub_file)) {
|
} elseif (is_dir($sub_file)) {
|
||||||
if (!unlink($sub_file)) {
|
# 如果是 目录 且 递推 , 则递推添加下级文件
|
||||||
|
if (!self::removeDir($sub_file)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,9 +226,17 @@ class SPCConfigUtil
|
|||||||
// parse pkg-configs
|
// parse pkg-configs
|
||||||
foreach ($libraries as $library) {
|
foreach ($libraries as $library) {
|
||||||
$pc = Config::getLib($library, 'pkg-configs', []);
|
$pc = Config::getLib($library, 'pkg-configs', []);
|
||||||
|
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||||
|
$search_paths = array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path));
|
||||||
foreach ($pc as $file) {
|
foreach ($pc as $file) {
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/pkgconfig/{$file}.pc")) {
|
$found = false;
|
||||||
throw new WrongUsageException("pkg-config file '{$file}.pc' for lib [{$library}] does not exist in '" . BUILD_LIB_PATH . "/pkgconfig'. Please build it first.");
|
foreach ($search_paths as $path) {
|
||||||
|
if (file_exists($path . "/{$file}.pc")) {
|
||||||
|
$found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found) {
|
||||||
|
throw new WrongUsageException("pkg-config file '{$file}.pc' for lib [{$library}] does not exist. Please build it first.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pc_cflags = implode(' ', $pc);
|
$pc_cflags = implode(' ', $pc);
|
||||||
@@ -257,9 +265,17 @@ class SPCConfigUtil
|
|||||||
foreach ($libraries as $library) {
|
foreach ($libraries as $library) {
|
||||||
// add pkg-configs libs
|
// add pkg-configs libs
|
||||||
$pkg_configs = Config::getLib($library, 'pkg-configs', []);
|
$pkg_configs = Config::getLib($library, 'pkg-configs', []);
|
||||||
foreach ($pkg_configs as $pkg_config) {
|
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/pkgconfig/{$pkg_config}.pc")) {
|
$search_paths = array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path));
|
||||||
throw new WrongUsageException("pkg-config file '{$pkg_config}.pc' for lib [{$library}] does not exist in '" . BUILD_LIB_PATH . "/pkgconfig'. Please build it first.");
|
foreach ($pkg_configs as $file) {
|
||||||
|
$found = false;
|
||||||
|
foreach ($search_paths as $path) {
|
||||||
|
if (file_exists($path . "/{$file}.pc")) {
|
||||||
|
$found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$found) {
|
||||||
|
throw new WrongUsageException("pkg-config file '{$file}.pc' for lib [{$library}] does not exist. Please build it first.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pkg_configs = implode(' ', $pkg_configs);
|
$pkg_configs = implode(' ', $pkg_configs);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ 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,15 +23,15 @@ $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
|
||||||
@@ -50,13 +50,13 @@ $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' => 'curl',
|
'Linux', 'Darwin' => 'mysqli',
|
||||||
'Windows' => 'bcmath',
|
'Windows' => 'bcmath',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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`).
|
||||||
$shared_extensions = match (PHP_OS_FAMILY) {
|
$shared_extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux' => '',
|
'Linux' => 'grpc,mysqlnd_parsec,mysqlnd_ed25519',
|
||||||
'Darwin' => '',
|
'Darwin' => '',
|
||||||
'Windows' => '',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
@@ -67,7 +67,7 @@ $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' => 'libwebp',
|
'Linux', 'Darwin' => 'libwebp',
|
||||||
'Windows' => 'nghttp2',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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