Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9f80d6b
Add dev:gen-ext-test-matrix command
crazywhalecc May 8, 2026
4507c8f
Fix zig check on fresh installed spc
crazywhalecc May 8, 2026
6b6025d
Add parallel download
crazywhalecc May 8, 2026
a8a8516
Fix memcache build on PHP 8.5
crazywhalecc May 8, 2026
a980b0a
Use -i instead of -I (-I used by hardcoded INI)
crazywhalecc May 8, 2026
143ae4b
Use -i instead of -I (-I used by hardcoded INI)
crazywhalecc May 8, 2026
a19c447
Fix frameworks in unix cmake executor wrongly used by linux
crazywhalecc May 8, 2026
641ad8b
Add patch for PHP 8.2 compatibility in imap extension
crazywhalecc May 8, 2026
5529e66
Add dom deps for xmlreader
crazywhalecc May 8, 2026
be03980
Add exclude for gen-ext-test-matrix
crazywhalecc May 8, 2026
1d1f58f
Disable parallel downloading
crazywhalecc May 8, 2026
5e40982
Use windows-latest
crazywhalecc May 8, 2026
37b5f89
Add extra build flags for specific extensions
crazywhalecc May 8, 2026
4695f84
Add macOS test
crazywhalecc May 8, 2026
dcf1c59
Add macOS test, conflicts
crazywhalecc May 8, 2026
73bf9ff
Add libzstd.lib for windows builds
crazywhalecc May 8, 2026
fd4bf90
Add standalone list
crazywhalecc May 8, 2026
01607a0
Add spx compatible command arg
crazywhalecc May 8, 2026
ee21199
Remove hosted binary temporarily
crazywhalecc May 8, 2026
c374163
Fix windows mpir build
crazywhalecc May 8, 2026
61747f6
Add frameworks for glfw
crazywhalecc May 8, 2026
1b30c98
Make glfw standalone though
crazywhalecc May 8, 2026
e4201a2
Add 'imagick' and 'intl' to standalone array
crazywhalecc May 8, 2026
04df87c
Make intl use c++17
crazywhalecc May 9, 2026
4f9a555
ds use git (pecl have buggy config.w32)
crazywhalecc May 9, 2026
bf326de
Fix extracting hosted type for zip archive caused overwriting
crazywhalecc May 9, 2026
bf308e8
Remove duplicate phar patch for micro
crazywhalecc May 9, 2026
b09cc96
Add curl execute output log
crazywhalecc May 9, 2026
ad74752
Merge remote-tracking branch 'origin/v3-docs/readme' into v3-docs/readme
crazywhalecc May 9, 2026
cd803c7
Add filtering options for extensions, libs, and OS in test matrix gen…
crazywhalecc May 9, 2026
e930873
Add tier 2 support for actions runner test
crazywhalecc May 9, 2026
af3c6a6
Move build command here
crazywhalecc May 9, 2026
e664245
Fix opentelemetry strict flag
crazywhalecc May 9, 2026
184a091
Implicitly define swow dependencies (due to extension generating and …
crazywhalecc May 9, 2026
2ed4b10
Make brotli and zstd as dep
crazywhalecc May 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/artifact/ncurses.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ncurses:
binary: hosted
metadata:
license-files:
- COPYING
Expand Down
1 change: 1 addition & 0 deletions config/pkg/ext/builtin-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ ext-xmlreader:
type: php-extension
depends:
- ext-xml
- ext-dom
php-extension:
arg-type: enable
build-with-php: true
Expand Down
6 changes: 4 additions & 2 deletions config/pkg/ext/ext-ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ ext-ds:
type: php-extension
artifact:
source:
type: pecl
name: ds
type: git
url: 'https://github.com/php-ds/ext-ds.git'
rev: master
extract: php-src/ext/ds
metadata:
license-files: [LICENSE]
license: MIT
5 changes: 0 additions & 5 deletions config/pkg/ext/ext-swow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@ ext-swow:
metadata:
license: Apache-2.0
license-files: [LICENSE]
suggests:
- openssl
- curl
- ext-openssl
- ext-curl
php-extension:
arg-type: custom
1 change: 0 additions & 1 deletion config/pkg/lib/brotli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ brotli:
type: ghtagtar
repo: google/brotli
match: 'v1\.\d.*'
binary: hosted
metadata:
license-files: [LICENSE]
license: MIT
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/bzip2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bzip2:
type: filelist
url: 'https://sourceware.org/pub/bzip2/'
regex: '/href="(?<file>bzip2-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: ['@/bzip2.txt']
license: bzip2-1.0.6
Expand Down
6 changes: 6 additions & 0 deletions config/pkg/lib/glfw.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
glfw:
type: library
artifact: glfw
frameworks:
- Cocoa
- CoreFoundation
- CoreVideo
- IOKit
- QuartzCore
headers:
- GLFW/glfw3.h
- GLFW/glfw3native.h
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libcares.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ libcares:
type: filelist
url: 'https://c-ares.org/download/'
regex: '/href="\/download\/(?<file>c-ares-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [LICENSE.md]
headers@unix:
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libedit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libedit:
type: filelist
url: 'https://thrysoee.dk/editline/'
regex: '/href="(?<file>libedit-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING]
license: BSD-3-Clause
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libiconv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libiconv:
type: filelist
url: 'https://ftp.gnu.org/gnu/libiconv/'
regex: '/href="(?<file>libiconv-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING.LIB]
license: LGPL-2.0-or-later
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libpng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libpng:
repo: pnggroup/libpng
match: v1\.6\.\d+
query: '?per_page=150'
binary: hosted
metadata:
license-files: [LICENSE]
license: PNG
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libsodium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libsodium:
repo: jedisct1/libsodium
match: 'libsodium-(?!1\.0\.21)\d+(\.\d+)*\.tar\.gz'
prefer-stable: true
binary: hosted
metadata:
license-files: [LICENSE]
pkg-configs:
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libssh2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libssh2:
repo: libssh2/libssh2
match: libssh2.+\.tar\.gz
prefer-stable: true
binary: hosted
metadata:
license-files: [COPYING]
license: BSD-3-Clause
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/libunistring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ libunistring:
type: filelist
url: 'https://ftp.gnu.org/gnu/libunistring/'
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [COPYING.LIB]
license: LGPL-3.0-or-later
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ openssl:
type: filelist
url: 'https://www.openssl.org/source/'
regex: '/href="(?<file>openssl-(?<version>3\.[^"]+)\.tar\.gz)"/'
binary: hosted
metadata:
license-files: [LICENSE.txt]
license: OpenSSL
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/xz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ xz:
repo: tukaani-project/xz
match: xz.+\.tar\.xz
prefer-stable: true
binary: hosted
metadata:
license-files: [COPYING]
license: 0BSD
Expand Down
1 change: 0 additions & 1 deletion config/pkg/lib/zlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ zlib:
type: ghrel
repo: madler/zlib
match: zlib.+\.tar\.gz
binary: hosted
metadata:
license-files: ['@/zlib.txt']
license: Zlib-Custom
Expand Down
1 change: 1 addition & 0 deletions config/pkg/lib/zstd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ zstd:
- libzstd.a
static-libs@windows:
- zstd.lib
- libzstd.lib
5 changes: 2 additions & 3 deletions config/pkg/target/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ curl:
- zlib
- libssh2
- nghttp2
- brotli
- zstd
suggests@unix:
- libssh2
- brotli
Expand All @@ -27,9 +29,6 @@ curl:
- ldap
- idn2
- krb5
suggests@windows:
- brotli
- zstd
frameworks:
- CoreFoundation
- CoreServices
Expand Down
2 changes: 1 addition & 1 deletion docs/en/guide/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spc download [artifacts] [options]
| `--binary-only` | | Only download binary artifacts |
| `--parallel=<n>` | `-P` | Number of parallel downloads (default: `1`) |
| `--retry=<n>` | `-R` | Number of retries on failure (default: `0`) |
| `--ignore-cache=<list>` | | Force re-download the specified artifacts |
| `--ignore-cache=<list>` | `-i` | Force re-download the specified artifacts |
| `--no-alt` | | Do not use alternative mirror URLs |
| `--no-shallow-clone` | | Do not clone git repositories shallowly |
| `--custom-url=<src:url>` | `-U` | Override the download URL for a source |
Expand Down
24 changes: 12 additions & 12 deletions docs/zh/guide/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ spc download [artifacts] [options]

### 选项

| 选项 | 缩写 | 说明 |
|---|---|---|
| 选项 | 缩写 | 说明 |
|---|------|---|
| `--for-extensions=<list>` | `-e` | 按扩展名下载其所需的制品 |
| `--for-libs=<list>` | `-l` | 按库名下载其所需的制品 |
| `--for-packages=<list>` | | 按包名下载其所需的制品 |
| `--without-suggests` | | 使用 `--for-extensions` 时跳过建议包 |
| `--clean` | | 下载前删除旧的下载缓存 |
| `--with-php=<ver>` | | PHP 版本,格式为 `major.minor`(默认 `8.4`)|
| `--for-packages=<list>` | | 按包名下载其所需的制品 |
| `--without-suggests` | | 使用 `--for-extensions` 时跳过建议包 |
| `--clean` | | 下载前删除旧的下载缓存 |
| `--with-php=<ver>` | | PHP 版本,格式为 `major.minor`(默认 `8.4`)|
| `--prefer-binary` | `-p` | 优先使用预编译二进制 |
| `--prefer-source` | | 优先使用源码包 |
| `--source-only` | | 仅下载源码制品 |
| `--binary-only` | | 仅下载二进制制品 |
| `--prefer-source` | | 优先使用源码包 |
| `--source-only` | | 仅下载源码制品 |
| `--binary-only` | | 仅下载二进制制品 |
| `--parallel=<n>` | `-P` | 并行下载数(默认 `1`)|
| `--retry=<n>` | `-R` | 失败重试次数(默认 `0`)|
| `--ignore-cache=<list>` | | 强制重新下载指定制品 |
| `--no-alt` | | 不使用镜像站 |
| `--no-shallow-clone` | | 不使用浅层克隆 |
| `--ignore-cache=<list>` | `-i` | 强制重新下载指定制品 |
| `--no-alt` | | 不使用镜像站 |
| `--no-shallow-clone` | | 不使用浅层克隆 |
| `--custom-url=<src:url>` | `-U` | 覆盖指定源的下载地址 |
| `--custom-git=<src:branch:url>` | `-G` | 覆盖为自定义 git 仓库 |
| `--custom-local=<src:path>` | `-L` | 使用本地路径作为制品来源 |
Expand Down
14 changes: 14 additions & 0 deletions src/Package/Extension/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Attribute\Package\Validate;
use StaticPHP\Attribute\PatchDescription;
use StaticPHP\Exception\WrongUsageException;
use StaticPHP\Package\PackageBuilder;
use StaticPHP\Package\PackageInstaller;
Expand All @@ -26,6 +27,19 @@ public function validate(PackageBuilder $builder): void
}
}

#[BeforeStage('php', [php::class, 'makeCliForUnix'], 'ext-imap')]
#[PatchDescription('Fix imap zend_zval_value_name() call for PHP 8.2 compatibility')]
public function patchBeforeMake(): void
{
// zend_zval_value_name() was introduced in PHP 8.3; PHP 8.2 imap backported the call but not the declaration
// replace with the equivalent PHP 8.2-compatible function
FileSystem::replaceFileStr(
"{$this->getSourceDir()}/php_imap.c",
'zend_zval_value_name(data)',
'zend_zval_type_name(data)'
);
}

#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-imap')]
public function patchBeforeBuildconf(PackageInstaller $installer): void
{
Expand Down
8 changes: 7 additions & 1 deletion src/Package/Extension/intl.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class intl extends PhpExtensionPackage
{
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-intl')]
#[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support')]
#[PatchDescription('Fix intl config.w32: replace hardcoded true with PHP_INTL_SHARED for static build support; add /std:c++17 required by ICU 73+')]
public function patchBeforeBuildconfForWindows(PackageInstaller $installer): void
{
$php_src = $installer->getTargetPackage('php')->getSourceDir();
Expand All @@ -25,5 +25,11 @@ public function patchBeforeBuildconfForWindows(PackageInstaller $installer): voi
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,',
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,'
);
// ICU 73+ headers (char16ptr.h etc.) unconditionally include <string_view> which requires C++17.
FileSystem::replaceFileStr(
"{$php_src}/ext/intl/config.w32",
'ADD_FLAG("CFLAGS_INTL", "/EHsc',
'ADD_FLAG("CFLAGS_INTL", "/std:c++17 /EHsc'
);
}
}
14 changes: 14 additions & 0 deletions src/Package/Extension/memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ class memcache extends PhpExtensionPackage
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-memcache')]
public function patchBeforeBuildconf(): bool
{
// PHP 8.5 moved php_smart_string*.h from ext/standard/ to Zend/
foreach (['src/memcache_pool.h', 'src/memcache_pool.c', 'src/memcache_session.c', 'src/memcache_ascii_protocol.c', 'src/memcache_binary_protocol.c'] as $file) {
FileSystem::replaceFileStr(
"{$this->getSourceDir()}/{$file}",
'#include "ext/standard/php_smart_string_public.h"',
'#include "Zend/zend_smart_string_public.h"',
);
FileSystem::replaceFileStr(
"{$this->getSourceDir()}/{$file}",
'#include "ext/standard/php_smart_string.h"',
'#include "Zend/zend_smart_string.h"',
);
}

if (!$this->isBuildStatic()) {
return false;
}
Expand Down
12 changes: 9 additions & 3 deletions src/Package/Extension/opentelemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
use Package\Target\php;
use StaticPHP\Attribute\Package\BeforeStage;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Toolchain\Interface\ToolchainInterface;
use StaticPHP\Toolchain\ZigToolchain;
use StaticPHP\Util\GlobalEnvManager;

#[Extension('opentelemetry')]
class opentelemetry
{
#[BeforeStage('php', [php::class, 'makeForUnix'], 'ext-opentelemetry')]
public function patchBeforeMake(): void
public function patchBeforeMake(ToolchainInterface $toolchain): void
{
// add -Wno-strict-prototypes
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
$extra_cflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') ?: '';
$extra_cflags .= ' -Wno-strict-prototypes';
if ($toolchain instanceof ZigToolchain) {
$extra_cflags .= ' -Wno-unknown-warning-option';
}
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . trim($extra_cflags));
}
}
7 changes: 4 additions & 3 deletions src/Package/Extension/zlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Package\PackageBuilder;
use StaticPHP\Package\PackageInstaller;

#[Extension('zlib')]
class zlib
{
#[CustomPhpConfigureArg('Darwin')]
#[CustomPhpConfigureArg('Linux')]
public function unixConfigureArg(PackageBuilder $builder): string
public function unixConfigureArg(PackageBuilder $builder, PackageInstaller $installer): string
{
$zlib_dir = php::getPHPVersionID() >= 80400 ? '' : ' --with-zlib-dir=' . $builder->getBuildRootPath();
return '--with-zlib' . $zlib_dir;
$zlib_dir = (php::getPHPVersionID() >= 80400 && !$installer->getPhpExtensionPackage('spx')) ? '' : " --with-zlib-dir={$builder->getBuildRootPath()}";
return "--with-zlib{$zlib_dir}";
}
}
2 changes: 1 addition & 1 deletion src/Package/Library/mpir.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function build(LibraryPackage $lib): void
{
$vs_ver_dir = ApplicationContext::get('mpir_vs_ver_dir');
cmd()->cd("{$lib->getSourceDir()}{$vs_ver_dir}\\lib_mpir_gc")
->exec('msbuild lib_mpir_gc.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=x64');
->exec('msbuild lib_mpir_gc.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0');
FileSystem::createDir($lib->getLibDir());
FileSystem::createDir($lib->getIncludeDir());
FileSystem::copy("{$lib->getSourceDir()}{$vs_ver_dir}\\lib_mpir_gc\\x64\\Release\\mpir_a.lib", "{$lib->getLibDir()}\\mpir_a.lib");
Expand Down
1 change: 1 addition & 0 deletions src/Package/Library/zstd.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function buildWin(LibraryPackage $package): void
)
->build();
FileSystem::copy($package->getLibDir() . '\zstd_static.lib', $package->getLibDir() . '/zstd.lib');
FileSystem::copy($package->getLibDir() . '\zstd_static.lib', $package->getLibDir() . '/libzstd.lib');
}

#[BuildFor('Linux')]
Expand Down
Loading
Loading