Skip to content

Commit

Permalink
upgrade swoole version v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Dec 18, 2024
1 parent b7fb08a commit 70c64af
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions sapi/src/builder/extension/swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use SwooleCli\Extension;

return function (Preprocessor $p) {
$swoole_tag = 'v5.1.6';
$swoole_tag = 'v6.0.0';
$file = "swoole-{$swoole_tag}.tar.gz";

$url = "https://github.com/swoole/swoole-src/archive/refs/tags/{$swoole_tag}.tar.gz";
Expand All @@ -20,7 +20,7 @@
//call_user_func_array([$ext, 'withDependentLibraries'], $dependentLibraries);
//call_user_func_array([$ext, 'withDependentExtensions'], $dependentExtensions);

$dependentLibraries = ['curl', 'openssl', 'cares', 'zlib', 'brotli', 'nghttp2', 'sqlite3', 'unix_odbc', 'pgsql'];
$dependentLibraries = ['curl', 'openssl', 'cares', 'zlib', 'brotli', 'nghttp2', 'sqlite3', 'unix_odbc', 'pgsql', 'libzstd'];
$dependentExtensions = ['curl', 'openssl', 'sockets', 'mysqlnd', 'pdo'];

$options[] = '--enable-swoole';
Expand All @@ -33,6 +33,18 @@
$options[] = '--enable-swoole-pgsql';
$options[] = '--enable-swoole-sqlite';
$options[] = '--with-swoole-odbc=unixODBC,' . UNIX_ODBC_PREFIX;
$options[] = '--enable-swoole-thread';
$options[] = '--enable-brotli';
$options[] = '--enable-zstd';
$options[] = '--enable-zts';

if ($p->isLinux() && $p->getInputOption('with-iouring')) {
$options[] = '--enable-iouring';
$dependentLibraries[] = 'liburing';
$p->withExportVariable('URING_CFLAGS', '$(pkg-config --cflags --static liburing)');
$p->withExportVariable('URING_LIBS', '$(pkg-config --libs --static liburing)');
}


$p->addExtension((new Extension('swoole'))
->withHomePage('https://github.com/swoole/swoole-src')
Expand All @@ -53,4 +65,8 @@
$p->withVariable('LIBS', '$LIBS ' . ($p->isMacos() ? '-lc++' : '-lstdc++'));
$p->withExportVariable('CARES_CFLAGS', '$(pkg-config --cflags --static libcares)');
$p->withExportVariable('CARES_LIBS', '$(pkg-config --libs --static libcares)');


$p->withExportVariable('ZSTD_CFLAGS', '$(pkg-config --cflags --static libzstd)');
$p->withExportVariable('ZSTD_LIBS', '$(pkg-config --libs --static libzstd)');
};

0 comments on commit 70c64af

Please sign in to comment.