Add ext yac (#407)

* add ext yac

* enable yac for windows

* enable yac test for windows

* correct
This commit is contained in:
Jerry Ma 2024-04-12 01:43:27 +08:00 committed by GitHub
parent 99aadd3e73
commit b4ed4ea956
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 46 additions and 2 deletions

View File

@ -623,6 +623,14 @@
"dom" "dom"
] ]
}, },
"yac": {
"type": "external",
"source": "yac",
"arg-type-unix": "custom",
"ext-depends-unix": [
"igbinary"
]
},
"yaml": { "yaml": {
"type": "external", "type": "external",
"source": "yaml", "source": "yaml",

View File

@ -673,6 +673,16 @@
"path": "COPYING" "path": "COPYING"
} }
}, },
"yac": {
"type": "url",
"url": "https://pecl.php.net/get/yac",
"path": "php-src/ext/yac",
"filename": "yac.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"yaml": { "yaml": {
"type": "git", "type": "git",
"path": "php-src/ext/yaml", "path": "php-src/ext/yaml",

View File

@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('yac')]
class yac extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/storage/allocator/yac_allocator.h', 'defined(HAVE_SHM_MMAP_ANON)', 'defined(YAC_ALLOCATOR_H)');
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/serializer/igbinary.c', '#ifdef YAC_ENABLE_IGBINARY', '#if 1');
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/yac/serializer/json.c', '#if YAC_ENABLE_JSON', '#if 1');
return true;
}
public function getUnixConfigureArg(): string
{
return '--enable-yac --enable-igbinary --enable-json';
}
}

View File

@ -13,8 +13,8 @@ declare(strict_types=1);
// 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' => 'pgsql,intl,xml,openssl', 'Linux', 'Darwin' => 'yac',
'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi,ds,simdjson', 'Windows' => 'mbstring,pdo_sqlite,mbregex,yac',
}; };
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).