Compare commits

...

29 Commits

Author SHA1 Message Date
crazywhalecc
ed8b606761
add libtool for macos doctor 2023-12-16 15:07:04 +08:00
Jerry Ma
b722b3edd4
Merge pull request #279 from jingjingxyk/feature_upgrade_libpq
upgrade libpq to v16.1
2023-12-16 12:34:36 +08:00
crazywhalecc
9266a4c504
remove ldap test 2023-12-15 23:36:12 +08:00
crazywhalecc
d8ce5f69f4
fix mongodb support for Linux (mac still broken) 2023-12-15 01:31:01 +08:00
crazywhalecc
0cfac49560
adjust package order 2023-12-15 00:34:22 +08:00
crazywhalecc
83dd1bd5c3
Merge branch 'main' into feature_upgrade_libpq 2023-12-10 19:10:39 +08:00
jingjingxyk
bba2d0dbf7 test remove imap ldap extension 2023-11-30 21:29:57 +08:00
jingjingxyk
00689b951b update ldap depends 2023-11-30 14:19:20 +08:00
jingjingxyk
98b7164de3 test libpq build 2023-11-30 13:09:02 +08:00
jingjingxyk
d3e4470e1f test libpq build 2023-11-30 13:06:36 +08:00
jingjingxyk
433c91b68d test libpq build 2023-11-30 13:01:15 +08:00
jingjingxyk
3185d98b1a test libpq build 2023-11-30 13:00:04 +08:00
jingjingxyk
e603e441e7 test libpq build 2023-11-30 12:56:47 +08:00
jingjingxyk
b1bf8bb848 test libpq build 2023-11-30 12:53:19 +08:00
jingjingxyk
b1958ea0c4 test libpq build 2023-11-30 12:37:20 +08:00
jingjingxyk
930849758c swoole.php and LinuxBuilder.php revert 2023-11-29 22:28:20 +08:00
jingjingxyk
7ee431725c test swoole enable pgsql 2023-11-29 22:22:36 +08:00
jingjingxyk
7c866cb0e3 swoole enable pgsql 2023-11-29 22:19:20 +08:00
jingjingxyk
266108b25f test libpq build config 2023-11-29 22:06:30 +08:00
crazywhalecc
82e3a86f17
bypass error: swoole curl hook is buggy for php 8.0 2023-11-29 20:31:53 +08:00
crazywhalecc
ba18819b41
Merge branch 'main' into feature_upgrade_libpq
# Conflicts:
#	src/globals/test-extensions.php
2023-11-29 19:16:40 +08:00
jingjingxyk
6b23c90bba test build libpq 2023-11-29 16:52:53 +08:00
jingjingxyk
400007c206 test change test-extensions 2023-11-29 15:56:52 +08:00
jingjingxyk
443e615066 Merge remote-tracking branch 'origin/feature_upgrade_libpq' into feature_upgrade_libpq 2023-11-29 15:46:26 +08:00
jingjingxyk
ed22945ae2 test 2023-11-29 15:44:04 +08:00
Jerry Ma
5db084ba0e
reduce test extensions 2023-11-29 15:17:21 +08:00
jingjingxyk
c7b3275a72 update libpq build config 2023-11-29 15:06:17 +08:00
Jerry Ma
41cd319d4e
Update test-extensions.php 2023-11-29 14:28:39 +08:00
jingjingxyk
1c307d0d59 upgrade libpq to v16.1 2023-11-29 13:30:12 +08:00
9 changed files with 43 additions and 11 deletions

View File

@ -156,8 +156,9 @@
"liblber.a",
"libldap.a"
],
"lib-suggests": [
"lib-depends": [
"openssl",
"zlib",
"gmp",
"libsodium"
]

View File

@ -386,7 +386,7 @@
},
"postgresql": {
"type": "url",
"url": "https://ftp.postgresql.org/pub/source/v15.1/postgresql-15.1.tar.gz",
"url": "https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz",
"license": {
"type": "file",
"path": "COPYRIGHT"

View File

@ -259,6 +259,19 @@ abstract class BuilderBase
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
}
public function getPHPVersion(): string
{
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
throw new WrongUsageException('PHP source files are not available, you need to download them first');
}
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) {
return $match[1];
}
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
}
/**
* Get build type name string to display.
*

View File

@ -5,11 +5,20 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('mongodb')]
class mongodb extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'if test -z "$PHP_CONFIG"; then', 'if false; then');
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`', 'PHP_MONGODB_PHP_VERSION=' . $this->builder->getPHPVersion());
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`', 'PHP_MONGODB_PHP_VERSION_ID=' . $this->builder->getPHPVersionID());
return true;
}
public function getUnixConfigureArg(): string
{
$arg = ' --enable-mongodb ';

View File

@ -17,7 +17,8 @@ class swoole extends Extension
$arg .= ' --disable-swoole-pgsql';
$arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl';
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli';
$arg .= $this->builder->getExt('curl') ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
// swoole curl hook is buggy for php 8.0
$arg .= $this->builder->getExt('curl') && $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
return $arg;
}
}

View File

@ -15,6 +15,8 @@ trait ldap
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
// libsodium support
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '';
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
shell()->cd($this->source_dir)
->exec(
$this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) .

View File

@ -20,16 +20,22 @@ trait postgresql
{
$builddir = BUILD_ROOT_PATH;
$envs = '';
$packages = 'openssl zlib readline libxml-2.0 zlib';
$packages = 'zlib openssl readline libxml-2.0';
$optional_packages = [
'zstd' => 'libzstd',
'ldap' => 'ldap',
// 'ldap' => 'ldap',
'libxslt' => 'libxslt',
'icu' => 'icu-i18n',
];
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
foreach ($optional_packages as $lib => $pkg) {
if ($this->getBuilder()->getLib($lib)) {
$packages .= ' ' . $pkg;
$output = shell()->execWithResult("pkg-config --static {$pkg}");
logger()->info(var_export($output[1], true));
}
}
@ -58,8 +64,8 @@ trait postgresql
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
shell()->cd($this->source_dir . '/build')
->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile')
->exec('sed -i.backup "293 s/^/#$/" ../src/Makefile.shlib')
->exec('sed -i.backup "441 s/^/#$/" ../src/Makefile.shlib');
->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
// configure
shell()->cd($this->source_dir . '/build')
@ -72,7 +78,7 @@ trait postgresql
'--with-readline ' .
'--with-libxml ' .
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
'--without-ldap ' .
($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') .
($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') .
'--without-lz4 ' .
@ -82,15 +88,14 @@ trait postgresql
'--without-bonjour ' .
'--without-tcl '
);
// ($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
// build
shell()->cd($this->source_dir . '/build')
->exec($envs . ' make -C src/bin/pg_config install')
->exec($envs . ' make -C src/include install')
->exec($envs . ' make -C src/common install')
->exec($envs . ' make -C src/backend/port install')
->exec($envs . ' make -C src/port install')
->exec($envs . ' make -C src/backend/libpq install')
->exec($envs . ' make -C src/interfaces/libpq install');
// remove dynamic libs

View File

@ -25,6 +25,7 @@ class MacOSToolCheckList
'autoconf',
'automake',
'tar',
'libtool',
'unzip',
'xz',
'gzip',

View File

@ -3,6 +3,6 @@
declare(strict_types=1);
# If you want to test new extensions here, just modify it.
$extensions = 'apcu,bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,intl,mbstring,mbregex,mysqli,mysqlnd,openssl,opcache,pcntl,pdo,pdo_mysql,pdo_sqlite,pdo_pgsql,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib,bz2,event,gmp,imagick,imap,ldap,protobuf,shmop,snappy,soap,swoole,sysvmsg,sysvsem,sysvshm,tidy,zstd';
$extensions = 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib';
echo $extensions;