use the upstream version

This commit is contained in:
henderkes 2025-10-16 23:19:24 +07:00
parent 487c6da4ac
commit 25d7c72b6e
2 changed files with 18 additions and 2 deletions

View File

@ -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",

View File

@ -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;
}
}