add macOS support for pgsql

This commit is contained in:
crazywhalecc 2023-07-22 15:07:53 +08:00
parent 085437e925
commit bc978ecbde
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,8 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\builder\macos\library\MacOSLibraryBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
@ -30,7 +32,7 @@ trait postgresql
$output = shell()->execWithResult($env . ' pkg-config --libs-only-L --static ' . $packages);
if (!empty($output[1][0])) {
$ldflags = $output[1][0];
$envs .= " LDFLAGS=\"{$ldflags} -static\" ";
$envs .= $this instanceof MacOSLibraryBase ? " LDFLAGS=\"{$ldflags}\" " : " LDFLAGS=\"{$ldflags} -static\" ";
}
$output = shell()->execWithResult($env . ' pkg-config --libs-only-l --static ' . $packages);
if (!empty($output[1][0])) {

View File

@ -88,6 +88,9 @@ class SourcePatcher
if ($ssh2 = $builder->getExt('ssh2')) {
$patch[] = ['ssh2 patch', '/-lssh2/', $ssh2->getLibFilesString()];
}
if ($pgsql = $builder->getExt('pgsql')) {
$patch[] = ['pgsql patch', '/-lpq/', $pgsql->getLibFilesString()];
}
$patch[] = ['disable capstone', '/have_capstone="yes"/', 'have_capstone="no"'];
foreach ($patch as $item) {
logger()->info('Patching configure: ' . $item[0]);