mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Compare commits
9 Commits
a45f2f357d
...
25a2684e5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25a2684e5a | ||
|
|
13e0e12181 | ||
|
|
81df124b42 | ||
|
|
d3d8230a09 | ||
|
|
d4eb199504 | ||
|
|
6562bc200c | ||
|
|
0b322f494b | ||
|
|
ceed1005cc | ||
|
|
6efcb75224 |
40
.github/workflows/download-cache.yml
vendored
40
.github/workflows/download-cache.yml
vendored
@ -1,40 +0,0 @@
|
||||
name: archive download sources weekly
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "* 14 * * 5"
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
download:
|
||||
name: cache download sources
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: [ "8.0", "8.1", "8.2", "8.3" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Cache composer dependencies
|
||||
- id: cache-composer-deps
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: vendor
|
||||
key: composer-dependencies
|
||||
|
||||
# If there's no Composer cache, install dependencies
|
||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||
run: composer update --no-dev
|
||||
|
||||
# If there's no dependencies cache, fetch sources, with or without debug
|
||||
- if: steps.cache-download.outputs.cache-hit != 'true'
|
||||
run: ./bin/spc download --with-php=${{ matrix.php-version }} --all --debug
|
||||
|
||||
# Upload downloaded files
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: download-files-${{ matrix.php-version }}
|
||||
path: downloads/
|
||||
@ -14,10 +14,10 @@ Build single static PHP binary, with PHP project together, with popular extensio
|
||||
|
||||
> 该 SAPI 源自 [dixyes/phpmicro](https://github.com/dixyes/phpmicro) 的 [Fork 仓库](https://github.com/static-php/phpmicro)。
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml)
|
||||
[]()
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||
[]()
|
||||
[]()
|
||||
|
||||
> 项目名称是 static-php-cli,但其实支持 cli、fpm、micro 和 embed SAPI 😎
|
||||
|
||||
@ -18,11 +18,10 @@ You can also use the micro binary file to combine php binary and php source code
|
||||
|
||||
> This SAPI feature is from the [Fork](https://github.com/static-php/phpmicro) of [dixyes/phpmicro](https://github.com/dixyes/phpmicro).
|
||||
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||
|
||||
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
||||
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
||||
[]()
|
||||
|
||||
## Documentation
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
"brotli": {
|
||||
"source": "brotli",
|
||||
"static-libs-unix": [
|
||||
"libbrotlidec-static.a",
|
||||
"libbrotlienc-static.a",
|
||||
"libbrotlicommon-static.a"
|
||||
"libbrotlidec.a",
|
||||
"libbrotlienc.a",
|
||||
"libbrotlicommon.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"brotlicommon-static.lib",
|
||||
"brotlienc-static.lib",
|
||||
"brotlidec-static.lib"
|
||||
"brotlicommon.lib",
|
||||
"brotlienc.lib",
|
||||
"brotlidec.lib"
|
||||
],
|
||||
"headers": [
|
||||
"brotli"
|
||||
|
||||
23
src/SPC/builder/extension/ldap.php
Normal file
23
src/SPC/builder/extension/ldap.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('ldap')]
|
||||
class ldap extends Extension
|
||||
{
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
$output = shell()->execWithResult('$PKG_CONFIG --libs-only-l --static ldap');
|
||||
if (!empty($output[1][0])) {
|
||||
$libs = $output[1][0];
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/configure', '-lldap ', $libs . ' ');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -27,11 +27,7 @@ trait brotli
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['libbrotlicommon.pc', 'libbrotlidec.pc', 'libbrotlienc.pc']);
|
||||
shell()->cd(BUILD_ROOT_PATH . '/lib')
|
||||
->exec('cp libbrotlicommon.a libbrotlicommon-static.a')
|
||||
->exec('ln -sf libbrotlicommon.a libbrotli.a')
|
||||
->exec('cp libbrotlidec.a libbrotlidec-static.a')
|
||||
->exec('cp libbrotlienc.a libbrotlienc-static.a');
|
||||
shell()->cd(BUILD_ROOT_PATH . '/lib')->exec('ln -sf libbrotlicommon.a libbrotli.a');
|
||||
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
|
||||
if (str_starts_with($filename, 'libbrotli') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
||||
unlink(BUILD_ROOT_PATH . '/lib/' . $filename);
|
||||
|
||||
@ -4,17 +4,25 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
trait ldap
|
||||
{
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr($this->source_dir . '/configure', '"-lssl -lcrypto', '"-lssl -lcrypto -lz');
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
$alt = '';
|
||||
// openssl support
|
||||
$alt .= $this->builder->getLib('openssl') && $this->builder->getExt('zlib') ? '--with-tls=openssl ' : '';
|
||||
$alt .= $this->builder->getLib('openssl') ? '--with-tls=openssl ' : '';
|
||||
// gmp support
|
||||
$alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : '';
|
||||
// libsodium support
|
||||
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '';
|
||||
$alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : '--enable-argon2=no ';
|
||||
f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config');
|
||||
f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
||||
shell()->cd($this->source_dir)
|
||||
@ -24,7 +32,6 @@ trait ldap
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
'--disable-slapd ' .
|
||||
'--disable-slurpd ' .
|
||||
'--without-systemd ' .
|
||||
'--without-cyrus-sasl ' .
|
||||
$alt .
|
||||
|
||||
@ -7,6 +7,7 @@ namespace SPC\command;
|
||||
use SPC\builder\BuilderProvider;
|
||||
use SPC\exception\ExceptionHandler;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\DependencyUtil;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -59,6 +60,7 @@ class BuildLibsCommand extends BuildCommand
|
||||
// 只编译 library 的情况下,标记
|
||||
$builder->setLibsOnly();
|
||||
// 编译和检查库完整
|
||||
$libraries = DependencyUtil::getLibsByDeps($libraries);
|
||||
$builder->buildLibs($libraries);
|
||||
|
||||
$time = round(microtime(true) - START_TIME, 3);
|
||||
|
||||
@ -17,7 +17,7 @@ $with_libs = '';
|
||||
|
||||
// Please change your test base combination. We recommend testing with `common`.
|
||||
// You can use `common`, `bulk`, `minimal` or `none`.
|
||||
$base_combination = 'common';
|
||||
$base_combination = 'minimal';
|
||||
|
||||
// -------------------------- code area, do not modify --------------------------
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user