diff --git a/config/ext.json b/config/ext.json index 5a3ebbd4..a5eca9f4 100644 --- a/config/ext.json +++ b/config/ext.json @@ -233,7 +233,7 @@ }, "type": "external", "source": "grpc", - "arg-type-unix": "with-prefix", + "arg-type-unix": "custom", "cpp-extension": true, "lib-depends": [ "grpc" diff --git a/config/lib.json b/config/lib.json index e784b889..92b625be 100644 --- a/config/lib.json +++ b/config/lib.json @@ -193,6 +193,7 @@ "openssl", "libcares" ], + "provide-pre-built": true, "frameworks": [ "CoreFoundation" ] diff --git a/src/SPC/builder/extension/grpc.php b/src/SPC/builder/extension/grpc.php index 92deaf06..115c82af 100644 --- a/src/SPC/builder/extension/grpc.php +++ b/src/SPC/builder/extension/grpc.php @@ -28,7 +28,6 @@ class grpc extends Extension } else { throw new \RuntimeException('Cannot find grpc source code'); } - FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/grpc/config.m4', 'PHP_ARG_ENABLE(grpc,', 'PHP_ARG_WITH(grpc,'); if (SPCTarget::getTargetOS() === 'Darwin') { FileSystem::replaceFileRegex( SOURCE_PATH . '/php-src/ext/grpc/config.m4', @@ -46,6 +45,11 @@ class grpc extends Extension return true; } + public function getUnixConfigureArg(bool $shared = false): string + { + return '--enable-grpc=' . ($shared ? 'shared' : '') . BUILD_ROOT_PATH; + } + public function patchBeforeMake(): bool { $extra_libs = trim(getenv('SPC_EXTRA_LIBS'));