mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 23:05:41 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
254764761d | ||
|
|
5f6c1a0f40 | ||
|
|
d5dcd193cf |
4
.github/workflows/release-build.yml
vendored
4
.github/workflows/release-build.yml
vendored
@@ -70,10 +70,10 @@ jobs:
|
|||||||
|
|
||||||
- name: "Generate Executable"
|
- name: "Generate Executable"
|
||||||
run: |
|
run: |
|
||||||
|
bin/spc micro:combine spc.phar -M micro.sfx -O spc -I "memory_limit=2G"
|
||||||
if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
|
if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
|
||||||
cat micro.sfx spc.phar > spc.exe
|
mv spc spc.exe
|
||||||
else
|
else
|
||||||
cat micro.sfx spc.phar > spc
|
|
||||||
chmod +x spc
|
chmod +x spc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -449,7 +449,7 @@
|
|||||||
},
|
},
|
||||||
"postgresql": {
|
"postgresql": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz",
|
"url": "https://ftp.postgresql.org/pub/source/v16.2/postgresql-16.2.tar.bz2",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYRIGHT"
|
"path": "COPYRIGHT"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ use Symfony\Component\Console\Command\ListCommand;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.1.0';
|
public const VERSION = '2.1.1';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,11 +58,17 @@ trait postgresql
|
|||||||
|
|
||||||
FileSystem::resetDir($this->source_dir . '/build');
|
FileSystem::resetDir($this->source_dir . '/build');
|
||||||
|
|
||||||
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
|
$version = $this->getVersion();
|
||||||
shell()->cd($this->source_dir . '/build')
|
// 16.1 workaround
|
||||||
->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile')
|
if (version_compare($version, '16.1') >= 0) {
|
||||||
->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
|
# 有静态链接配置 参考文件: src/interfaces/libpq/Makefile
|
||||||
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
|
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 "278 s/^/# /" ../src/Makefile.shlib')
|
||||||
|
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException('Unsupported version for postgresql: ' . $version . ' !');
|
||||||
|
}
|
||||||
|
|
||||||
// configure
|
// configure
|
||||||
shell()->cd($this->source_dir . '/build')
|
shell()->cd($this->source_dir . '/build')
|
||||||
@@ -101,4 +107,17 @@ trait postgresql
|
|||||||
->exec("rm -rf {$builddir}/lib/*.so")
|
->exec("rm -rf {$builddir}/lib/*.so")
|
||||||
->exec("rm -rf {$builddir}/lib/*.dylib");
|
->exec("rm -rf {$builddir}/lib/*.dylib");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'event,gettext',
|
'Linux', 'Darwin' => 'pgsql,pdo_pgsql',
|
||||||
'Linux', 'Darwin' => 'event,gettext',
|
|
||||||
'Windows' => 'mbstring,pdo_sqlite,mbregex',
|
'Windows' => 'mbstring,pdo_sqlite,mbregex',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user