mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-14 04:15:35 +08:00
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:
@@ -92,6 +92,11 @@
|
|||||||
},
|
},
|
||||||
"type": "wip"
|
"type": "wip"
|
||||||
},
|
},
|
||||||
|
"ev": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ev",
|
||||||
|
"arg-type-windows": "with"
|
||||||
|
},
|
||||||
"event": {
|
"event": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"nasm-x86_64-win": {
|
"nasm-x86_64-win": {
|
||||||
"type": "url",
|
"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": {
|
"extract-files": {
|
||||||
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
||||||
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
||||||
|
|||||||
@@ -92,6 +92,16 @@
|
|||||||
"path": "LICENSE"
|
"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": {
|
"ext-ds": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/ds",
|
"url": "https://pecl.php.net/get/ds",
|
||||||
|
|||||||
31
src/SPC/builder/extension/ev.php
Normal file
31
src/SPC/builder/extension/ev.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ $test_os = [
|
|||||||
'ubuntu-24.04',
|
'ubuntu-24.04',
|
||||||
'ubuntu-22.04-arm',
|
'ubuntu-22.04-arm',
|
||||||
'ubuntu-24.04-arm',
|
'ubuntu-24.04-arm',
|
||||||
|
'windows-latest',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// 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`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'phar',
|
'Linux', 'Darwin' => 'ev',
|
||||||
'Windows' => 'pgsql,pdo_pgsql',
|
'Windows' => 'ev',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
// 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`.
|
// You can use `common`, `bulk`, `minimal` or `none`.
|
||||||
// note: combination is only available for *nix platform. Windows must use `none` combination
|
// note: combination is only available for *nix platform. Windows must use `none` combination
|
||||||
$base_combination = match (PHP_OS_FAMILY) {
|
$base_combination = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'common',
|
'Linux', 'Darwin' => 'minimal',
|
||||||
'Windows' => 'none',
|
'Windows' => 'none',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user