Add extension ev support (#703)

* Add extension ev support

* Sort config

* Correct ev build arg for windows

* Use static-php mirror of nasm

* Fix windows ev patch

* Oops
This commit is contained in:
Jerry Ma 2025-04-19 20:39:48 +08:00 committed by GitHub
parent a236ee3ac3
commit a7adec1341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 51 additions and 4 deletions

View File

@ -92,6 +92,11 @@
},
"type": "wip"
},
"ev": {
"type": "external",
"source": "ev",
"arg-type-windows": "with"
},
"event": {
"support": {
"Windows": "wip",

View File

@ -9,7 +9,7 @@
},
"nasm-x86_64-win": {
"type": "url",
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
"url": "https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip",
"extract-files": {
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"

View File

@ -92,6 +92,16 @@
"path": "LICENSE"
}
},
"ev": {
"type": "url",
"url": "https://pecl.php.net/get/ev",
"path": "php-src/ext/ev",
"filename": "ev.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-ds": {
"type": "url",
"url": "https://pecl.php.net/get/ds",

View File

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\FileSystemException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('ev')]
class ev extends Extension
{
/**
* @throws FileSystemException
*/
public function patchBeforeBuildconf(): bool
{
/*
* replace EXTENSION('ev', php_ev_sources, true, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
* to EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
*/
FileSystem::replaceFileLineContainsString(
$this->source_dir . '/config.w32',
'EXTENSION(\'ev\'',
" EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');"
);
return true;
}
}

View File

@ -28,6 +28,7 @@ $test_os = [
'ubuntu-24.04',
'ubuntu-22.04-arm',
'ubuntu-24.04-arm',
'windows-latest',
];
// whether enable thread safe
@ -43,8 +44,8 @@ $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' => 'phar',
'Windows' => 'pgsql,pdo_pgsql',
'Linux', 'Darwin' => 'ev',
'Windows' => 'ev',
};
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
@ -63,7 +64,7 @@ $with_libs = match (PHP_OS_FAMILY) {
// You can use `common`, `bulk`, `minimal` or `none`.
// note: combination is only available for *nix platform. Windows must use `none` combination
$base_combination = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'common',
'Linux', 'Darwin' => 'minimal',
'Windows' => 'none',
};