Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/SPC/builder/extension/grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ public function patchBeforeBuildconf(): bool
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 . '"');
Expand Down
1 change: 1 addition & 0 deletions src/SPC/builder/unix/library/grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ protected function build(): void
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');
}
}
8 changes: 4 additions & 4 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

// test php version
$test_php_version = [
'8.1',
'8.2',
// '8.1',
// '8.2',
'8.3',
'8.4',
];
Expand All @@ -36,11 +36,11 @@
$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',
};

Expand Down
Loading