use the spx upstream version (#931)

This commit is contained in:
Marc 2025-10-17 23:55:37 +07:00 committed by GitHub
commit 9ed77c10e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View File

@ -1001,7 +1001,7 @@
"spx": { "spx": {
"type": "git", "type": "git",
"rev": "master", "rev": "master",
"url": "https://github.com/static-php/php-spx.git", "url": "https://github.com/NoiseByNorthwest/php-spx.git",
"path": "php-src/ext/spx", "path": "php-src/ext/spx",
"license": { "license": {
"type": "file", "type": "file",

View File

@ -13,7 +13,7 @@ class spx extends Extension
{ {
public function getUnixConfigureArg(bool $shared = false): string public function getUnixConfigureArg(bool $shared = false): string
{ {
$arg = '--enable-spx' . ($shared ? '=shared' : ''); $arg = '--enable-SPX' . ($shared ? '=shared' : '');
if ($this->builder->getLib('zlib') !== null) { if ($this->builder->getLib('zlib') !== null) {
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH; $arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
} }
@ -29,4 +29,20 @@ class spx extends Extension
); );
return true; 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;
}
} }