Skip to content

Commit 5476385

Browse files
authored
Update PHP 8.5 to RC3, enable swoole-stdext for upcoming 6.1.0 release. (#944)
2 parents a4b6499 + 56bac35 commit 5476385

File tree

9 files changed

+37
-18
lines changed

9 files changed

+37
-18
lines changed

config/source.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,17 @@
306306
"regex": "/href=\"(?<file>gettext-(?<version>[^\"]+)\\.tar\\.xz)\"/",
307307
"license": {
308308
"type": "file",
309-
"path": "COPYING"
309+
"path": "gettext-runtime/intl/COPYING.LIB"
310310
}
311311
},
312312
"gmp": {
313-
"type": "url",
314-
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz",
313+
"type": "filelist",
314+
"url": "https://gmplib.org/download/gmp/",
315+
"regex": "/href=\"(?<file>gmp-(?<version>[^\"]+)\\.tar\\.xz)\"/",
315316
"provide-pre-built": true,
316317
"alt": {
317-
"type": "ghtagtar",
318-
"repo": "alisw/GMP"
318+
"type": "url",
319+
"url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz"
319320
},
320321
"license": {
321322
"type": "text",

src/SPC/builder/extension/gettext.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ class gettext extends Extension
1515
public function patchBeforeBuildconf(): bool
1616
{
1717
if ($this->builder instanceof MacOSBuilder) {
18-
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gettext/config.m4', 'AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB(intl');
18+
FileSystem::replaceFileStr(
19+
SOURCE_PATH . '/php-src/ext/gettext/config.m4',
20+
['AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB'],
21+
['AC_CHECK_LIB(intl', 'AC_CHECK_LIB([intl'] // new php versions use a bracket
22+
);
1923
}
2024
return true;
2125
}

src/SPC/builder/extension/swoole.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,15 @@ public function getUnixConfigureArg(bool $shared = false): string
6969
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
7070
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
7171
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
72-
7372
if ($this->builder->getExt('swoole-hook-odbc')) {
7473
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
7574
$arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"';
7675
}
7776

77+
if ($this->getExtVersion() >= '6.1.0') {
78+
$arg .= ' --enable-swoole-stdext';
79+
}
80+
7881
if (SPCTarget::getTargetOS() === 'Darwin') {
7982
$arg .= ' ac_cv_lib_pthread_pthread_barrier_init=no';
8083
}

src/SPC/builder/unix/library/gettext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function build(): void
3131
$autoconf->addConfigureArgs('--disable-threads');
3232
}
3333

34-
$autoconf->configure()->make();
34+
$autoconf->configure()->make(dir: $this->getSourceDir() . '/gettext-runtime/intl');
3535
$this->patchLaDependencyPrefix();
3636
}
3737
}

src/SPC/builder/unix/library/libiconv.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ trait libiconv
1010
{
1111
protected function build(): void
1212
{
13-
UnixAutoconfExecutor::create($this)->configure('--enable-extra-encodings')->make();
13+
UnixAutoconfExecutor::create($this)
14+
->configure(
15+
'--enable-extra-encodings',
16+
'--enable-year2038',
17+
)
18+
->make('install-lib', with_install: false)
19+
->make('install-lib', with_install: false, dir: $this->getSourceDir() . '/libcharset');
1420
$this->patchLaDependencyPrefix();
1521
}
1622
}

src/SPC/store/source/PhpSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function fetch(bool $force = false, ?array $config = null, int $lock_as =
1616
{
1717
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
1818
if ($major === '8.5') {
19-
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://github.com/php/php-src/archive/refs/tags/php-8.5.0RC2.tar.gz'], $force);
19+
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://downloads.php.net/~daniels/php-8.5.0RC3.tar.xz'], $force);
2020
} elseif ($major === 'git') {
2121
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
2222
} else {

src/SPC/util/executor/UnixAutoconfExecutor.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ public function getConfigureArgsString(): string
5050
* @param bool $with_clean Whether to clean before building
5151
* @param array $after_env_vars Environment variables postfix
5252
*/
53-
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = []): static
53+
public function make(string $target = '', false|string $with_install = 'install', bool $with_clean = true, array $after_env_vars = [], ?string $dir = null): static
5454
{
55-
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars) {
55+
return $this->seekLogFileOnException(function () use ($target, $with_install, $with_clean, $after_env_vars, $dir) {
56+
$shell = $this->shell;
57+
if ($dir) {
58+
$shell = $shell->cd($dir);
59+
}
5660
if ($with_clean) {
57-
$this->shell->exec('make clean');
61+
$shell->exec('make clean');
5862
}
5963
$after_env_vars_str = $after_env_vars !== [] ? shell()->setEnv($after_env_vars)->getEnvString() : '';
60-
$this->shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
64+
$shell->exec("make -j{$this->library->getBuilder()->concurrency} {$target} {$after_env_vars_str}");
6165
if ($with_install !== false) {
62-
$this->shell->exec("make {$with_install}");
66+
$shell->exec("make {$with_install}");
6367
}
64-
return $this->shell;
68+
return $shell;
6569
});
6670
}
6771

src/SPC/util/shell/UnixShell.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function __construct(?bool $debug = null)
2929

3030
public function exec(string $cmd): static
3131
{
32+
$cmd = clean_spaces($cmd);
3233
/* @phpstan-ignore-next-line */
3334
logger()->info(ConsoleColor::yellow('[EXEC] ') . ConsoleColor::green($cmd));
3435
$original_command = $cmd;

src/globals/test-extensions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// '8.2',
1818
// '8.3',
1919
// '8.4',
20-
// '8.5',
20+
'8.5',
2121
// 'git',
2222
];
2323

@@ -49,7 +49,7 @@
4949

5050
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5151
$extensions = match (PHP_OS_FAMILY) {
52-
'Linux', 'Darwin' => 'event',
52+
'Linux', 'Darwin' => 'gettext',
5353
'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',
5454
};
5555

0 commit comments

Comments
 (0)