mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge branch 'main' into sapi/cgi
# Conflicts: # composer.lock
This commit is contained in:
commit
fe945ab3ea
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ packlib_files.txt
|
||||
/bin/*
|
||||
!/bin/spc*
|
||||
!/bin/setup-runtime*
|
||||
!/bin/docker-entrypoint.sh
|
||||
|
||||
# exclude windows build tools
|
||||
/php-sdk-binary-tools/
|
||||
|
||||
11
bin/docker-entrypoint.sh
Normal file
11
bin/docker-entrypoint.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
|
||||
BACKUP_DIR="/app/pkgroot-private"
|
||||
# copy private pkgroot to pkgroot if pkgroot is empty
|
||||
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
|
||||
echo "* Copying private pkgroot to pkgroot ..."
|
||||
rm -rf "$TARGET_DIR"
|
||||
cp -r "$BACKUP_DIR" "$TARGET_DIR"
|
||||
fi
|
||||
exec "$@"
|
||||
@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
|
||||
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
||||
|
||||
# set download dir
|
||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
||||
|
||||
# use china mirror
|
||||
@ -45,7 +45,7 @@ done
|
||||
|
||||
case "$mirror" in
|
||||
china)
|
||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
||||
;;
|
||||
|
||||
|
||||
@ -123,8 +123,13 @@ COPY ./composer.* /app/
|
||||
ADD ./bin /app/bin
|
||||
RUN composer install --no-dev
|
||||
ADD ./config /app/config
|
||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix
|
||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
|
||||
RUN bin/spc doctor --auto-fix
|
||||
RUN bin/spc install-pkg upx
|
||||
|
||||
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
|
||||
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||
RUN chmod +x /bin/docker-entrypoint.sh
|
||||
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
@ -112,8 +112,8 @@ ENV SPC_LIBC=glibc
|
||||
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
|
||||
|
||||
ADD ./config /app/config
|
||||
RUN CC=gcc PKG_ROOT_PATH=/app/pkgroot-private bin/spc doctor --auto-fix --debug
|
||||
RUN PKG_ROOT_PATH=/app/pkgroot-private bin/spc install-pkg upx
|
||||
RUN CC=gcc bin/spc doctor --auto-fix --debug
|
||||
RUN bin/spc install-pkg upx
|
||||
RUN if [ -f /app/buildroot/bin/re2c ]; then \
|
||||
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
|
||||
fi
|
||||
@ -133,6 +133,11 @@ RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.ta
|
||||
make && \
|
||||
make install && \
|
||||
ln -sf /usr/local/bin/automake /usr/bin/automake
|
||||
|
||||
RUN mv /app/pkgroot/\$(uname -m)-linux /app/pkgroot-private
|
||||
ADD bin/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||
RUN chmod +x /bin/docker-entrypoint.sh
|
||||
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
14
composer.lock
generated
14
composer.lock
generated
@ -2861,16 +2861,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.87.0",
|
||||
"version": "v3.87.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "50a13c4c5f25d2c6894e30e92c051474cf0e115a"
|
||||
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/50a13c4c5f25d2c6894e30e92c051474cf0e115a",
|
||||
"reference": "50a13c4c5f25d2c6894e30e92c051474cf0e115a",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||
"reference": "2f5170365e2a422d0c5421f9c8818b2c078105f6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2903,7 +2903,7 @@
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||
"infection/infection": "^0.29.14",
|
||||
"justinrainbow/json-schema": "^6.4",
|
||||
"justinrainbow/json-schema": "^6.5",
|
||||
"keradus/cli-executor": "^2.2",
|
||||
"mikey179/vfsstream": "^1.6.12",
|
||||
"php-coveralls/php-coveralls": "^2.8",
|
||||
@ -2953,7 +2953,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v97773{PHP_CS_FIXER_VERSION}"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.87.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2961,7 +2961,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-02T10:58:35+00:00"
|
||||
"time": "2025-09-02T15:27:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "humbug/box",
|
||||
|
||||
@ -10,8 +10,6 @@ use SPC\exception\SPCInternalException;
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\Config;
|
||||
use SPC\store\CurlHook;
|
||||
use SPC\store\Downloader;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\pkg\GoXcaddy;
|
||||
use SPC\toolchain\GccNativeToolchain;
|
||||
|
||||
@ -40,10 +40,6 @@ class GlobalEnvManager
|
||||
if (is_unix()) {
|
||||
self::addPathIfNotExists(BUILD_BIN_PATH);
|
||||
self::addPathIfNotExists(PKG_ROOT_PATH . '/bin');
|
||||
// internally use `WORKING_DIR/pkgroot-private` to avoid volume mount issues in Docker
|
||||
if (is_dir(WORKING_DIR . '/pkgroot-private/bin')) {
|
||||
self::addPathIfNotExists(WORKING_DIR . '/pkgroot-private/bin');
|
||||
}
|
||||
self::putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig');
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ class PkgConfigUtil
|
||||
{
|
||||
// Find pkg-config executable
|
||||
$find_list = [
|
||||
WORKING_DIR . '/pkgroot-private/bin/pkg-config', // used in Docker build, which is installed inside the container to avoid volume mounting issues
|
||||
PKG_ROOT_PATH . '/bin/pkg-config',
|
||||
BUILD_BIN_PATH . '/pkg-config',
|
||||
];
|
||||
|
||||
@ -22,7 +22,10 @@ define('BUILD_BIN_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_BI
|
||||
// output path for shared extensions
|
||||
define('BUILD_MODULES_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_MODULES_PATH')) ? $a : (BUILD_ROOT_PATH . '/modules')));
|
||||
|
||||
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . '/pkgroot')));
|
||||
// pkg arch name
|
||||
$_pkg_arch_name = arch2gnu(php_uname('m')) . '-' . strtolower(PHP_OS_FAMILY);
|
||||
define('PKG_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('PKG_ROOT_PATH')) ? $a : (WORKING_DIR . "/pkgroot/{$_pkg_arch_name}")));
|
||||
|
||||
define('SOURCE_PATH', FileSystem::convertPath(is_string($a = getenv('SOURCE_PATH')) ? $a : (WORKING_DIR . '/source')));
|
||||
define('DOWNLOAD_PATH', FileSystem::convertPath(is_string($a = getenv('DOWNLOAD_PATH')) ? $a : (WORKING_DIR . '/downloads')));
|
||||
define('CPU_COUNT', match (PHP_OS_FAMILY) {
|
||||
|
||||
@ -43,7 +43,7 @@ $no_strip = false;
|
||||
$upx = false;
|
||||
|
||||
// whether to test frankenphp build, only available for macos and linux
|
||||
$frankenphp = true;
|
||||
$frankenphp = false;
|
||||
|
||||
// prefer downloading pre-built packages to speed up the build process
|
||||
$prefer_pre_built = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user