mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge branch 'main' into feature_upgrade_libpq
# Conflicts: # src/globals/test-extensions.php
This commit is contained in:
commit
ba18819b41
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\builder\linux\LinuxBuilder;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('imagick')]
|
||||
@ -14,7 +15,9 @@ class imagick extends Extension
|
||||
{
|
||||
// imagick may call omp_pause_all which requires -lgomp
|
||||
$extra_libs = $this->builder->getOption('extra-libs', '');
|
||||
$extra_libs .= ' -lgomp ';
|
||||
if ($this->builder instanceof LinuxBuilder) {
|
||||
$extra_libs .= ' -lgomp ';
|
||||
}
|
||||
$this->builder->setOption('extra-libs', $extra_libs);
|
||||
return true;
|
||||
}
|
||||
|
||||
35
src/SPC/builder/extension/sodium.php
Normal file
35
src/SPC/builder/extension/sodium.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('sodium')]
|
||||
class sodium extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
// bypass error: unknown warning option '-Wno-logical-op' for macOS
|
||||
return $this->removeLineContainingString();
|
||||
}
|
||||
|
||||
private function removeLineContainingString(): bool
|
||||
{
|
||||
$path = SOURCE_PATH . '/php-src/ext/sodium/config.m4';
|
||||
$search = '-Wno-logical-op';
|
||||
if (!file_exists($path)) {
|
||||
return false;
|
||||
}
|
||||
$content = file_get_contents($path);
|
||||
$lines = preg_split('/\r\n|\n/', $content);
|
||||
$filteredLines = array_filter($lines, function ($line) use ($search) {
|
||||
return strpos($line, $search) === false;
|
||||
});
|
||||
$newContent = implode("\n", $filteredLines);
|
||||
file_put_contents($path, $newContent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ 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;
|
||||
@ -39,8 +40,12 @@ trait imagemagick
|
||||
}
|
||||
|
||||
$ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : '';
|
||||
|
||||
// libxml iconv patch
|
||||
$required_libs .= $this instanceof MacOSLibraryBase ? (' -liconv') : '';
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(
|
||||
'PKG_CONFIG="$PKG_CONFIG --static" ' .
|
||||
$ldflags .
|
||||
"LIBS='{$required_libs}' " .
|
||||
'./configure ' .
|
||||
|
||||
@ -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,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';
|
||||
|
||||
echo $extensions;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user