mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 21:34:53 +08:00
Add missing ext source when downloading pre-built grpc (#652)
* Add missing ext source when downloading pre-built grpc * Add tests
This commit is contained in:
parent
a2476690c2
commit
b1931059a5
@ -22,7 +22,13 @@ class grpc extends Extension
|
||||
throw new \RuntimeException('grpc extension does not support windows yet');
|
||||
}
|
||||
if (!is_link(SOURCE_PATH . '/php-src/ext/grpc')) {
|
||||
shell()->exec('ln -s ' . $this->builder->getLib('grpc')->getSourceDir() . '/src/php/ext/grpc ' . SOURCE_PATH . '/php-src/ext/grpc');
|
||||
if (is_dir($this->builder->getLib('grpc')->getSourceDir() . '/src/php/ext/grpc')) {
|
||||
shell()->exec('ln -s ' . $this->builder->getLib('grpc')->getSourceDir() . '/src/php/ext/grpc ' . SOURCE_PATH . '/php-src/ext/grpc');
|
||||
} elseif (is_dir(BUILD_ROOT_PATH . '/grpc_php_ext_src')) {
|
||||
shell()->exec('ln -s ' . BUILD_ROOT_PATH . '/grpc_php_ext_src ' . SOURCE_PATH . '/php-src/ext/grpc');
|
||||
} else {
|
||||
throw new \RuntimeException('Cannot find grpc source code');
|
||||
}
|
||||
$macos = $this->builder instanceof MacOSBuilder ? "\n" . ' LDFLAGS="$LDFLAGS -framework CoreFoundation"' : '';
|
||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/ext/grpc/config.m4', '/GRPC_LIBDIR=.*$/m', 'GRPC_LIBDIR=' . BUILD_LIB_PATH . $macos);
|
||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/ext/grpc/config.m4', '/SEARCH_PATH=.*$/m', 'SEARCH_PATH="' . BUILD_ROOT_PATH . '"');
|
||||
|
||||
@ -20,5 +20,6 @@ trait grpc
|
||||
FileSystem::copyDir($this->source_dir . '/include/grpc', BUILD_INCLUDE_PATH . '/grpc');
|
||||
FileSystem::copyDir($this->source_dir . '/include/grpc++', BUILD_INCLUDE_PATH . '/grpc++');
|
||||
FileSystem::copyDir($this->source_dir . '/include/grpcpp', BUILD_INCLUDE_PATH . '/grpcpp');
|
||||
FileSystem::copyDir($this->source_dir . '/src/php/ext/grpc', BUILD_ROOT_PATH . '/grpc_php_ext_src');
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,8 @@ declare(strict_types=1);
|
||||
|
||||
// test php version
|
||||
$test_php_version = [
|
||||
'8.1',
|
||||
'8.2',
|
||||
// '8.1',
|
||||
// '8.2',
|
||||
'8.3',
|
||||
'8.4',
|
||||
];
|
||||
@ -36,11 +36,11 @@ $no_strip = false;
|
||||
$upx = false;
|
||||
|
||||
// prefer downloading pre-built packages to speed up the build process
|
||||
$prefer_pre_built = false;
|
||||
$prefer_pre_built = true;
|
||||
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'gettext',
|
||||
'Linux', 'Darwin' => 'grpc',
|
||||
'Windows' => 'bcmath',
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user