diff --git a/config/pkg/ext/ext-clickhouse.yml b/config/pkg/ext/ext-clickhouse.yml new file mode 100644 index 00000000..3e8479bd --- /dev/null +++ b/config/pkg/ext/ext-clickhouse.yml @@ -0,0 +1,19 @@ +ext-clickhouse: + type: php-extension + artifact: + source: + type: ghtar + repo: iliaal/php_clickhouse + extract: php-src/ext/clickhouse + prefer-stable: true + metadata: + license-files: [LICENSE] + license: PHP-3.01 + suggests@unix: + - openssl + lang: cpp + php-extension: + os: + - Linux + - Darwin + arg-type@unix: custom diff --git a/src/Package/Extension/clickhouse.php b/src/Package/Extension/clickhouse.php new file mode 100644 index 00000000..3e11975f --- /dev/null +++ b/src/Package/Extension/clickhouse.php @@ -0,0 +1,40 @@ +getSourceDir()}/config.m4", + '/^(\s*)THIS_DIR=.*/m', + '$1THIS_DIR=PHP_EXT_SRCDIR()', + ); + } + + #[CustomPhpConfigureArg('Darwin')] + #[CustomPhpConfigureArg('Linux')] + public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string + { + $arg = '--enable-clickhouse' . ($shared ? '=shared' : ''); + if ($installer->getLibraryPackage('openssl')) { + $arg .= ' --enable-clickhouse-openssl'; + } + return $arg; + } +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 8281f88b..2e6e807e 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -50,7 +50,7 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'curl,swoole', + 'Linux', 'Darwin' => 'openssl,zstd,clickhouse', 'Windows' => 'intl', };