diff --git a/config/source.json b/config/source.json index 8a2aaf62..349ba68c 100644 --- a/config/source.json +++ b/config/source.json @@ -306,16 +306,17 @@ "regex": "/href=\"(?gettext-(?[^\"]+)\\.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=\"(?gmp-(?[^\"]+)\\.tar\\.xz)\"/", "provide-pre-built": true, "alt": { - "type": "ghtagtar", - "repo": "alisw/GMP" + "type": "url", + "url": "https://dl.static-php.dev/static-php-cli/deps/gmp/gmp-6.3.0.tar.xz" }, "license": { "type": "text", diff --git a/src/SPC/builder/extension/gettext.php b/src/SPC/builder/extension/gettext.php index dc4f58aa..303cc389 100644 --- a/src/SPC/builder/extension/gettext.php +++ b/src/SPC/builder/extension/gettext.php @@ -15,7 +15,11 @@ class gettext extends Extension public function patchBeforeBuildconf(): bool { if ($this->builder instanceof MacOSBuilder) { - FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gettext/config.m4', 'AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB(intl'); + FileSystem::replaceFileStr( + SOURCE_PATH . '/php-src/ext/gettext/config.m4', + ['AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB', 'AC_CHECK_LIB([$GETTEXT_CHECK_IN_LIB'], + ['AC_CHECK_LIB(intl', 'AC_CHECK_LIB([intl'] // new php versions use a bracket + ); } return true; } diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index a4a531cf..7ff4b331 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -69,12 +69,15 @@ class swoole extends Extension $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'; } diff --git a/src/SPC/builder/unix/library/gettext.php b/src/SPC/builder/unix/library/gettext.php index f0fdae54..332e25c9 100644 --- a/src/SPC/builder/unix/library/gettext.php +++ b/src/SPC/builder/unix/library/gettext.php @@ -31,7 +31,7 @@ trait gettext $autoconf->addConfigureArgs('--disable-threads'); } - $autoconf->configure()->make(); + $autoconf->configure()->make(dir: $this->getSourceDir() . '/gettext-runtime/intl'); $this->patchLaDependencyPrefix(); } } diff --git a/src/SPC/builder/unix/library/libiconv.php b/src/SPC/builder/unix/library/libiconv.php index fd68e309..5ccc9484 100644 --- a/src/SPC/builder/unix/library/libiconv.php +++ b/src/SPC/builder/unix/library/libiconv.php @@ -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(); } } diff --git a/src/SPC/store/source/PhpSource.php b/src/SPC/store/source/PhpSource.php index ca6b6b6f..1c0be85f 100644 --- a/src/SPC/store/source/PhpSource.php +++ b/src/SPC/store/source/PhpSource.php @@ -16,7 +16,7 @@ class PhpSource extends CustomSourceBase { $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://downloads.php.net/~daniels/php-8.5.0RC3.tar.xz'], $force); } elseif ($major === 'git') { Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force); } else { diff --git a/src/SPC/util/executor/UnixAutoconfExecutor.php b/src/SPC/util/executor/UnixAutoconfExecutor.php index 075d7fd3..f196cb1c 100644 --- a/src/SPC/util/executor/UnixAutoconfExecutor.php +++ b/src/SPC/util/executor/UnixAutoconfExecutor.php @@ -50,18 +50,22 @@ class UnixAutoconfExecutor extends Executor * @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; }); } diff --git a/src/SPC/util/shell/UnixShell.php b/src/SPC/util/shell/UnixShell.php index b8d038b0..2fdc1b07 100644 --- a/src/SPC/util/shell/UnixShell.php +++ b/src/SPC/util/shell/UnixShell.php @@ -29,6 +29,7 @@ class UnixShell extends Shell 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; diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index ade41c32..5aef4bd8 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -17,7 +17,7 @@ $test_php_version = [ // '8.2', // '8.3', // '8.4', - // '8.5', + '8.5', // 'git', ]; @@ -49,7 +49,7 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'event', + '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', };