Skip to content
11 changes: 6 additions & 5 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,17 @@
"regex": "/href=\"(?<file>gettext-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"license": {
"type": "file",
"path": "COPYING"
"path": "gettext-runtime/intl/COPYING.LIB"
}
},
"gmp": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz",
"type": "filelist",
"url": "https://gmplib.org/download/gmp/",
"regex": "/href=\"(?<file>gmp-(?<version>[^\"]+)\\.tar\\.xz)\"/",
"provide-pre-built": true,
"alt": {
"type": "ghtagtar",
"repo": "alisw/GMP"
"type": "url",
Copy link
Owner

@crazywhalecc crazywhalecc Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alt will have default value link to https://dl.static-php.dev/static-php-cli/deps/spc-download-mirror/gmp/gmp-spc-mirror.tar.xz if we haven't defined alt.

Also I don't think we need to change it to crawler for gmp. gmplib.org often down and only updated once every few years.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll monitor how often it's down over the next weeks. I still think we should auto-updating sources where ever possible.

"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz"
},
"license": {
"type": "text",
Expand Down
5 changes: 4 additions & 1 deletion src/SPC/builder/extension/swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ public function getUnixConfigureArg(bool $shared = false): string
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';

if ($this->builder->getExt('swoole-hook-odbc')) {
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
$arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"';
}

if ($this->getExtVersion() >= '6.1.0') {
$arg .= ' --enable-swoole-stdext';
}

if (SPCTarget::getTargetOS() === 'Darwin') {
$arg .= ' ac_cv_lib_pthread_pthread_barrier_init=no';
}
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/builder/unix/library/gettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function build(): void
$autoconf->addConfigureArgs('--disable-threads');
}

$autoconf->configure()->make();
$autoconf->configure()->make(dir: $this->getSourceDir() . '/gettext-runtime/intl');
$this->patchLaDependencyPrefix();
}
}
8 changes: 7 additions & 1 deletion src/SPC/builder/unix/library/libiconv.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ trait libiconv
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)->configure('--enable-extra-encodings')->make();
UnixAutoconfExecutor::create($this)
->configure(
'--enable-extra-encodings',
'--enable-year2038',
)
->make('install-lib', with_install: false)
->make('install-lib', with_install: false, dir: $this->getSourceDir() . '/libcharset');
$this->patchLaDependencyPrefix();
}
}
2 changes: 1 addition & 1 deletion src/SPC/store/source/PhpSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function fetch(bool $force = false, ?array $config = null, int $lock_as =
{
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
if ($major === '8.5') {
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://github.com/php/php-src/archive/refs/tags/php-8.5.0RC2.tar.gz'], $force);
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://github.com/php/php-src/archive/refs/tags/php-8.5.0RC3.tar.gz'], $force);
} elseif ($major === 'git') {
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
} else {
Expand Down
16 changes: 10 additions & 6 deletions src/SPC/util/executor/UnixAutoconfExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,22 @@ public function getConfigureArgsString(): string
* @param bool $with_clean Whether to clean before building
* @param array $after_env_vars Environment variables postfix
*/
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = []): static
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = [], ?string $dir = null): static
{
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars) {
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars, $dir) {
$shell = $this->shell;
if ($dir) {
$shell = $shell->cd($dir);
}
if ($with_clean) {
$this->shell->exec('make clean');
$shell->exec('make clean');
}
$after_env_vars_str = $after_env_vars !== [] ? shell()->setEnv($after_env_vars)->getEnvString() : '';
$this->shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
$shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
if ($with_install !== false) {
$this->shell->exec("make {$with_install}");
$shell->exec("make {$with_install}");
}
return $this->shell;
return $shell;
});
}

Expand Down
1 change: 1 addition & 0 deletions src/SPC/util/shell/UnixShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function __construct(?bool $debug = null)

public function exec(string $cmd): static
{
$cmd = clean_spaces($cmd);
/* @phpstan-ignore-next-line */
logger()->info(ConsoleColor::yellow('[EXEC] ') . ConsoleColor::green($cmd));
$original_command = $cmd;
Expand Down
8 changes: 4 additions & 4 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
// '8.1',
// '8.2',
// '8.3',
'8.4',
// '8.5',
// '8.4',
'8.5',
// 'git',
];

// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
$test_os = [
'macos-15-intel', // bin/spc for x86_64
'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-24.04', // bin/spc for x86_64
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
Expand All @@ -49,7 +49,7 @@

// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'spx',
'Linux', 'Darwin' => 'gettext',
'Windows' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pdo,pdo_mysql,pdo_sqlite,phar,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip',
};

Expand Down
Loading