mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
update pgsql version to 18.0
This commit is contained in:
parent
384ba54c79
commit
3966bd5f0a
@ -880,7 +880,7 @@
|
|||||||
"postgresql": {
|
"postgresql": {
|
||||||
"type": "ghtagtar",
|
"type": "ghtagtar",
|
||||||
"repo": "postgres/postgres",
|
"repo": "postgres/postgres",
|
||||||
"match": "REL_16_\\d+",
|
"match": "REL_18_\\d+",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYRIGHT"
|
"path": "COPYRIGHT"
|
||||||
|
|||||||
@ -6,7 +6,6 @@ namespace SPC\builder\unix\library;
|
|||||||
|
|
||||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||||
use SPC\exception\BuildFailureException;
|
use SPC\exception\BuildFailureException;
|
||||||
use SPC\exception\FileSystemException;
|
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\SPCTarget;
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
@ -65,17 +64,18 @@ trait postgresql
|
|||||||
|
|
||||||
FileSystem::resetDir($this->source_dir . '/build');
|
FileSystem::resetDir($this->source_dir . '/build');
|
||||||
|
|
||||||
$version = $this->getVersion();
|
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
|
||||||
// 16.1 workaround
|
shell()->cd($this->source_dir . '/build')
|
||||||
if (version_compare($version, '16.1') >= 0) {
|
->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile')
|
||||||
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
|
->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
|
||||||
shell()->cd($this->source_dir . '/build')
|
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
|
||||||
->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile')
|
|
||||||
->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
|
// php source relies on the non-private encoding functions in libpgcommon.a
|
||||||
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
|
FileSystem::replaceFileStr(
|
||||||
} else {
|
$this->source_dir . '/src/common/Makefile',
|
||||||
throw new BuildFailureException('Unsupported version for postgresql: ' . $version . ' !');
|
'$(OBJS_FRONTEND): CPPFLAGS += -DUSE_PRIVATE_ENCODING_FUNCS',
|
||||||
}
|
'$(OBJS_FRONTEND): CPPFLAGS += -UUSE_PRIVATE_ENCODING_FUNCS',
|
||||||
|
);
|
||||||
|
|
||||||
// configure
|
// configure
|
||||||
shell()->cd($this->source_dir . '/build')->initializeEnv($this)
|
shell()->cd($this->source_dir . '/build')->initializeEnv($this)
|
||||||
@ -83,14 +83,12 @@ trait postgresql
|
|||||||
->exec(
|
->exec(
|
||||||
"{$envs} ../configure " .
|
"{$envs} ../configure " .
|
||||||
"--prefix={$builddir} " .
|
"--prefix={$builddir} " .
|
||||||
($this->builder->getOption('enable-zts') ? '--enable-thread-safety ' : '--disable-thread-safety ') .
|
|
||||||
'--enable-coverage=no ' .
|
'--enable-coverage=no ' .
|
||||||
'--with-ssl=openssl ' .
|
'--with-ssl=openssl ' .
|
||||||
'--with-readline ' .
|
'--with-readline ' .
|
||||||
'--with-libxml ' .
|
'--with-libxml ' .
|
||||||
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
|
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
|
||||||
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
|
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
|
||||||
// '--without-ldap ' .
|
|
||||||
($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') .
|
($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') .
|
||||||
($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') .
|
($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') .
|
||||||
'--without-lz4 ' .
|
'--without-lz4 ' .
|
||||||
@ -114,17 +112,4 @@ trait postgresql
|
|||||||
|
|
||||||
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/pkgconfig/libpq.pc', '-lldap', '-lldap -llber');
|
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/pkgconfig/libpq.pc', '-lldap', '-lldap -llber');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getVersion(): string
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$file = FileSystem::readFile($this->source_dir . '/meson.build');
|
|
||||||
if (preg_match("/^\\s+version:\\s?'(.*)'/m", $file, $match)) {
|
|
||||||
return $match[1];
|
|
||||||
}
|
|
||||||
return 'unknown';
|
|
||||||
} catch (FileSystemException) {
|
|
||||||
return 'unknown';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user