From 25d7c72b6efb58d527b5bd6163a95bf2c5b3048c Mon Sep 17 00:00:00 2001 From: henderkes Date: Thu, 16 Oct 2025 23:19:24 +0700 Subject: [PATCH] use the upstream version --- config/source.json | 2 +- src/SPC/builder/extension/spx.php | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config/source.json b/config/source.json index 40a44f2d..1546b23b 100644 --- a/config/source.json +++ b/config/source.json @@ -1001,7 +1001,7 @@ "spx": { "type": "git", "rev": "master", - "url": "https://github.com/static-php/php-spx.git", + "url": "https://github.com/NoiseByNorthwest/php-spx.git", "path": "php-src/ext/spx", "license": { "type": "file", diff --git a/src/SPC/builder/extension/spx.php b/src/SPC/builder/extension/spx.php index f5e736d5..a5a8ad71 100644 --- a/src/SPC/builder/extension/spx.php +++ b/src/SPC/builder/extension/spx.php @@ -13,7 +13,7 @@ class spx extends Extension { public function getUnixConfigureArg(bool $shared = false): string { - $arg = '--enable-spx' . ($shared ? '=shared' : ''); + $arg = '--enable-SPX' . ($shared ? '=shared' : ''); if ($this->builder->getLib('zlib') !== null) { $arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH; } @@ -29,4 +29,20 @@ class spx extends Extension ); return true; } + + public function patchBeforeBuildconf(): bool + { + FileSystem::replaceFileStr( + $this->source_dir . '/config.m4', + 'CFLAGS="$CFLAGS -Werror -Wall -O3 -pthread -std=gnu90"', + 'CFLAGS="$CFLAGS -pthread"' + ); + FileSystem::replaceFileStr( + $this->source_dir . '/src/php_spx.h', + "extern zend_module_entry spx_module_entry;\n", + "extern zend_module_entry spx_module_entry;;\n#define phpext_spx_ptr &spx_module_entry\n" + ); + FileSystem::copy($this->source_dir . '/src/php_spx.h', $this->source_dir . '/php_spx.h'); + return true; + } }