mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 06:45:39 +08:00
Compare commits
60 Commits
release-os
...
fix/protob
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc59b39a02 | ||
|
|
a8e50276d9 | ||
|
|
423b916736 | ||
|
|
d35cbd7bf8 | ||
|
|
d076df6b04 | ||
|
|
a99b6bebae | ||
|
|
864678ab46 | ||
|
|
c03508a84b | ||
|
|
963e2a084a | ||
|
|
4c6b7a3d55 | ||
|
|
5404926a14 | ||
|
|
295df19484 | ||
|
|
b970bf8e3a | ||
|
|
54915028d7 | ||
|
|
823fe96942 | ||
|
|
f2fa29809a | ||
|
|
463ec546fa | ||
|
|
60b2aea09e | ||
|
|
4625c6a885 | ||
|
|
85b0cd8b4b | ||
|
|
1fcb74ad9b | ||
|
|
1049a3ce66 | ||
|
|
1b8b53d47f | ||
|
|
a232f578a4 | ||
|
|
70285cb53b | ||
|
|
a335d050cf | ||
|
|
ef4b2997a7 | ||
|
|
901da8fa41 | ||
|
|
e49a5d7a50 | ||
|
|
281b958075 | ||
|
|
e31f64864e | ||
|
|
92f5b56c74 | ||
|
|
2350d2d5ca | ||
|
|
086c855a43 | ||
|
|
4fa5292913 | ||
|
|
9634b8bcda | ||
|
|
5d5a50a33c | ||
|
|
1edf14e642 | ||
|
|
2277390a1a | ||
|
|
f93ad27c17 | ||
|
|
b690566b39 | ||
|
|
16e772e1a8 | ||
|
|
ad356b4a23 | ||
|
|
8c4e3d58a3 | ||
|
|
8a51d64685 | ||
|
|
055bc7bc3c | ||
|
|
7d7902e0e9 | ||
|
|
2a8fa7d155 | ||
|
|
67ef8f6608 | ||
|
|
d83a597689 | ||
|
|
5623fed37f | ||
|
|
38140d115f | ||
|
|
98117c3a04 | ||
|
|
b01d3ce12c | ||
|
|
608c915e14 | ||
|
|
c680299654 | ||
|
|
794ab16b32 | ||
|
|
661723c99a | ||
|
|
d9834d05c6 | ||
|
|
9a53ef3498 |
98
.github/workflows/build-unix.yml
vendored
98
.github/workflows/build-unix.yml
vendored
@@ -29,6 +29,9 @@ on:
|
||||
description: Extensions to build (comma separated)
|
||||
required: true
|
||||
type: string
|
||||
shared-extensions:
|
||||
description: Shared extensions to build (optional, comma separated)
|
||||
type: string
|
||||
extra-libs:
|
||||
description: Extra libraries to build (optional, comma separated)
|
||||
type: string
|
||||
@@ -42,10 +45,22 @@ on:
|
||||
build-fpm:
|
||||
description: Build fpm binary
|
||||
type: boolean
|
||||
build-frankenphp:
|
||||
description: Build frankenphp binary (requires ZTS)
|
||||
type: boolean
|
||||
default: false
|
||||
enable-zts:
|
||||
description: Enable ZTS
|
||||
type: boolean
|
||||
default: false
|
||||
prefer-pre-built:
|
||||
description: Prefer pre-built binaries (reduce build time)
|
||||
type: boolean
|
||||
default: true
|
||||
with-suggested-libs:
|
||||
description: Build with suggested libs
|
||||
type: boolean
|
||||
default: false
|
||||
debug:
|
||||
description: Show full build logs
|
||||
type: boolean
|
||||
@@ -69,6 +84,9 @@ on:
|
||||
description: Extensions to build (comma separated)
|
||||
required: true
|
||||
type: string
|
||||
shared-extensions:
|
||||
description: Shared extensions to build (optional, comma separated)
|
||||
type: string
|
||||
extra-libs:
|
||||
description: Extra libraries to build (optional, comma separated)
|
||||
type: string
|
||||
@@ -82,10 +100,22 @@ on:
|
||||
build-fpm:
|
||||
description: Build fpm binary
|
||||
type: boolean
|
||||
build-frankenphp:
|
||||
description: Build frankenphp binary (requires ZTS)
|
||||
type: boolean
|
||||
default: false
|
||||
enable-zts:
|
||||
description: Enable ZTS
|
||||
type: boolean
|
||||
default: false
|
||||
prefer-pre-built:
|
||||
description: Prefer pre-built binaries (reduce build time)
|
||||
type: boolean
|
||||
default: true
|
||||
with-suggested-libs:
|
||||
description: Include suggested libs
|
||||
type: boolean
|
||||
default: false
|
||||
debug:
|
||||
description: Show full build logs
|
||||
type: boolean
|
||||
@@ -144,8 +174,19 @@ jobs:
|
||||
RUNS_ON="macos-15"
|
||||
;;
|
||||
esac
|
||||
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=${{ inputs.extensions }} --ignore-cache-sources=php-src"
|
||||
BUILD_CMD="$BUILD_CMD ${{ inputs.extensions }}"
|
||||
STATIC_EXTS="${{ inputs.extensions }}"
|
||||
SHARED_EXTS="${{ inputs['shared-extensions'] }}"
|
||||
BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}"
|
||||
ENABLE_ZTS="${{ inputs['enable-zts'] }}"
|
||||
ALL_EXTS="$STATIC_EXTS"
|
||||
if [ -n "$SHARED_EXTS" ]; then
|
||||
ALL_EXTS="$ALL_EXTS,$SHARED_EXTS"
|
||||
fi
|
||||
DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src"
|
||||
BUILD_CMD="$BUILD_CMD $STATIC_EXTS"
|
||||
if [ -n "$SHARED_EXTS" ]; then
|
||||
BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS"
|
||||
fi
|
||||
if [ -n "${{ inputs.extra-libs }}" ]; then
|
||||
DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}"
|
||||
BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}"
|
||||
@@ -157,6 +198,9 @@ jobs:
|
||||
if [ ${{ inputs.prefer-pre-built }} == true ]; then
|
||||
DOWN_CMD="$DOWN_CMD --prefer-pre-built"
|
||||
fi
|
||||
if [ ${{ inputs.with-suggested-libs }} == true ]; then
|
||||
BUILD_CMD="$BUILD_CMD --with-suggested-libs"
|
||||
fi
|
||||
if [ ${{ inputs.build-cli }} == true ]; then
|
||||
BUILD_CMD="$BUILD_CMD --build-cli"
|
||||
fi
|
||||
@@ -166,6 +210,12 @@ jobs:
|
||||
if [ ${{ inputs.build-fpm }} == true ]; then
|
||||
BUILD_CMD="$BUILD_CMD --build-fpm"
|
||||
fi
|
||||
if [ "$BUILD_FRANKENPHP" = "true" ]; then
|
||||
BUILD_CMD="$BUILD_CMD --build-frankenphp"
|
||||
fi
|
||||
if [ "$ENABLE_ZTS" = "true" ]; then
|
||||
BUILD_CMD="$BUILD_CMD --enable-zts"
|
||||
fi
|
||||
echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT"
|
||||
echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT"
|
||||
echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT"
|
||||
@@ -188,6 +238,27 @@ jobs:
|
||||
env:
|
||||
phpts: nts
|
||||
|
||||
- if: ${{ inputs['build-frankenphp'] == true }}
|
||||
name: "Install go-xcaddy for FrankenPHP"
|
||||
run: |
|
||||
case "${{ inputs.os }}" in
|
||||
linux-x86_64|linux-aarch64)
|
||||
./bin/spc-alpine-docker install-pkg go-xcaddy
|
||||
;;
|
||||
linux-x86_64-glibc|linux-aarch64-glibc)
|
||||
./bin/spc-gnu-docker install-pkg go-xcaddy
|
||||
;;
|
||||
macos-x86_64|macos-aarch64)
|
||||
composer update --no-dev --classmap-authoritative
|
||||
./bin/spc doctor --auto-fix
|
||||
./bin/spc install-pkg go-xcaddy
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Cache downloaded source
|
||||
- id: cache-download
|
||||
uses: actions/cache@v4
|
||||
@@ -202,6 +273,14 @@ jobs:
|
||||
# if: ${{ failure() }}
|
||||
# uses: mxschmitt/action-tmate@v3
|
||||
|
||||
# Upload debug logs
|
||||
- if: ${{ inputs.debug && failure() }}
|
||||
name: "Upload build logs on failure"
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: spc-logs-${{ inputs.php-version }}-${{ inputs.os }}
|
||||
path: log/*.log
|
||||
|
||||
# Upload cli executable
|
||||
- if: ${{ inputs.build-cli == true }}
|
||||
name: "Upload PHP cli SAPI"
|
||||
@@ -226,7 +305,22 @@ jobs:
|
||||
name: php-fpm-${{ inputs.php-version }}-${{ inputs.os }}
|
||||
path: buildroot/bin/php-fpm
|
||||
|
||||
# Upload frankenphp executable
|
||||
- if: ${{ inputs['build-frankenphp'] == true }}
|
||||
name: "Upload FrankenPHP SAPI"
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }}
|
||||
path: buildroot/bin/frankenphp
|
||||
|
||||
# Upload extensions metadata
|
||||
- if: ${{ inputs['shared-extensions'] != '' }}
|
||||
name: "Upload shared extensions"
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }}
|
||||
path: |
|
||||
buildroot/modules/*.so
|
||||
- uses: actions/upload-artifact@v4
|
||||
name: "Upload License Files"
|
||||
with:
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"require": {
|
||||
"php": ">= 8.3",
|
||||
"ext-mbstring": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-zlib": "*",
|
||||
"laravel/prompts": "^0.1.12",
|
||||
"symfony/console": "^5.4 || ^6 || ^7",
|
||||
|
||||
@@ -148,6 +148,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
|
||||
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
||||
; EXTRA_CFLAGS for `configure` and `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
|
||||
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
||||
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
|
||||
MACOSX_DEPLOYMENT_TARGET=12.0
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
"arg-type-unix": "enable-path",
|
||||
"cpp-extension": true,
|
||||
"lib-depends": [
|
||||
"grpc",
|
||||
"zlib",
|
||||
"openssl",
|
||||
"libcares"
|
||||
|
||||
@@ -143,9 +143,7 @@
|
||||
"zlib"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libpng",
|
||||
"bzip2",
|
||||
"brotli"
|
||||
"libpng"
|
||||
]
|
||||
},
|
||||
"gettext": {
|
||||
@@ -355,6 +353,9 @@
|
||||
"static-libs-unix": [
|
||||
"libaom.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"aom.lib"
|
||||
],
|
||||
"cpp-library": true
|
||||
},
|
||||
"libargon2": {
|
||||
@@ -373,6 +374,15 @@
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"avif.lib"
|
||||
],
|
||||
"lib-depends": [
|
||||
"libaom"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libwebp",
|
||||
"libjpeg",
|
||||
"libxml2",
|
||||
"libpng"
|
||||
]
|
||||
},
|
||||
"libcares": {
|
||||
@@ -853,6 +863,9 @@
|
||||
},
|
||||
"openssl": {
|
||||
"source": "openssl",
|
||||
"pkg-configs": [
|
||||
"openssl"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libssl.a",
|
||||
"libcrypto.a"
|
||||
@@ -965,6 +978,11 @@
|
||||
},
|
||||
"unixodbc": {
|
||||
"source": "unixodbc",
|
||||
"pkg-configs": [
|
||||
"odbc",
|
||||
"odbccr",
|
||||
"odbcinst"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libodbc.a",
|
||||
"libodbccr.a",
|
||||
@@ -1006,6 +1024,9 @@
|
||||
},
|
||||
"zlib": {
|
||||
"source": "zlib",
|
||||
"pkg-configs": [
|
||||
"zlib"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libz.a"
|
||||
],
|
||||
@@ -1019,6 +1040,9 @@
|
||||
},
|
||||
"zstd": {
|
||||
"source": "zstd",
|
||||
"pkg-configs": [
|
||||
"libzstd"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libzstd.a"
|
||||
],
|
||||
|
||||
@@ -8,30 +8,25 @@
|
||||
"alt": false
|
||||
},
|
||||
"amqp": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/amqp",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/amqp",
|
||||
"filename": "amqp.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"apcu": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/APCu",
|
||||
"type": "pecl",
|
||||
"pecl": "APCu",
|
||||
"path": "php-src/ext/apcu",
|
||||
"filename": "apcu.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ast": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/ast",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/ast",
|
||||
"filename": "ast.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -85,20 +80,16 @@
|
||||
}
|
||||
},
|
||||
"dio": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/dio",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/dio",
|
||||
"filename": "dio.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ev": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/ev",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/ev",
|
||||
"filename": "ev.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -115,10 +106,8 @@
|
||||
}
|
||||
},
|
||||
"ext-ds": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/ds",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/ds",
|
||||
"filename": "ds.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -134,10 +123,8 @@
|
||||
}
|
||||
},
|
||||
"ext-excimer": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/excimer",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/excimer",
|
||||
"filename": "excimer.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -162,10 +149,8 @@
|
||||
}
|
||||
},
|
||||
"ext-grpc": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/grpc",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/grpc",
|
||||
"filename": "grpc.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": [
|
||||
@@ -174,20 +159,16 @@
|
||||
}
|
||||
},
|
||||
"ext-imagick": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/imagick",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/imagick",
|
||||
"filename": "imagick.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-imap": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/imap",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/imap",
|
||||
"filename": "imap.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": [
|
||||
@@ -207,19 +188,15 @@
|
||||
}
|
||||
},
|
||||
"ext-maxminddb": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/maxminddb",
|
||||
"filename": "ext-maxminddb.tgz",
|
||||
"type": "pecl",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-memcache": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/memcache",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/memcache",
|
||||
"filename": "memcache.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -235,10 +212,8 @@
|
||||
}
|
||||
},
|
||||
"ext-simdjson": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/simdjson",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/simdjson",
|
||||
"filename": "simdjson.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -255,40 +230,32 @@
|
||||
}
|
||||
},
|
||||
"ext-ssh2": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/ssh2",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/ssh2",
|
||||
"filename": "ssh2.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-trader": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/trader",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/trader",
|
||||
"filename": "trader.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-uuid": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/uuid",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/uuid",
|
||||
"filename": "uuid.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-uv": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/uv",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/uv",
|
||||
"filename": "uv.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -305,9 +272,7 @@
|
||||
}
|
||||
},
|
||||
"ext-zip": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/zip",
|
||||
"filename": "ext-zip.tgz",
|
||||
"type": "pecl",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -361,7 +326,7 @@
|
||||
},
|
||||
"gmp": {
|
||||
"type": "filelist",
|
||||
"url": "https://gmplib.org/download/gmp/",
|
||||
"url": "https://ftp.gnu.org/gnu/gmp/",
|
||||
"regex": "/href=\"(?<file>gmp-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"provide-pre-built": true,
|
||||
"alt": {
|
||||
@@ -412,10 +377,8 @@
|
||||
}
|
||||
},
|
||||
"igbinary": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/igbinary",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/igbinary",
|
||||
"filename": "igbinary.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
@@ -439,10 +402,8 @@
|
||||
}
|
||||
},
|
||||
"inotify": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/inotify",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/inotify",
|
||||
"filename": "inotify.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -526,7 +487,7 @@
|
||||
"libavif": {
|
||||
"type": "ghtar",
|
||||
"repo": "AOMediaCodec/libavif",
|
||||
"provide-pre-built": true,
|
||||
"provide-pre-built": false,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -844,10 +805,8 @@
|
||||
}
|
||||
},
|
||||
"memcached": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/memcached",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/memcached",
|
||||
"filename": "memcached.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -885,10 +844,8 @@
|
||||
}
|
||||
},
|
||||
"msgpack": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/msgpack",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/msgpack",
|
||||
"filename": "msgpack.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -988,39 +945,31 @@
|
||||
}
|
||||
},
|
||||
"opentelemetry": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/opentelemetry",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/opentelemetry",
|
||||
"filename": "opentelemetry.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"parallel": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/parallel",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/parallel",
|
||||
"filename": "parallel.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"pcov": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/pcov",
|
||||
"filename": "pcov.tgz",
|
||||
"type": "pecl",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"pdo_sqlsrv": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/pdo_sqlsrv",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/pdo_sqlsrv",
|
||||
"filename": "pdo_sqlsrv.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -1053,10 +1002,8 @@
|
||||
}
|
||||
},
|
||||
"protobuf": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/protobuf",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/protobuf",
|
||||
"filename": "protobuf.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -1115,10 +1062,8 @@
|
||||
}
|
||||
},
|
||||
"redis": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/redis",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/redis",
|
||||
"filename": "redis.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": [
|
||||
@@ -1155,10 +1100,8 @@
|
||||
}
|
||||
},
|
||||
"sqlsrv": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/sqlsrv",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/sqlsrv",
|
||||
"filename": "sqlsrv.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -1221,20 +1164,16 @@
|
||||
}
|
||||
},
|
||||
"xhprof": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/xhprof",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/xhprof-src",
|
||||
"filename": "xhprof.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"xlswriter": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/xlswriter",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/xlswriter",
|
||||
"filename": "xlswriter.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -1252,10 +1191,8 @@
|
||||
}
|
||||
},
|
||||
"yac": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/yac",
|
||||
"type": "pecl",
|
||||
"path": "php-src/ext/yac",
|
||||
"filename": "yac.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
|
||||
@@ -16,8 +16,10 @@ while also defining the extensions to compile.
|
||||
|
||||
1. Fork project.
|
||||
2. Go to the Actions of the project and select `CI`.
|
||||
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. `bcmath,curl,mbstring`)
|
||||
4. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
|
||||
3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of static extensions. (comma separated, e.g. `bcmath,curl,mbstring`)
|
||||
4. If you need shared extensions (for example `xdebug`), set `shared-extensions` (comma separated, e.g. `xdebug`).
|
||||
5. If you need FrankenPHP, enable `build-frankenphp` and also enable `enable-zts`.
|
||||
6. After waiting for about a period of time, enter the corresponding task and get `Artifacts`.
|
||||
|
||||
If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting.
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ Action 构建指的是直接使用 GitHub Action 进行编译。
|
||||
1. Fork 本项目。
|
||||
2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。
|
||||
3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 `bcmath,curl,mbstring`)
|
||||
4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`。
|
||||
4. 如果需要共享扩展(例如 `xdebug`),请设置 `shared-extensions`(使用英文逗号分割,例如 `xdebug`)。
|
||||
5. 如果需要 FrankenPHP,请启用 `build-frankenphp`,同时也需要启用 `enable-zts`。
|
||||
6. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`。
|
||||
|
||||
如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const string VERSION = '2.8.2';
|
||||
public const string VERSION = '2.8.4';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -96,7 +96,8 @@ class Extension
|
||||
fn ($x) => $x->getStaticLibFiles(),
|
||||
$this->getLibraryDependencies(recursive: true)
|
||||
);
|
||||
return implode(' ', $ret);
|
||||
$libs = implode(' ', $ret);
|
||||
return deduplicate_flags($libs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -365,6 +365,27 @@ abstract class LibraryBase
|
||||
|
||||
protected function isLibraryInstalled(): bool
|
||||
{
|
||||
if ($pkg_configs = Config::getLib(static::NAME, 'pkg-configs', [])) {
|
||||
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||
$search_paths = array_unique(array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path)));
|
||||
|
||||
foreach ($pkg_configs as $name) {
|
||||
$found = false;
|
||||
foreach ($search_paths as $path) {
|
||||
if (file_exists($path . "/{$name}.pc")) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// allow using system dependencies if pkg_config_path is explicitly defined
|
||||
if (count($search_paths) > 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) {
|
||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
||||
return false;
|
||||
|
||||
@@ -5,11 +5,21 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('ffi')]
|
||||
class ffi extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Linux' && SystemUtil::getOSRelease()['dist'] === 'centos') {
|
||||
return SourcePatcher::patchFfiCentos7FixO3strncmp();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-ffi' . ($shared ? '=shared' : '') . ' --enable-zend-signals';
|
||||
|
||||
@@ -11,7 +11,6 @@ use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
use SPC\util\SPCConfigUtil;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
#[CustomExt('grpc')]
|
||||
class grpc extends Extension
|
||||
@@ -21,18 +20,50 @@ class grpc extends Extension
|
||||
if ($this->builder instanceof WindowsBuilder) {
|
||||
throw new ValidationException('grpc extension does not support windows yet');
|
||||
}
|
||||
|
||||
// Fix deprecated PHP API usage in call.c
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/src/php/ext/grpc/call.c',
|
||||
"{$this->source_dir}/src/php/ext/grpc/call.c",
|
||||
'zend_exception_get_default(TSRMLS_C),',
|
||||
'zend_ce_exception,',
|
||||
);
|
||||
if (SPCTarget::getTargetOS() === 'Darwin') {
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/config.m4',
|
||||
'/GRPC_LIBDIR=.*$/m',
|
||||
'GRPC_LIBDIR=' . BUILD_LIB_PATH . "\n" . 'LDFLAGS="$LDFLAGS -framework CoreFoundation"'
|
||||
);
|
||||
}
|
||||
|
||||
$config_m4 = <<<'M4'
|
||||
PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])])
|
||||
|
||||
if test "$PHP_GRPC" != "no"; then
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include)
|
||||
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
|
||||
GRPC_LIBDIR=@@build_lib_path@@
|
||||
PHP_ADD_LIBPATH($GRPC_LIBDIR)
|
||||
PHP_ADD_LIBRARY(grpc,,GRPC_SHARED_LIBADD)
|
||||
LIBS="-lpthread $LIBS"
|
||||
PHP_ADD_LIBRARY(pthread)
|
||||
|
||||
case $host in
|
||||
*darwin*)
|
||||
PHP_ADD_LIBRARY(c++,1,GRPC_SHARED_LIBADD)
|
||||
;;
|
||||
*)
|
||||
PHP_ADD_LIBRARY(stdc++,1,GRPC_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY(rt)
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_NEW_EXTENSION(grpc, @grpc_c_files@, $ext_shared, , -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1)
|
||||
PHP_SUBST(GRPC_SHARED_LIBADD)
|
||||
PHP_INSTALL_HEADERS([ext/grpc], [php_grpc.h])
|
||||
fi
|
||||
M4;
|
||||
$replace = get_pack_replace();
|
||||
// load grpc c files from src/php/ext/grpc
|
||||
$c_files = glob($this->source_dir . '/src/php/ext/grpc/*.c');
|
||||
$replace['@grpc_c_files@'] = implode(" \\\n ", array_map(fn ($f) => 'src/php/ext/grpc/' . basename($f), $c_files));
|
||||
$config_m4 = str_replace(array_keys($replace), array_values($replace), $config_m4);
|
||||
file_put_contents($this->source_dir . '/config.m4', $config_m4);
|
||||
|
||||
copy($this->source_dir . '/src/php/ext/grpc/php_grpc.h', $this->source_dir . '/php_grpc.h');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -48,7 +79,6 @@ class grpc extends Extension
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
parent::patchBeforeMake();
|
||||
// add -Wno-strict-prototypes
|
||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,19 +50,16 @@ class swoole extends Extension
|
||||
|
||||
// commonly used feature: coroutine-time
|
||||
$arg .= ' --enable-swoole-coro-time --with-pic';
|
||||
$arg .= ' --enable-swoole-ssh --enable-swoole-curl';
|
||||
|
||||
$arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context';
|
||||
|
||||
// required features: curl, openssl (but curl hook is buggy for php 8.0)
|
||||
$arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
|
||||
$arg .= ' --enable-openssl';
|
||||
|
||||
// additional features that only require libraries
|
||||
$arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : '';
|
||||
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
||||
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
|
||||
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
|
||||
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : '';
|
||||
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring --enable-uring-socket' : '';
|
||||
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
|
||||
|
||||
// enable additional features that require the pdo extension, but conflict with pdo_* extensions
|
||||
@@ -74,6 +71,7 @@ class swoole extends Extension
|
||||
$config = (new SPCConfigUtil($this->builder))->getLibraryConfig($this->builder->getLib('unixodbc'));
|
||||
$arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"';
|
||||
}
|
||||
$arg .= $this->builder->getExt('ftp')?->isBuildStatic() ? ' --disable-swoole-ftp' : ' --enable-swoole-ftp';
|
||||
|
||||
if ($this->getExtVersion() >= '6.1.0') {
|
||||
$arg .= ' --enable-swoole-stdext';
|
||||
|
||||
@@ -162,7 +162,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
throw new WrongUsageException(
|
||||
"You're building against musl libc statically (the default on Linux), but you're trying to build shared extensions.\n" .
|
||||
'Static musl libc does not implement `dlopen`, so your php binary is not able to load shared extensions.' . "\n" .
|
||||
'Either use SPC_LIBC=glibc to link against glibc on a glibc OS, or use SPC_TARGET="native-native-musl -dynamic" to link against musl libc dynamically using `zig cc`.'
|
||||
'Either use SPC_LIBC=glibc to link against glibc on a glibc OS, use SPC_TARGET="native-native-musl -dynamic" to link against musl libc dynamically using `zig cc` or use SPC_MUSL_DYNAMIC=true on alpine.'
|
||||
);
|
||||
}
|
||||
logger()->info('Building shared extensions...');
|
||||
|
||||
@@ -72,6 +72,10 @@ trait UnixSystemUtilTrait
|
||||
if (!is_file($symbol_file)) {
|
||||
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available.");
|
||||
}
|
||||
// https://github.com/ziglang/zig/issues/24662
|
||||
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
return '-Wl,--export-dynamic'; // needs release 0.16, can be removed then
|
||||
}
|
||||
// macOS/zig
|
||||
if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) {
|
||||
return "-Wl,-exported_symbols_list,{$symbol_file}";
|
||||
|
||||
@@ -365,6 +365,7 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
$frankenphpAppPath = $this->getOption('with-frankenphp-app');
|
||||
|
||||
if ($frankenphpAppPath) {
|
||||
$frankenphpAppPath = trim($frankenphpAppPath, "\"'");
|
||||
if (!is_dir($frankenphpAppPath)) {
|
||||
throw new WrongUsageException("The path provided to --with-frankenphp-app is not a valid directory: {$frankenphpAppPath}");
|
||||
}
|
||||
@@ -455,6 +456,8 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
'CGO_LDFLAGS' => "{$this->arch_ld_flags} {$staticFlags} {$config['ldflags']} {$libs}",
|
||||
'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' .
|
||||
'-ldflags \"-linkmode=external ' . $extLdFlags . ' ' .
|
||||
'-X \'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy\' ' .
|
||||
'-X \'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp\' ' .
|
||||
'-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' .
|
||||
"v{$frankenPhpVersion} PHP {$libphpVersion} Caddy'\\\" " .
|
||||
"-tags={$muslTags}nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}",
|
||||
|
||||
@@ -13,8 +13,8 @@ trait freetype
|
||||
{
|
||||
$cmake = UnixCMakeExecutor::create($this)
|
||||
->optionalLib('libpng', ...cmake_boolean_args('FT_DISABLE_PNG', true))
|
||||
->optionalLib('bzip2', ...cmake_boolean_args('FT_DISABLE_BZIP2', true))
|
||||
->optionalLib('brotli', ...cmake_boolean_args('FT_DISABLE_BROTLI', true))
|
||||
->addConfigureArgs('-DFT_DISABLE_BZIP2=ON')
|
||||
->addConfigureArgs('-DFT_DISABLE_BROTLI=ON')
|
||||
->addConfigureArgs('-DFT_DISABLE_HARFBUZZ=ON');
|
||||
|
||||
// fix cmake 4.0 compatibility
|
||||
|
||||
@@ -11,6 +11,11 @@ trait libavif
|
||||
protected function build(): void
|
||||
{
|
||||
UnixCMakeExecutor::create($this)
|
||||
->optionalLib('libaom', '-DAVIF_CODEC_AOM=SYSTEM', '-DAVIF_CODEC_AOM=OFF')
|
||||
->optionalLib('libsharpyuv', '-DAVIF_LIBSHARPYUV=SYSTEM', '-DAVIF_LIBSHARPYUV=OFF')
|
||||
->optionalLib('libjpeg', '-DAVIF_JPEG=SYSTEM', '-DAVIF_JPEG=OFF')
|
||||
->optionalLib('libxml2', '-DAVIF_LIBXML2=SYSTEM', '-DAVIF_LIBXML2=OFF')
|
||||
->optionalLib('libpng', '-DAVIF_LIBPNG=SYSTEM', '-DAVIF_LIBPNG=OFF')
|
||||
->addConfigureArgs('-DAVIF_LIBYUV=OFF')
|
||||
->build();
|
||||
// patch pkgconfig
|
||||
|
||||
@@ -11,7 +11,10 @@ trait libde265
|
||||
protected function build(): void
|
||||
{
|
||||
UnixCMakeExecutor::create($this)
|
||||
->addConfigureArgs('-DENABLE_SDL=OFF')
|
||||
->addConfigureArgs(
|
||||
'-DENABLE_SDL=OFF',
|
||||
'-DENABLE_DECODER=OFF'
|
||||
)
|
||||
->build();
|
||||
$this->patchPkgconfPrefix(['libde265.pc']);
|
||||
}
|
||||
|
||||
@@ -93,8 +93,7 @@ trait postgresql
|
||||
|
||||
// remove dynamic libs
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so.*")
|
||||
->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so")
|
||||
->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so*")
|
||||
->exec("rm -rf {$this->getBuildRootPath()}/lib/*.dylib");
|
||||
|
||||
FileSystem::replaceFileStr("{$this->getLibDir()}/pkgconfig/libpq.pc", '-lldap', '-lldap -llber');
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
trait unixodbc
|
||||
@@ -30,7 +31,15 @@ trait unixodbc
|
||||
'--enable-gui=no',
|
||||
)
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
||||
$pkgConfigs = ['odbc.pc', 'odbccr.pc', 'odbcinst.pc'];
|
||||
$this->patchPkgconfPrefix($pkgConfigs);
|
||||
foreach ($pkgConfigs as $file) {
|
||||
FileSystem::replaceFileStr(
|
||||
BUILD_LIB_PATH . "/pkgconfig/{$file}",
|
||||
'$(top_build_prefix)libltdl/libltdlc.la',
|
||||
''
|
||||
);
|
||||
}
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
36
src/SPC/builder/windows/library/brotli.php
Normal file
36
src/SPC/builder/windows/library/brotli.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\windows\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class brotli extends WindowsLibraryBase
|
||||
{
|
||||
public const NAME = 'brotli';
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
// reset cmake
|
||||
FileSystem::resetDir($this->source_dir . '\build');
|
||||
|
||||
// start build
|
||||
cmd()->cd($this->source_dir)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
'-B build ' .
|
||||
'-A x64 ' .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DBROTLI_BUILD_TOOLS=OFF ' .
|
||||
'-DBROTLI_BUNDLED_MODE=OFF ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
||||
)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ class freetype extends WindowsLibraryBase
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DFT_DISABLE_BROTLI=TRUE ' .
|
||||
'-DFT_DISABLE_BZIP2=TRUE ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
||||
)
|
||||
->execWithWrapper(
|
||||
|
||||
41
src/SPC/builder/windows/library/libaom.php
Normal file
41
src/SPC/builder/windows/library/libaom.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\windows\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class libaom extends WindowsLibraryBase
|
||||
{
|
||||
public const NAME = 'libaom';
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
// libaom source tree contains a build/cmake/ directory with its own
|
||||
// cmake modules, so we must use a different name for the build dir.
|
||||
FileSystem::resetDir($this->source_dir . '\builddir');
|
||||
|
||||
// start build
|
||||
cmd()->cd($this->source_dir)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
'-S . -B builddir ' .
|
||||
'-A x64 ' .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DAOM_TARGET_CPU=generic ' .
|
||||
'-DENABLE_DOCS=OFF ' .
|
||||
'-DENABLE_EXAMPLES=OFF ' .
|
||||
'-DENABLE_TESTDATA=OFF ' .
|
||||
'-DENABLE_TESTS=OFF ' .
|
||||
'-DENABLE_TOOLS=OFF ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
|
||||
)
|
||||
->execWithWrapper(
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
"--build builddir --config Release --target install -j{$this->builder->concurrency}"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -31,8 +31,24 @@ class zlib extends WindowsLibraryBase
|
||||
$this->builder->makeSimpleWrapper('cmake'),
|
||||
"--build build --config Release --target install -j{$this->builder->concurrency}"
|
||||
);
|
||||
copy(BUILD_LIB_PATH . '\zlibstatic.lib', BUILD_LIB_PATH . '\zlib_a.lib');
|
||||
unlink(BUILD_ROOT_PATH . '\bin\zlib.dll');
|
||||
unlink(BUILD_LIB_PATH . '\zlib.lib');
|
||||
$detect_list = [
|
||||
'zlibstatic.lib',
|
||||
'zs.lib',
|
||||
'libzs.lib',
|
||||
'libz.lib',
|
||||
];
|
||||
foreach ($detect_list as $item) {
|
||||
if (file_exists(BUILD_LIB_PATH . '\\' . $item)) {
|
||||
FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlib_a.lib');
|
||||
FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlibstatic.lib');
|
||||
break;
|
||||
}
|
||||
}
|
||||
FileSystem::removeFileIfExists(BUILD_ROOT_PATH . '\bin\zlib.dll');
|
||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\zlib.lib');
|
||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.dll');
|
||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.lib');
|
||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.lib');
|
||||
FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.dll');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class DownloadCommand extends BaseCommand
|
||||
$this->addArgument('sources', InputArgument::REQUIRED, 'The sources will be compiled, comma separated');
|
||||
$this->addOption('shallow-clone', null, null, 'Clone shallow');
|
||||
$this->addOption('with-openssl11', null, null, 'Use openssl 1.1');
|
||||
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.4)', '8.4');
|
||||
$this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.5)', '8.5');
|
||||
$this->addOption('clean', null, null, 'Clean old download cache and source before fetch');
|
||||
$this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed');
|
||||
$this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"');
|
||||
|
||||
@@ -16,6 +16,43 @@ use SPC\util\SPCTarget;
|
||||
*/
|
||||
class Downloader
|
||||
{
|
||||
/**
|
||||
* Get latest stable version from PECL
|
||||
*
|
||||
* @param string $name Source name
|
||||
* @param array $source Source meta info: [pecl?]
|
||||
* @return array<int, string> [url, filename]
|
||||
*/
|
||||
public static function getPECLInfo(string $name, array $source): array
|
||||
{
|
||||
$package = $source['pecl'] ?? (str_starts_with($name, 'ext-') ? substr($name, 4) : $name);
|
||||
$lp = strtolower($package);
|
||||
$api_url = "https://pecl.php.net/rest/r/{$lp}/allreleases.xml";
|
||||
logger()->debug("Fetching {$name} source from PECL: {$api_url}");
|
||||
$xml = self::curlExec(
|
||||
url: $api_url,
|
||||
retries: self::getRetryAttempts()
|
||||
);
|
||||
$dom = new \SimpleXMLElement($xml);
|
||||
$version = null;
|
||||
if ($source['prefer-stable'] ?? false) {
|
||||
foreach ($dom->r as $release) {
|
||||
if ((string) $release->s === 'stable') {
|
||||
$version = (string) $release->v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$version ??= isset($dom->r[0]) ? (string) $dom->r[0]->v : null;
|
||||
if ($version === null) {
|
||||
throw new DownloaderException("failed to find any release for {$name} on PECL");
|
||||
}
|
||||
$url = "https://pecl.php.net/get/{$package}-{$version}.tgz";
|
||||
$filename = "{$package}-{$version}.tgz";
|
||||
logger()->info("Found {$name} PECL version: {$version}");
|
||||
return [$url, $filename];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get latest version from PIE config (Packagist)
|
||||
*
|
||||
@@ -612,6 +649,7 @@ class Downloader
|
||||
* @param array{
|
||||
* url?: string,
|
||||
* repo?: string,
|
||||
* pecl?: string,
|
||||
* rev?: string,
|
||||
* path?: string,
|
||||
* filename?: string,
|
||||
@@ -631,6 +669,10 @@ class Downloader
|
||||
{
|
||||
try {
|
||||
switch ($type) {
|
||||
case 'pecl': // PECL (latest stable)
|
||||
[$url, $filename] = self::getPECLInfo($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as);
|
||||
break;
|
||||
case 'pie': // Packagist
|
||||
[$url, $filename] = self::getPIEInfo($name, $conf);
|
||||
self::downloadFile($name, $url, $filename, $conf['path'] ?? $conf['extract'] ?? null, $download_as, hooks: [[CurlHook::class, 'setupGithubToken']]);
|
||||
|
||||
@@ -22,7 +22,7 @@ class SourcePatcher
|
||||
FileSystem::addSourceExtractHook('swoole', [__CLASS__, 'patchSwoole']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchPhpLibxml212']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchGDWin32']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchFfiCentos7FixO3strncmp']);
|
||||
// FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchFfiCentos7FixO3strncmp']);
|
||||
FileSystem::addSourceExtractHook('sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVPhp85']);
|
||||
@@ -634,7 +634,13 @@ class SourcePatcher
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gd/libgd/gdft.c', '#ifndef MSWIN32', '#ifndef _WIN32');
|
||||
}
|
||||
// custom config.w32, because official config.w32 is hard-coded many things
|
||||
$origin = $ver_id >= 80100 ? file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_81.w32') : file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_80.w32');
|
||||
if ($ver_id >= 80500) {
|
||||
$origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_85.w32');
|
||||
} elseif ($ver_id >= 80100) {
|
||||
$origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_81.w32');
|
||||
} else {
|
||||
$origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_80.w32');
|
||||
}
|
||||
file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32.bak', file_get_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32'));
|
||||
return file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32', $origin) !== false;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ class GoXcaddy extends CustomPackage
|
||||
public function fetch(string $name, bool $force = false, ?array $config = null): void
|
||||
{
|
||||
$pkgroot = PKG_ROOT_PATH;
|
||||
$go_exec = "{$pkgroot}/{$name}/bin/go";
|
||||
$xcaddy_exec = "{$pkgroot}/{$name}/bin/xcaddy";
|
||||
$go_exec = "{$pkgroot}/go-xcaddy/bin/go";
|
||||
$xcaddy_exec = "{$pkgroot}/go-xcaddy/bin/xcaddy";
|
||||
if ($force) {
|
||||
FileSystem::removeDir("{$pkgroot}/{$name}");
|
||||
}
|
||||
|
||||
@@ -6,15 +6,21 @@ namespace SPC\store\source;
|
||||
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
use SPC\exception\DownloaderException;
|
||||
use SPC\exception\SPCException;
|
||||
use SPC\store\Downloader;
|
||||
|
||||
class PhpSource extends CustomSourceBase
|
||||
{
|
||||
public const NAME = 'php-src';
|
||||
public const string NAME = 'php-src';
|
||||
|
||||
public const array WEB_PHP_DOMAINS = [
|
||||
'https://www.php.net',
|
||||
'https://phpmirror.static-php.dev',
|
||||
];
|
||||
|
||||
public function fetch(bool $force = false, ?array $config = null, int $lock_as = SPC_DOWNLOAD_SOURCE): void
|
||||
{
|
||||
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
|
||||
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.5';
|
||||
if ($major === 'git') {
|
||||
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
|
||||
} else {
|
||||
@@ -28,21 +34,26 @@ class PhpSource extends CustomSourceBase
|
||||
#[ArrayShape(['type' => 'string', 'path' => 'string', 'rev' => 'string', 'url' => 'string'])]
|
||||
public function getLatestPHPInfo(string $major_version): array
|
||||
{
|
||||
// 查找最新的小版本号
|
||||
$info = json_decode(Downloader::curlExec(
|
||||
url: "https://www.php.net/releases/index.php?json&version={$major_version}",
|
||||
retries: (int) getenv('SPC_DOWNLOAD_RETRIES') ?: 0
|
||||
), true);
|
||||
if (!isset($info['version'])) {
|
||||
throw new DownloaderException("Version {$major_version} not found.");
|
||||
foreach (self::WEB_PHP_DOMAINS as $domain) {
|
||||
try {
|
||||
$info = json_decode(Downloader::curlExec(
|
||||
url: "{$domain}/releases/index.php?json&version={$major_version}",
|
||||
retries: (int) getenv('SPC_DOWNLOAD_RETRIES') ?: 0
|
||||
), true);
|
||||
if (!isset($info['version'])) {
|
||||
throw new DownloaderException("Version {$major_version} not found.");
|
||||
}
|
||||
$version = $info['version'];
|
||||
return [
|
||||
'type' => 'url',
|
||||
'url' => "{$domain}/distributions/php-{$version}.tar.xz",
|
||||
];
|
||||
} catch (SPCException) {
|
||||
logger()->warning('Failed to fetch latest PHP version for major version {$major_version} from {$domain}, trying next mirror if available.');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$version = $info['version'];
|
||||
|
||||
// 从官网直接下载
|
||||
return [
|
||||
'type' => 'url',
|
||||
'url' => "https://www.php.net/distributions/php-{$version}.tar.xz",
|
||||
];
|
||||
// exception if all mirrors failed
|
||||
throw new DownloaderException("Failed to fetch latest PHP version for major version {$major_version} from all tried mirrors.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@ class ConfigValidator
|
||||
'regex' => 'string', // regex pattern
|
||||
'rev' => 'string', // revision/branch
|
||||
'repo' => 'string', // repository name
|
||||
'pecl' => 'string', // PECL package name
|
||||
'match' => 'string', // match pattern (aaa*bbb)
|
||||
'query' => 'string', // query string for API requests
|
||||
'filename' => 'string', // filename
|
||||
'path' => 'string', // copy path
|
||||
'extract' => 'string', // copy path (alias of path)
|
||||
@@ -73,12 +75,13 @@ class ConfigValidator
|
||||
private const array SOURCE_TYPE_FIELDS = [
|
||||
'filelist' => [['url', 'regex'], []],
|
||||
'git' => [['url', 'rev'], ['path', 'extract', 'submodules']],
|
||||
'ghtagtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match']],
|
||||
'ghtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match']],
|
||||
'ghtagtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match', 'query']],
|
||||
'ghtar' => [['repo'], ['path', 'extract', 'prefer-stable', 'match', 'query']],
|
||||
'ghrel' => [['repo', 'match'], ['path', 'extract', 'prefer-stable']],
|
||||
'url' => [['url'], ['filename', 'path', 'extract']],
|
||||
'bitbuckettag' => [['repo'], ['path', 'extract']],
|
||||
'local' => [['dirname'], ['path', 'extract']],
|
||||
'pecl' => [[], ['pecl', 'path', 'prefer-stable']],
|
||||
'pie' => [['repo'], ['path']],
|
||||
'custom' => [[], ['func']],
|
||||
];
|
||||
@@ -393,7 +396,7 @@ class ConfigValidator
|
||||
}
|
||||
// check php-version
|
||||
if (isset($craft['php-version'])) {
|
||||
// validdate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7
|
||||
// validate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7
|
||||
$version = strval($craft['php-version']);
|
||||
if (!preg_match('/^(\d+)(\.\d+)?(\.\d+)?$/', $version, $matches)) {
|
||||
throw new ValidationException('Craft file php-version is invalid');
|
||||
|
||||
@@ -16,12 +16,11 @@ class UnixAutoconfExecutor extends Executor
|
||||
|
||||
protected array $configure_args = [];
|
||||
|
||||
protected array $ignore_args = [];
|
||||
|
||||
public function __construct(protected BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $library)
|
||||
{
|
||||
parent::__construct($library);
|
||||
$this->initShell();
|
||||
$this->configure_args = $this->getDefaultConfigureArgs();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,19 +28,12 @@ class UnixAutoconfExecutor extends Executor
|
||||
*/
|
||||
public function configure(...$args): static
|
||||
{
|
||||
// remove all the ignored args
|
||||
$args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args);
|
||||
$args = array_diff($args, $this->ignore_args);
|
||||
$args = array_merge($args, $this->configure_args);
|
||||
$configure_args = implode(' ', $args);
|
||||
|
||||
return $this->seekLogFileOnException(fn () => $this->shell->exec("./configure {$configure_args}"));
|
||||
}
|
||||
|
||||
public function getConfigureArgsString(): string
|
||||
{
|
||||
return implode(' ', array_merge($this->getDefaultConfigureArgs(), $this->configure_args));
|
||||
}
|
||||
|
||||
/**
|
||||
* Run make
|
||||
*
|
||||
@@ -111,7 +103,7 @@ class UnixAutoconfExecutor extends Executor
|
||||
*/
|
||||
public function removeConfigureArgs(...$args): static
|
||||
{
|
||||
$this->ignore_args = [...$this->ignore_args, ...$args];
|
||||
$this->configure_args = array_diff($this->configure_args, $args);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -133,8 +125,8 @@ class UnixAutoconfExecutor extends Executor
|
||||
private function getDefaultConfigureArgs(): array
|
||||
{
|
||||
return [
|
||||
'--disable-shared',
|
||||
'--enable-static',
|
||||
'--disable-shared',
|
||||
"--prefix={$this->library->getBuildRootPath()}",
|
||||
'--with-pic',
|
||||
'--enable-pic',
|
||||
|
||||
94
src/globals/extra/gd_config_85.w32
Normal file
94
src/globals/extra/gd_config_85.w32
Normal file
@@ -0,0 +1,94 @@
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_WITH("gd", "Bundled GD support", "yes");
|
||||
|
||||
if (PHP_GD != "no") {
|
||||
// check for gd.h (required)
|
||||
if (!CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd")) {
|
||||
ERROR("gd not enabled; libraries and headers not found");
|
||||
}
|
||||
|
||||
// zlib ext support (required)
|
||||
if (!CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD)) {
|
||||
ERROR("gd not enabled; zlib not enabled");
|
||||
}
|
||||
|
||||
// libjpeg lib support
|
||||
if (CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("jpeglib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include")) {
|
||||
AC_DEFINE("HAVE_LIBJPEG", 1, "JPEG support");
|
||||
AC_DEFINE("HAVE_GD_JPG", 1, "JPEG support");
|
||||
}
|
||||
|
||||
// libpng16 lib support
|
||||
if (CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16")) {
|
||||
AC_DEFINE("HAVE_LIBPNG", 1, "PNG support");
|
||||
AC_DEFINE("HAVE_GD_PNG", 1, "PNG support");
|
||||
}
|
||||
|
||||
// freetype lib support
|
||||
if (CHECK_LIB("libfreetype_a.lib;libfreetype.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype")) {
|
||||
AC_DEFINE("HAVE_LIBFREETYPE", 1, "FreeType support");
|
||||
AC_DEFINE("HAVE_GD_FREETYPE", 1, "FreeType support");
|
||||
}
|
||||
|
||||
// xpm lib support
|
||||
if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")) {
|
||||
AC_DEFINE("HAVE_LIBXPM", 1, "XPM support");
|
||||
AC_DEFINE("HAVE_GD_XPM", 1, "XPM support");
|
||||
}
|
||||
|
||||
// iconv lib support
|
||||
if ((CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD)) {
|
||||
AC_DEFINE("HAVE_LIBICONV", 1, "Iconv support");
|
||||
}
|
||||
|
||||
// libwebp lib support
|
||||
if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) &&
|
||||
CHECK_LIB("libsharpyuv.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") &&
|
||||
CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) {
|
||||
AC_DEFINE("HAVE_LIBWEBP", 1, "WebP support");
|
||||
AC_DEFINE("HAVE_GD_WEBP", 1, "WebP support");
|
||||
}
|
||||
|
||||
// libavif lib support
|
||||
if (CHECK_LIB("avif_a.lib", "gd", PHP_GD) &&
|
||||
CHECK_LIB("aom_a.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
|
||||
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF");
|
||||
} else if (CHECK_LIB("avif.lib", "gd", PHP_GD) &&
|
||||
CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) {
|
||||
ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF");
|
||||
}
|
||||
|
||||
CHECK_LIB("User32.lib", "gd", PHP_GD);
|
||||
CHECK_LIB("Gdi32.lib", "gd", PHP_GD);
|
||||
|
||||
EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd");
|
||||
ADD_SOURCES("ext/gd/libgd", "gd.c \
|
||||
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
|
||||
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
|
||||
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
|
||||
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \
|
||||
gd_filter.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \
|
||||
gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd");
|
||||
|
||||
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
|
||||
AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD");
|
||||
AC_DEFINE('HAVE_GD_BMP', 1, "BMP support");
|
||||
AC_DEFINE('HAVE_GD_TGA', 1, "TGA support");
|
||||
ADD_FLAG("CFLAGS_GD", " \
|
||||
/D PHP_GD_EXPORTS=1 \
|
||||
/D HAVE_GD_GET_INTERPOLATION \
|
||||
");
|
||||
if (ICC_TOOLSET) {
|
||||
ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt");
|
||||
}
|
||||
|
||||
PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd");
|
||||
}
|
||||
@@ -13,10 +13,10 @@ declare(strict_types=1);
|
||||
|
||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||
$test_php_version = [
|
||||
// '8.1',
|
||||
'8.1',
|
||||
// '8.2',
|
||||
// '8.3',
|
||||
// '8.4',
|
||||
'8.4',
|
||||
'8.5',
|
||||
// 'git',
|
||||
];
|
||||
@@ -26,12 +26,12 @@ $test_os = [
|
||||
// 'macos-15-intel', // bin/spc for x86_64
|
||||
// 'macos-15', // bin/spc for arm64
|
||||
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
|
||||
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||
'ubuntu-24.04', // bin/spc for x86_64
|
||||
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
'ubuntu-24.04-arm', // bin/spc for arm64
|
||||
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
|
||||
// 'ubuntu-24.04', // bin/spc for x86_64
|
||||
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
|
||||
// 'ubuntu-24.04-arm', // bin/spc for arm64
|
||||
// 'windows-2022', // .\bin\spc.ps1
|
||||
// 'windows-2025',
|
||||
'windows-2025',
|
||||
];
|
||||
|
||||
// whether enable thread safe
|
||||
@@ -51,7 +51,7 @@ $prefer_pre_built = false;
|
||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||
$extensions = match (PHP_OS_FAMILY) {
|
||||
'Linux', 'Darwin' => 'pgsql',
|
||||
'Windows' => 'com_dotnet',
|
||||
'Windows' => 'gd,zlib,mbstring,filter',
|
||||
};
|
||||
|
||||
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
|
||||
@@ -62,7 +62,7 @@ $shared_extensions = match (PHP_OS_FAMILY) {
|
||||
};
|
||||
|
||||
// If you want to test lib-suggests for all extensions and libraries, set it to true.
|
||||
$with_suggested_libs = false;
|
||||
$with_suggested_libs = true;
|
||||
|
||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||
$with_libs = match (PHP_OS_FAMILY) {
|
||||
|
||||
Reference in New Issue
Block a user