mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 22:35:43 +08:00
Compare commits
456 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b04ffadf13 | ||
|
|
5681722c09 | ||
|
|
3ac4a71085 | ||
|
|
2963ced1d5 | ||
|
|
175aafee50 | ||
|
|
b75a3d6e81 | ||
|
|
f6d25153c6 | ||
|
|
853294e168 | ||
|
|
1a4296386a | ||
|
|
c464f78340 | ||
|
|
8992c96014 | ||
|
|
62a13f2da6 | ||
|
|
f9005757bd | ||
|
|
cd6aca832d | ||
|
|
1b4eb039ae | ||
|
|
6c47065686 | ||
|
|
9bfcea6feb | ||
|
|
58d979712e | ||
|
|
a0f99858e3 | ||
|
|
2abbb75f98 | ||
|
|
3f92df0865 | ||
|
|
be0b98c467 | ||
|
|
7d45415990 | ||
|
|
f3f581fe2d | ||
|
|
f6837079d3 | ||
|
|
5cd987ba3a | ||
|
|
8293160a01 | ||
|
|
625ee2703d | ||
|
|
c3b520c3d4 | ||
|
|
80687dfea3 | ||
|
|
7f9da6478f | ||
|
|
056971fcbc | ||
|
|
ba26359dde | ||
|
|
a2f0640b1b | ||
|
|
16a4245ad7 | ||
|
|
608a5559ac | ||
|
|
dfac385d21 | ||
|
|
40d602c82e | ||
|
|
fbd6360bda | ||
|
|
a0047e3ad7 | ||
|
|
437d6810b7 | ||
|
|
82ec7733ba | ||
|
|
1357990c4c | ||
|
|
61a9264802 | ||
|
|
4a70f260f3 | ||
|
|
bcea2007bd | ||
|
|
fcf2c967ab | ||
|
|
2f8e225abd | ||
|
|
5f3f999222 | ||
|
|
2bc9fef758 | ||
|
|
aec03b2f24 | ||
|
|
ba6ed137c6 | ||
|
|
32dc5d3cdb | ||
|
|
597db25178 | ||
|
|
c2d6b9ad2c | ||
|
|
4977286936 | ||
|
|
cc09184183 | ||
|
|
a9713c3bfa | ||
|
|
3af40a66dd | ||
|
|
6e70f16e1b | ||
|
|
16fccf8184 | ||
|
|
804468f7b9 | ||
|
|
7dc3b7c8ac | ||
|
|
b42409efd1 | ||
|
|
cb010d81ac | ||
|
|
15979d4636 | ||
|
|
1a164fa057 | ||
|
|
a76f49f927 | ||
|
|
becee5b426 | ||
|
|
4ecaffd908 | ||
|
|
74b1dda884 | ||
|
|
d6858e18df | ||
|
|
92284e92c9 | ||
|
|
f709f3bb18 | ||
|
|
8e2dffc3b5 | ||
|
|
ae569316ff | ||
|
|
eee2ff6d61 | ||
|
|
65b828c424 | ||
|
|
f10ba86218 | ||
|
|
24e19deb58 | ||
|
|
f7a3f80689 | ||
|
|
b4168d09b5 | ||
|
|
ba0ea5b40a | ||
|
|
04cefda66c | ||
|
|
8c6a708764 | ||
|
|
a1e76d9d02 | ||
|
|
82ee6f0dee | ||
|
|
d58534b07d | ||
|
|
f37c863092 | ||
|
|
e71f76288b | ||
|
|
d094824d76 | ||
|
|
d635b10e24 | ||
|
|
dca43d6d8d | ||
|
|
abf3bfb98e | ||
|
|
c46f8513dd | ||
|
|
92338d478e | ||
|
|
c1e68323c7 | ||
|
|
f64eb0dea5 | ||
|
|
c1870af1b1 | ||
|
|
71783088c0 | ||
|
|
7057a135cf | ||
|
|
5cb107b844 | ||
|
|
57b22782d3 | ||
|
|
cb0a90d1d9 | ||
|
|
1c439a01a1 | ||
|
|
2bfc8e92ef | ||
|
|
68548cf248 | ||
|
|
3a64feefd0 | ||
|
|
da75d2d707 | ||
|
|
3a85d96fa4 | ||
|
|
883cc4b6fd | ||
|
|
aa61a9e77b | ||
|
|
9de5c62136 | ||
|
|
7b3ea7e12e | ||
|
|
bafa67c8de | ||
|
|
0d3a80e582 | ||
|
|
5a401a5f92 | ||
|
|
0e88cdb258 | ||
|
|
e5cd3adf97 | ||
|
|
6253b7a912 | ||
|
|
fe455bf901 | ||
|
|
3a0d21eb44 | ||
|
|
45ec0cef24 | ||
|
|
1468bb99f0 | ||
|
|
3efabee153 | ||
|
|
962de5b25f | ||
|
|
b265d6dd56 | ||
|
|
302cf8345d | ||
|
|
d249391816 | ||
|
|
0a24a6af1f | ||
|
|
52f40b7f9f | ||
|
|
8fbe6ee8ff | ||
|
|
5a3a8db772 | ||
|
|
56cd6711ce | ||
|
|
29339b962c | ||
|
|
d9cd4d7e36 | ||
|
|
56080f40ef | ||
|
|
bb0a3589c1 | ||
|
|
db109e3586 | ||
|
|
289f4b300a | ||
|
|
0ee9a0cfa4 | ||
|
|
d9f7aa760e | ||
|
|
01ab0d3530 | ||
|
|
8bd7794a2e | ||
|
|
fcfbb59637 | ||
|
|
089b94d753 | ||
|
|
bfba598ef4 | ||
|
|
e2efaab2b2 | ||
|
|
28e5e584b4 | ||
|
|
e0734fe848 | ||
|
|
2ea8a7e662 | ||
|
|
c0ea47ce75 | ||
|
|
84fb354bc0 | ||
|
|
9f35c954ac | ||
|
|
78b3778442 | ||
|
|
0e092284eb | ||
|
|
4be1e75128 | ||
|
|
62a581393d | ||
|
|
cec5274ea3 | ||
|
|
80f2912026 | ||
|
|
70b91867cb | ||
|
|
a1ccddb53c | ||
|
|
5a7db86471 | ||
|
|
518ed3a7fd | ||
|
|
d322be1666 | ||
|
|
a503aaa8a0 | ||
|
|
a7771e95f2 | ||
|
|
311de9381c | ||
|
|
c3aa7356ec | ||
|
|
63656cf383 | ||
|
|
6d3e2d9316 | ||
|
|
dcdd167db3 | ||
|
|
9ed62b02b6 | ||
|
|
6b330fa869 | ||
|
|
5cc753dec4 | ||
|
|
f7a0f50f87 | ||
|
|
8466970a1f | ||
|
|
48cb87ada2 | ||
|
|
145fe7ce13 | ||
|
|
b320eb853a | ||
|
|
474fe63ad3 | ||
|
|
da45aa7f15 | ||
|
|
11f21304f9 | ||
|
|
6cb2cdd5a2 | ||
|
|
9e8119e69c | ||
|
|
25c2bafa88 | ||
|
|
ae56bed032 | ||
|
|
4c8f9e154d | ||
|
|
0ed6f2924e | ||
|
|
8896d477aa | ||
|
|
1b08a250f6 | ||
|
|
8b09e1a446 | ||
|
|
720251458f | ||
|
|
a48680c26f | ||
|
|
684b5d4534 | ||
|
|
aedcc86fc5 | ||
|
|
978975d396 | ||
|
|
c9e9119bff | ||
|
|
20f222d19e | ||
|
|
187d51e501 | ||
|
|
fa744bb802 | ||
|
|
bed5b9d4ef | ||
|
|
13540c8008 | ||
|
|
48df491c31 | ||
|
|
3fbf8fcfb8 | ||
|
|
104038bc7e | ||
|
|
bb37c0058e | ||
|
|
f4e1d7d4c1 | ||
|
|
e6c9a82cd3 | ||
|
|
0ca71b62db | ||
|
|
936c4d8696 | ||
|
|
1c1f7b19dd | ||
|
|
0558d67240 | ||
|
|
3bb9a7b1f8 | ||
|
|
123cc92756 | ||
|
|
9babe7f1d2 | ||
|
|
f46b714990 | ||
|
|
3497b2a760 | ||
|
|
acd10bd978 | ||
|
|
802950d941 | ||
|
|
f158fba48d | ||
|
|
059d134990 | ||
|
|
f7871c0036 | ||
|
|
42943b315c | ||
|
|
37b9ccfaa8 | ||
|
|
1cf2a3dd3f | ||
|
|
1718806042 | ||
|
|
7d26aa533a | ||
|
|
521af84797 | ||
|
|
53eb6dcc80 | ||
|
|
6ed440d861 | ||
|
|
a99c4a3fee | ||
|
|
0ebd44bc4f | ||
|
|
2f53915064 | ||
|
|
08d3849c43 | ||
|
|
bb1f086674 | ||
|
|
f4771b4f21 | ||
|
|
2093b4ec85 | ||
|
|
e5f483de1d | ||
|
|
23be5484e3 | ||
|
|
0b8543e6dd | ||
|
|
a3025479e7 | ||
|
|
a6ea49981d | ||
|
|
2a39fb0bd5 | ||
|
|
2dde53760a | ||
|
|
a7e48a8d3b | ||
|
|
4fae158a3c | ||
|
|
7d87856f4a | ||
|
|
cfa525351a | ||
|
|
f9de43c7d4 | ||
|
|
e00227f0c6 | ||
|
|
e31942bf1e | ||
|
|
111de20a57 | ||
|
|
635fbae3c9 | ||
|
|
f29ee95176 | ||
|
|
0d91ad7d94 | ||
|
|
715650c4db | ||
|
|
a68212672b | ||
|
|
fce115d39c | ||
|
|
301f2d8a97 | ||
|
|
500c19d900 | ||
|
|
617b0de31f | ||
|
|
92ad792eff | ||
|
|
560f684f7f | ||
|
|
a0c0555089 | ||
|
|
9fa1fb7b44 | ||
|
|
f5fa49338d | ||
|
|
df7cfa0d6a | ||
|
|
a0579efbc2 | ||
|
|
b6a1182876 | ||
|
|
4582e1f508 | ||
|
|
621e396373 | ||
|
|
300723419b | ||
|
|
f75ab9f428 | ||
|
|
dbc7ff5de7 | ||
|
|
856db3df08 | ||
|
|
1479bef00d | ||
|
|
3761a9c8ba | ||
|
|
7c4c8c6275 | ||
|
|
3b9670c202 | ||
|
|
861010af0e | ||
|
|
57b527c886 | ||
|
|
31652e8b04 | ||
|
|
8b94a7174f | ||
|
|
01a79fcc6e | ||
|
|
17b4c18830 | ||
|
|
86541b1aa8 | ||
|
|
e022a45048 | ||
|
|
94e31f1953 | ||
|
|
ad8581db97 | ||
|
|
e2191113b0 | ||
|
|
161a553948 | ||
|
|
80f63e66c3 | ||
|
|
2f25409475 | ||
|
|
67320d3eb3 | ||
|
|
92aeb2d816 | ||
|
|
3420f6ca42 | ||
|
|
8e5efb923f | ||
|
|
ab4e0bc406 | ||
|
|
8993b3f4f0 | ||
|
|
499c281931 | ||
|
|
bb7e0f6f89 | ||
|
|
8919a2fcca | ||
|
|
ba0796c9ea | ||
|
|
1b7404f194 | ||
|
|
5add534848 | ||
|
|
ef7ebdfd1f | ||
|
|
42f356d322 | ||
|
|
dabf52511f | ||
|
|
df85f97646 | ||
|
|
a9d37bb2a2 | ||
|
|
6b689f1584 | ||
|
|
4b0fa94b3c | ||
|
|
c53b06c3d2 | ||
|
|
ed87a7cd67 | ||
|
|
108bf34cca | ||
|
|
8b98792ccf | ||
|
|
7c009b6dce | ||
|
|
5ae5a3d75d | ||
|
|
396ddd3e6f | ||
|
|
da7a125faf | ||
|
|
febf9b1815 | ||
|
|
55b4ba5832 | ||
|
|
3bc5ac28be | ||
|
|
93eb6378ba | ||
|
|
61837f0d68 | ||
|
|
c44b8b1029 | ||
|
|
8312ce4d4c | ||
|
|
3052b1cca5 | ||
|
|
ad3860981a | ||
|
|
2dbcbc6963 | ||
|
|
8767181a80 | ||
|
|
4c64707138 | ||
|
|
764fdd4d08 | ||
|
|
4c124770ed | ||
|
|
78b2a89b0a | ||
|
|
6147721314 | ||
|
|
2a5915f4b6 | ||
|
|
5382362168 | ||
|
|
3867b9933d | ||
|
|
4299abf68b | ||
|
|
b68701f51b | ||
|
|
c551efb75c | ||
|
|
92acb95a58 | ||
|
|
e2ea10d2eb | ||
|
|
d833d8946c | ||
|
|
3662e079ac | ||
|
|
c972a94876 | ||
|
|
234df8d11f | ||
|
|
14ca782672 | ||
|
|
9665473669 | ||
|
|
a8987d48ed | ||
|
|
f83715c370 | ||
|
|
a9d5dcf4a2 | ||
|
|
e568041143 | ||
|
|
4ce7374ac9 | ||
|
|
ed35b65390 | ||
|
|
15dc672bcf | ||
|
|
51891478e4 | ||
|
|
c2d5afc4e9 | ||
|
|
835fc1e360 | ||
|
|
2a70b998e3 | ||
|
|
5eecd14ce0 | ||
|
|
0afe0e5f46 | ||
|
|
396d4b341f | ||
|
|
bc002d500e | ||
|
|
6a86b28977 | ||
|
|
b91c83b6cd | ||
|
|
4b8412dfdb | ||
|
|
3713ae8c93 | ||
|
|
310be957b6 | ||
|
|
c29ca9722f | ||
|
|
64b6f98ce7 | ||
|
|
4a44282556 | ||
|
|
e3d7969b96 | ||
|
|
b68d71b7b7 | ||
|
|
b376d1682f | ||
|
|
af51469b62 | ||
|
|
fc7df585bd | ||
|
|
3ff31d20cf | ||
|
|
11c116480f | ||
|
|
fd5bc54cd0 | ||
|
|
95380168ef | ||
|
|
d349627fa1 | ||
|
|
3f8d297fb1 | ||
|
|
aae6c2c98b | ||
|
|
7698ceb108 | ||
|
|
495e868a71 | ||
|
|
95a2f4600b | ||
|
|
c43423a7d0 | ||
|
|
fa285ecc82 | ||
|
|
f47daac3cc | ||
|
|
03ca3f4f59 | ||
|
|
a9f81dd38e | ||
|
|
93c6928624 | ||
|
|
1e50dac5a6 | ||
|
|
545a653c0d | ||
|
|
20b6870f90 | ||
|
|
ca6f19f77d | ||
|
|
14a0e1a6cc | ||
|
|
38dfcdabd0 | ||
|
|
683371adaa | ||
|
|
7ba1948101 | ||
|
|
5bd53ed714 | ||
|
|
bff99fa537 | ||
|
|
54ff71798c | ||
|
|
81474336c1 | ||
|
|
6b50700d8c | ||
|
|
f708907d99 | ||
|
|
117923791a | ||
|
|
ea7c145c62 | ||
|
|
bdd764218b | ||
|
|
1fbd2c1adc | ||
|
|
2ff300970a | ||
|
|
f88c10d4aa | ||
|
|
eab8c27e4a | ||
|
|
c1e91e1ccb | ||
|
|
05e9129a66 | ||
|
|
76a9be2167 | ||
|
|
872673655e | ||
|
|
1ae27c7b5a | ||
|
|
b402b735d6 | ||
|
|
22001792cd | ||
|
|
9557c9ef21 | ||
|
|
6fe8b591ce | ||
|
|
23ae3f60f3 | ||
|
|
03b634b961 | ||
|
|
2897fdda04 | ||
|
|
f5fffafd43 | ||
|
|
e884f97621 | ||
|
|
e4028da886 | ||
|
|
a65bc95091 | ||
|
|
14563417a7 | ||
|
|
a3ee3e5a24 | ||
|
|
16a36b8315 | ||
|
|
861c49c9bc | ||
|
|
b3dacf9c5a | ||
|
|
2c13eb257b | ||
|
|
348decf72f | ||
|
|
92483cf188 | ||
|
|
8143b1d768 | ||
|
|
e7d6f37e98 | ||
|
|
d275a44895 | ||
|
|
f755d66342 | ||
|
|
22a438ed5e | ||
|
|
a014294d58 | ||
|
|
39953b5223 | ||
|
|
bd341db54a | ||
|
|
455ed7d503 | ||
|
|
637ae89583 | ||
|
|
7fd858b472 | ||
|
|
74d8377400 | ||
|
|
a29992b907 | ||
|
|
57097d1275 | ||
|
|
b21c62c11d | ||
|
|
0b3421e3cd |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml, vue}]
|
||||
indent_size = 2
|
||||
12
.github/pull_request_template.md
vendored
12
.github/pull_request_template.md
vendored
@@ -7,7 +7,11 @@
|
||||
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
|
||||
> If a modification is not involved, please skip it directly.
|
||||
|
||||
- [ ] If you modified `*.php`, run `composer cs-fix` at local machine.
|
||||
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
|
||||
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
|
||||
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
|
||||
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
|
||||
- [ ] `PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix`
|
||||
- [ ] `composer analyse`
|
||||
- [ ] `composer test`
|
||||
- [ ] `bin/spc dev:sort-config`
|
||||
- If it's an extension or dependency update, please ensure the following:
|
||||
- [ ] Add your test combination to `src/globals/test-extensions.php`.
|
||||
- [ ] If adding new or fixing bugs, add commit message containing `extension test` or `test extensions` to trigger full test suite.
|
||||
|
||||
41
.github/workflows/build-unix.yml
vendored
41
.github/workflows/build-unix.yml
vendored
@@ -53,6 +53,46 @@ on:
|
||||
description: Keep debug symbols for debugging
|
||||
type: boolean
|
||||
default: false
|
||||
workflow_call:
|
||||
inputs:
|
||||
os:
|
||||
required: true
|
||||
description: Build target OS
|
||||
default: 'linux-x86_64'
|
||||
type: string
|
||||
php-version:
|
||||
required: true
|
||||
description: PHP version to compile
|
||||
default: '8.4'
|
||||
type: string
|
||||
extensions:
|
||||
description: Extensions to build (comma separated)
|
||||
required: true
|
||||
type: string
|
||||
extra-libs:
|
||||
description: Extra libraries to build (optional, comma separated)
|
||||
type: string
|
||||
build-cli:
|
||||
description: Build cli binary
|
||||
default: true
|
||||
type: boolean
|
||||
build-micro:
|
||||
description: Build phpmicro binary
|
||||
type: boolean
|
||||
build-fpm:
|
||||
description: Build fpm binary
|
||||
type: boolean
|
||||
prefer-pre-built:
|
||||
description: Prefer pre-built binaries (reduce build time)
|
||||
type: boolean
|
||||
default: true
|
||||
debug:
|
||||
description: Show full build logs
|
||||
type: boolean
|
||||
no-strip:
|
||||
description: Keep debug symbols for debugging
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -154,7 +194,6 @@ jobs:
|
||||
with:
|
||||
path: downloads
|
||||
key: php-dependencies-${{ inputs.os }}
|
||||
|
||||
- name: "Download sources"
|
||||
run: ${{ needs.define-build.outputs.download }}
|
||||
- name: "Build PHP"
|
||||
|
||||
8
.github/workflows/ext-matrix-tests.yml
vendored
8
.github/workflows/ext-matrix-tests.yml
vendored
@@ -1,16 +1,14 @@
|
||||
name: "Extension matrix tests"
|
||||
name: "Extension Matrix Tests"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- '.github/workflows/ext-matrix-tests.yml'
|
||||
push:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@@ -17,8 +17,7 @@ on:
|
||||
- 'box.json'
|
||||
- '.php-cs-fixer.php'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
permissions: read-all
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -5,22 +5,25 @@ docker/extensions/
|
||||
docker/source/
|
||||
|
||||
# Vendor files
|
||||
/vendor/
|
||||
/vendor/**
|
||||
|
||||
# default source extract directory
|
||||
/source/
|
||||
/source/**
|
||||
|
||||
# built by shared embed tests
|
||||
/locale/
|
||||
|
||||
# default source download directory
|
||||
/downloads/
|
||||
/downloads/**
|
||||
|
||||
# default source build root directory
|
||||
/buildroot/
|
||||
/buildroot/**
|
||||
|
||||
# default package root directory
|
||||
/pkgroot/
|
||||
/pkgroot/**
|
||||
|
||||
# default pack:lib and release directory
|
||||
/dist/
|
||||
/dist/**
|
||||
packlib_files.txt
|
||||
|
||||
# tools cache files
|
||||
@@ -47,3 +50,7 @@ packlib_files.txt
|
||||
/docs/.vitepress/cache/
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
|
||||
# craft.log
|
||||
craft.log
|
||||
craft.yml
|
||||
|
||||
@@ -278,7 +278,7 @@ bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=sys
|
||||
|
||||
如果你知道 [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
|
||||
|
||||
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/dunglas/frankenphp/blob/main/docs/static.md)。
|
||||
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/php/frankenphp/blob/main/docs/static.md)。
|
||||
|
||||
## 贡献
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ If you know [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),
|
||||
You may require the introduction of other libraries during compilation,
|
||||
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
|
||||
|
||||
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/static.md).
|
||||
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/php/frankenphp/blob/main/docs/static.md).
|
||||
|
||||
## Contribution
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# This file is using docker to run commands
|
||||
SPC_DOCKER_VERSION=v4
|
||||
|
||||
# Detect docker can run
|
||||
if ! which docker >/dev/null; then
|
||||
echo "Docker is not installed, please install docker first !"
|
||||
exit 1
|
||||
echo "Docker is not installed, please install docker first !"
|
||||
exit 1
|
||||
fi
|
||||
DOCKER_EXECUTABLE="docker"
|
||||
# shellcheck disable=SC2046
|
||||
@@ -21,27 +24,48 @@ if [ $(id -u) -ne 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# to check if qemu-docker run
|
||||
if [ "$SPC_USE_ARCH" = "" ]; then
|
||||
SPC_USE_ARCH=x86_64
|
||||
# Convert uname to gnu arch
|
||||
CURRENT_ARCH=$(uname -m)
|
||||
if [ "$CURRENT_ARCH" = "arm64" ]; then
|
||||
CURRENT_ARCH=aarch64
|
||||
fi
|
||||
if [ -z "$SPC_USE_ARCH" ]; then
|
||||
SPC_USE_ARCH=$CURRENT_ARCH
|
||||
fi
|
||||
# parse SPC_USE_ARCH
|
||||
case $SPC_USE_ARCH in
|
||||
x86_64)
|
||||
ALPINE_FROM=alpine:edge
|
||||
x86_64|amd64)
|
||||
SPC_USE_ARCH=x86_64
|
||||
if [ "$CURRENT_ARCH" != "x86_64" ]; then
|
||||
PLATFORM_ARG="--platform linux/amd64"
|
||||
ALPINE_FROM=multiarch/alpine:x86_64-edge
|
||||
fi
|
||||
;;
|
||||
aarch64)
|
||||
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
||||
# shellcheck disable=SC2039
|
||||
echo -e "\e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
|
||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
||||
aarch64|arm64)
|
||||
SPC_USE_ARCH=aarch64
|
||||
if [ "$CURRENT_ARCH" != "aarch64" ]; then
|
||||
PLATFORM_ARG="--platform linux/arm64"
|
||||
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# if ALPINE_FROM is not set, use alpine:edge
|
||||
if [ -z "$ALPINE_FROM" ]; then
|
||||
ALPINE_FROM=alpine:edge
|
||||
fi
|
||||
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
|
||||
echo "* Using different arch needs to setup qemu-static for docker !"
|
||||
ALPINE_FROM=multiarch/alpine:$SPC_USE_ARCH-edge
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
||||
fi
|
||||
else
|
||||
ALPINE_FROM=alpine:edge
|
||||
fi
|
||||
|
||||
if [ "$SPC_USE_MIRROR" = "yes" ]; then
|
||||
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
|
||||
@@ -50,9 +74,9 @@ else
|
||||
fi
|
||||
|
||||
# Detect docker env is setup
|
||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH-v2; then
|
||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
|
||||
echo "Docker container does not exist. Building docker image ..."
|
||||
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH-v2 -f- . <<EOF
|
||||
$DOCKER_EXECUTABLE build $PLATFORM_ARG -t cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
|
||||
FROM $ALPINE_FROM
|
||||
$SPC_USE_MIRROR
|
||||
RUN apk update; \
|
||||
@@ -83,7 +107,8 @@ RUN apk update; \
|
||||
wget \
|
||||
xz \
|
||||
gettext-dev \
|
||||
binutils-gold
|
||||
binutils-gold \
|
||||
patchelf
|
||||
|
||||
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
|
||||
chmod +x /usr/local/bin/php
|
||||
@@ -116,6 +141,16 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||
if [ -f "$(pwd)/craft.yml" ]; then
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||
fi
|
||||
|
||||
# Environment variable passthrough
|
||||
ENV_LIST=""
|
||||
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
|
||||
if [ ! -z "$GITHUB_TOKEN" ]; then
|
||||
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
|
||||
fi
|
||||
|
||||
# Run docker
|
||||
# shellcheck disable=SC2068
|
||||
@@ -135,8 +170,8 @@ if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
|
||||
echo "* ./downloads: $(pwd)/downloads"
|
||||
echo "* ./pkgroot: $(pwd)/pkgroot"
|
||||
echo "*"
|
||||
|
||||
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-v2
|
||||
set -ex
|
||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
|
||||
else
|
||||
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-v2 bin/spc $@
|
||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc $@
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This file is using docker to run commands
|
||||
set -e
|
||||
|
||||
# This file is using docker to run commands
|
||||
SPC_DOCKER_VERSION=v4
|
||||
|
||||
# Detect docker can run
|
||||
if ! which docker >/dev/null; then
|
||||
echo "Docker is not installed, please install docker first !"
|
||||
@@ -22,35 +24,47 @@ if [ $(id -u) -ne 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# to check if qemu-docker run
|
||||
if [ "$SPC_USE_ARCH" = "" ]; then
|
||||
SPC_USE_ARCH=current
|
||||
# Convert uname to gnu arch
|
||||
CURRENT_ARCH=$(uname -m)
|
||||
if [ "$CURRENT_ARCH" = "arm64" ]; then
|
||||
CURRENT_ARCH=aarch64
|
||||
fi
|
||||
if [ -z "$SPC_USE_ARCH" ]; then
|
||||
SPC_USE_ARCH=$CURRENT_ARCH
|
||||
fi
|
||||
# parse SPC_USE_ARCH
|
||||
case $SPC_USE_ARCH in
|
||||
current)
|
||||
BASE_ARCH=$(uname -m)
|
||||
if [ "$BASE_ARCH" = "arm64" ]; then
|
||||
BASE_ARCH=aarch64
|
||||
x86_64|amd64)
|
||||
SPC_USE_ARCH=x86_64
|
||||
SPC_USE_ARCH_DOCKER=amd64
|
||||
if [ "$CURRENT_ARCH" != "x86_64" ]; then
|
||||
PLATFORM_ARG="--platform linux/amd64"
|
||||
fi
|
||||
;;
|
||||
aarch64)
|
||||
BASE_ARCH=aarch64
|
||||
# shellcheck disable=SC2039
|
||||
echo -e "\e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
|
||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
||||
aarch64|arm64)
|
||||
SPC_USE_ARCH=aarch64
|
||||
SPC_USE_ARCH_DOCKER=arm64
|
||||
if [ "$CURRENT_ARCH" != "aarch64" ]; then
|
||||
PLATFORM_ARG="--platform linux/arm64"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
# detect if we need to use qemu-static
|
||||
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
echo "* Using different arch needs to setup qemu-static for docker !"
|
||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static --reset -p yes > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
# Detect docker env is setup
|
||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-gnu-$SPC_USE_ARCH; then
|
||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
|
||||
echo "Docker container does not exist. Building docker image ..."
|
||||
$DOCKER_EXECUTABLE build -t cwcc-spc-gnu-$SPC_USE_ARCH -f- . <<EOF
|
||||
$DOCKER_EXECUTABLE buildx build $PLATFORM_ARG --no-cache -t cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
|
||||
FROM centos:7
|
||||
RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
|
||||
sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
|
||||
@@ -62,7 +76,7 @@ RUN yum clean all && \
|
||||
|
||||
RUN yum install -y centos-release-scl
|
||||
|
||||
RUN if [ "$BASE_ARCH" = "aarch64" ]; then \
|
||||
RUN if [ "$SPC_USE_ARCH" = "aarch64" ]; then \
|
||||
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo ; \
|
||||
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo ; \
|
||||
else \
|
||||
@@ -75,8 +89,14 @@ RUN yum update -y && \
|
||||
yum install -y devtoolset-10-gcc-*
|
||||
RUN echo "source scl_source enable devtoolset-10" >> /etc/bashrc
|
||||
RUN source /etc/bashrc
|
||||
RUN yum install -y which
|
||||
|
||||
RUN curl -o cmake.tgz -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$BASE_ARCH.tar.gz && \
|
||||
RUN curl -fsSL -o patchelf.tgz https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-$SPC_USE_ARCH.tar.gz && \
|
||||
mkdir -p /patchelf && \
|
||||
tar -xzf patchelf.tgz -C /patchelf --strip-components=1 && \
|
||||
cp /patchelf/bin/patchelf /usr/bin/
|
||||
|
||||
RUN curl -o cmake.tgz -fsSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$SPC_USE_ARCH.tar.gz && \
|
||||
mkdir /cmake && \
|
||||
tar -xzf cmake.tgz -C /cmake --strip-components 1
|
||||
|
||||
@@ -91,7 +111,7 @@ ENV PATH="/app/bin:/cmake/bin:$PATH"
|
||||
ENV SPC_LIBC=glibc
|
||||
|
||||
ADD ./config/env.ini /app/config/env.ini
|
||||
RUN bin/spc doctor --auto-fix --debug
|
||||
RUN CC=gcc bin/spc doctor --auto-fix --debug
|
||||
|
||||
RUN curl -o make.tgz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
|
||||
tar -zxvf make.tgz && \
|
||||
@@ -129,17 +149,27 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||
if [ -f "$(pwd)/craft.yml" ]; then
|
||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||
fi
|
||||
|
||||
# Apply env in temp env file
|
||||
echo 'CC=/opt/rh/devtoolset-10/root/usr/bin/gcc' > /tmp/spc-gnu-docker.env
|
||||
echo 'CXX=/opt/rh/devtoolset-10/root/usr/bin/g++' >> /tmp/spc-gnu-docker.env
|
||||
echo 'AR=/opt/rh/devtoolset-10/root/usr/bin/ar' >> /tmp/spc-gnu-docker.env
|
||||
echo 'LD=/opt/rh/devtoolset-10/root/usr/bin/ld' >> /tmp/spc-gnu-docker.env
|
||||
echo 'SPC_DEFAULT_C_FLAGS=-fPIE -fPIC' >> /tmp/spc-gnu-docker.env
|
||||
echo 'SPC_DEFAULT_C_FLAGS=-fPIC' >> /tmp/spc-gnu-docker.env
|
||||
echo 'SPC_LIBC=glibc' >> /tmp/spc-gnu-docker.env
|
||||
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"' >> /tmp/spc-gnu-docker.env
|
||||
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil -lrt"' >> /tmp/spc-gnu-docker.env
|
||||
|
||||
# Environment variable passthrough
|
||||
ENV_LIST=""
|
||||
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
|
||||
if [ ! -z "$GITHUB_TOKEN" ]; then
|
||||
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
|
||||
fi
|
||||
|
||||
# Run docker
|
||||
# shellcheck disable=SC2068
|
||||
# shellcheck disable=SC2086
|
||||
@@ -159,8 +189,8 @@ if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
|
||||
echo "* ./downloads: $(pwd)/downloads"
|
||||
echo "* ./pkgroot: $(pwd)/pkgroot"
|
||||
echo "*"
|
||||
|
||||
$DOCKER_EXECUTABLE run --rm -it --privileged $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH
|
||||
set -ex
|
||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --privileged --rm -it $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
|
||||
else
|
||||
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH bin/spc $@
|
||||
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc $@
|
||||
fi
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
"ext-zlib": "*",
|
||||
"laravel/prompts": "^0.1.12",
|
||||
"symfony/console": "^5.4 || ^6 || ^7",
|
||||
"symfony/process": "^7.2",
|
||||
"symfony/yaml": "^7.2",
|
||||
"zhamao/logger": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
440
composer.lock
generated
440
composer.lock
generated
@@ -4,20 +4,20 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "7e3bd0c36428da870d1a0ae206c3b83e",
|
||||
"content-hash": "d705cec8270679a463d9e04310208967",
|
||||
"packages": [
|
||||
{
|
||||
"name": "illuminate/collections",
|
||||
"version": "v11.44.1",
|
||||
"version": "v11.44.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/collections.git",
|
||||
"reference": "48f5357348093bc8b94c691aa3ffc861d2ecc2a0"
|
||||
"reference": "856b1da953e46281ba61d7c82d337072d3ee1825"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/collections/zipball/48f5357348093bc8b94c691aa3ffc861d2ecc2a0",
|
||||
"reference": "48f5357348093bc8b94c691aa3ffc861d2ecc2a0",
|
||||
"url": "https://api.github.com/repos/illuminate/collections/zipball/856b1da953e46281ba61d7c82d337072d3ee1825",
|
||||
"reference": "856b1da953e46281ba61d7c82d337072d3ee1825",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -60,20 +60,20 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-02-28T16:55:51+00:00"
|
||||
"time": "2025-03-24T11:54:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/conditionable",
|
||||
"version": "v11.44.1",
|
||||
"version": "v11.44.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/conditionable.git",
|
||||
"reference": "911df1bda950a3b799cf80671764e34eede131c6"
|
||||
"reference": "319b717e0587bd7c8a3b44464f0e27867b4bcda9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/conditionable/zipball/911df1bda950a3b799cf80671764e34eede131c6",
|
||||
"reference": "911df1bda950a3b799cf80671764e34eede131c6",
|
||||
"url": "https://api.github.com/repos/illuminate/conditionable/zipball/319b717e0587bd7c8a3b44464f0e27867b4bcda9",
|
||||
"reference": "319b717e0587bd7c8a3b44464f0e27867b4bcda9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -106,20 +106,20 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2024-11-21T16:28:56+00:00"
|
||||
"time": "2025-03-24T11:54:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/contracts",
|
||||
"version": "v11.44.1",
|
||||
"version": "v11.44.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/contracts.git",
|
||||
"reference": "b350a3cd8450846325cb49e1cbc1293598b18898"
|
||||
"reference": "4b2a67d1663f50085bc91e6371492697a5d2d4e8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/b350a3cd8450846325cb49e1cbc1293598b18898",
|
||||
"reference": "b350a3cd8450846325cb49e1cbc1293598b18898",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/4b2a67d1663f50085bc91e6371492697a5d2d4e8",
|
||||
"reference": "4b2a67d1663f50085bc91e6371492697a5d2d4e8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -154,11 +154,11 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2025-02-10T14:20:57+00:00"
|
||||
"time": "2025-03-24T11:54:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/macroable",
|
||||
"version": "v11.44.1",
|
||||
"version": "v11.44.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/macroable.git",
|
||||
@@ -416,16 +416,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v6.4.17",
|
||||
"version": "v6.4.20",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04"
|
||||
"reference": "2e4af9c952617cc3f9559ff706aee420a8464c36"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04",
|
||||
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/2e4af9c952617cc3f9559ff706aee420a8464c36",
|
||||
"reference": "2e4af9c952617cc3f9559ff706aee420a8464c36",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -490,7 +490,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v6.4.17"
|
||||
"source": "https://github.com/symfony/console/tree/v6.4.20"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -506,7 +506,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-07T12:07:30+00:00"
|
||||
"time": "2025-03-03T17:16:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -893,6 +893,67 @@
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v7.2.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "87b7c93e57df9d8e39a093d32587702380ff045d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d",
|
||||
"reference": "87b7c93e57df9d8e39a093d32587702380ff045d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Process\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v7.2.5"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-13T12:21:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "v3.5.1",
|
||||
@@ -1064,17 +1125,89 @@
|
||||
"time": "2024-11-13T13:31:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zhamao/logger",
|
||||
"version": "1.1.1",
|
||||
"name": "symfony/yaml",
|
||||
"version": "v7.2.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zhamao-robot/zhamao-logger.git",
|
||||
"reference": "1b7e34349330a842887d816f0344aba996cfeec0"
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zhamao-robot/zhamao-logger/zipball/1b7e34349330a842887d816f0344aba996cfeec0",
|
||||
"reference": "1b7e34349330a842887d816f0344aba996cfeec0",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
|
||||
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/console": "<6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "^6.4|^7.0"
|
||||
},
|
||||
"bin": [
|
||||
"Resources/bin/yaml-lint"
|
||||
],
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Yaml\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Loads and dumps YAML files",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/yaml/tree/v7.2.5"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-03T07:12:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zhamao/logger",
|
||||
"version": "1.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zhamao-robot/zhamao-logger.git",
|
||||
"reference": "1d7427abd8b1b3387ed7d9244953049356db3e62"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zhamao-robot/zhamao-logger/zipball/1d7427abd8b1b3387ed7d9244953049356db3e62",
|
||||
"reference": "1d7427abd8b1b3387ed7d9244953049356db3e62",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1128,9 +1261,9 @@
|
||||
"description": "Another Console Logger for CLI Applications",
|
||||
"support": {
|
||||
"issues": "https://github.com/zhamao-robot/zhamao-logger/issues",
|
||||
"source": "https://github.com/zhamao-robot/zhamao-logger/tree/1.1.1"
|
||||
"source": "https://github.com/zhamao-robot/zhamao-logger/tree/1.1.2"
|
||||
},
|
||||
"time": "2023-03-09T15:41:10+00:00"
|
||||
"time": "2025-04-24T02:02:28+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
@@ -1217,16 +1350,16 @@
|
||||
},
|
||||
{
|
||||
"name": "amphp/byte-stream",
|
||||
"version": "v2.1.1",
|
||||
"version": "v2.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/byte-stream.git",
|
||||
"reference": "daa00f2efdbd71565bf64ffefa89e37542addf93"
|
||||
"reference": "55a6bd071aec26fa2a3e002618c20c35e3df1b46"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/byte-stream/zipball/daa00f2efdbd71565bf64ffefa89e37542addf93",
|
||||
"reference": "daa00f2efdbd71565bf64ffefa89e37542addf93",
|
||||
"url": "https://api.github.com/repos/amphp/byte-stream/zipball/55a6bd071aec26fa2a3e002618c20c35e3df1b46",
|
||||
"reference": "55a6bd071aec26fa2a3e002618c20c35e3df1b46",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1280,7 +1413,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/byte-stream/issues",
|
||||
"source": "https://github.com/amphp/byte-stream/tree/v2.1.1"
|
||||
"source": "https://github.com/amphp/byte-stream/tree/v2.1.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1288,7 +1421,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-02-17T04:49:38+00:00"
|
||||
"time": "2025-03-16T17:10:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/cache",
|
||||
@@ -1592,16 +1725,16 @@
|
||||
},
|
||||
{
|
||||
"name": "amphp/pipeline",
|
||||
"version": "v1.2.2",
|
||||
"version": "v1.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/pipeline.git",
|
||||
"reference": "97cbf289f4d8877acfe58dd90ed5a4370a43caa4"
|
||||
"reference": "7b52598c2e9105ebcddf247fc523161581930367"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/pipeline/zipball/97cbf289f4d8877acfe58dd90ed5a4370a43caa4",
|
||||
"reference": "97cbf289f4d8877acfe58dd90ed5a4370a43caa4",
|
||||
"url": "https://api.github.com/repos/amphp/pipeline/zipball/7b52598c2e9105ebcddf247fc523161581930367",
|
||||
"reference": "7b52598c2e9105ebcddf247fc523161581930367",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1647,7 +1780,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/pipeline/issues",
|
||||
"source": "https://github.com/amphp/pipeline/tree/v1.2.2"
|
||||
"source": "https://github.com/amphp/pipeline/tree/v1.2.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1655,7 +1788,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-19T15:42:46+00:00"
|
||||
"time": "2025-03-16T16:33:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/process",
|
||||
@@ -1944,23 +2077,23 @@
|
||||
},
|
||||
{
|
||||
"name": "captainhook/captainhook-phar",
|
||||
"version": "5.25.0",
|
||||
"version": "5.25.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/captainhookphp/captainhook-phar.git",
|
||||
"reference": "de7a0e8a2d4ee7b63f46ac61c6f9a89ff0a30011"
|
||||
"url": "https://github.com/captainhook-git/captainhook-phar.git",
|
||||
"reference": "ab47b0561ec7997bf9b88181d090857874f2cf8c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/captainhookphp/captainhook-phar/zipball/de7a0e8a2d4ee7b63f46ac61c6f9a89ff0a30011",
|
||||
"reference": "de7a0e8a2d4ee7b63f46ac61c6f9a89ff0a30011",
|
||||
"url": "https://api.github.com/repos/captainhook-git/captainhook-phar/zipball/ab47b0561ec7997bf9b88181d090857874f2cf8c",
|
||||
"reference": "ab47b0561ec7997bf9b88181d090857874f2cf8c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^1.1||^2.0",
|
||||
"ext-json": "*",
|
||||
"ext-spl": "*",
|
||||
"phar-io/composer-distributor": "^1.0",
|
||||
"phar-io/composer-distributor": "^1.0.1",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -1998,7 +2131,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/captainhookphp/captainhook/issues",
|
||||
"source": "https://github.com/captainhookphp/captainhook-phar/tree/5.25.0"
|
||||
"source": "https://github.com/captainhook-git/captainhook-phar/tree/5.25.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2006,20 +2139,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-16T12:46:49+00:00"
|
||||
"time": "2025-03-30T17:19:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "captainhook/hook-installer",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/captainhookphp/hook-installer.git",
|
||||
"reference": "3308a9152727af4e3d1c7b63ca219d6938b702b8"
|
||||
"url": "https://github.com/captainhook-git/hook-installer.git",
|
||||
"reference": "fb3c45f6204b08baba999f4ffc4ae707bf684e8b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/captainhookphp/hook-installer/zipball/3308a9152727af4e3d1c7b63ca219d6938b702b8",
|
||||
"reference": "3308a9152727af4e3d1c7b63ca219d6938b702b8",
|
||||
"url": "https://api.github.com/repos/captainhook-git/hook-installer/zipball/fb3c45f6204b08baba999f4ffc4ae707bf684e8b",
|
||||
"reference": "fb3c45f6204b08baba999f4ffc4ae707bf684e8b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2050,10 +2183,10 @@
|
||||
],
|
||||
"description": "Composer Plugin that makes everyone activate the CaptainHook git hooks locally",
|
||||
"support": {
|
||||
"issues": "https://github.com/captainhookphp/hook-installer/issues",
|
||||
"source": "https://github.com/captainhookphp/hook-installer/tree/1.0.3"
|
||||
"issues": "https://github.com/captainhook-git/hook-installer/issues",
|
||||
"source": "https://github.com/captainhook-git/hook-installer/tree/1.0.4"
|
||||
},
|
||||
"time": "2024-03-21T13:39:59+00:00"
|
||||
"time": "2025-04-08T07:12:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "clue/ndjson-react",
|
||||
@@ -2391,26 +2524,29 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/deprecations",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/deprecations.git",
|
||||
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
|
||||
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
|
||||
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
|
||||
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
||||
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<=7.5 || >=13"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^9 || ^12",
|
||||
"phpstan/phpstan": "1.4.10 || 2.0.3",
|
||||
"doctrine/coding-standard": "^9 || ^12 || ^13",
|
||||
"phpstan/phpstan": "1.4.10 || 2.1.11",
|
||||
"phpstan/phpstan-phpunit": "^1.0 || ^2",
|
||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
|
||||
"psr/log": "^1 || ^2 || ^3"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -2430,9 +2566,9 @@
|
||||
"homepage": "https://www.doctrine-project.org/",
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/deprecations/issues",
|
||||
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
|
||||
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
|
||||
},
|
||||
"time": "2024-12-07T21:18:45+00:00"
|
||||
"time": "2025-04-07T20:06:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "evenement/evenement",
|
||||
@@ -2696,16 +2832,16 @@
|
||||
},
|
||||
{
|
||||
"name": "filp/whoops",
|
||||
"version": "2.17.0",
|
||||
"version": "2.18.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/filp/whoops.git",
|
||||
"reference": "075bc0c26631110584175de6523ab3f1652eb28e"
|
||||
"reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/075bc0c26631110584175de6523ab3f1652eb28e",
|
||||
"reference": "075bc0c26631110584175de6523ab3f1652eb28e",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e",
|
||||
"reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2755,7 +2891,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/filp/whoops/issues",
|
||||
"source": "https://github.com/filp/whoops/tree/2.17.0"
|
||||
"source": "https://github.com/filp/whoops/tree/2.18.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2763,20 +2899,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-25T12:00:00+00:00"
|
||||
"time": "2025-03-15T12:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.70.2",
|
||||
"version": "v3.75.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "1ca468270efbb75ce0c7566a79cca8ea2888584d"
|
||||
"reference": "399a128ff2fdaf4281e4e79b755693286cdf325c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/1ca468270efbb75ce0c7566a79cca8ea2888584d",
|
||||
"reference": "1ca468270efbb75ce0c7566a79cca8ea2888584d",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/399a128ff2fdaf4281e4e79b755693286cdf325c",
|
||||
"reference": "399a128ff2fdaf4281e4e79b755693286cdf325c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2784,6 +2920,7 @@
|
||||
"composer/semver": "^3.4",
|
||||
"composer/xdebug-handler": "^3.0.3",
|
||||
"ext-filter": "*",
|
||||
"ext-hash": "*",
|
||||
"ext-json": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"fidry/cpu-core-counter": "^1.2",
|
||||
@@ -2806,18 +2943,18 @@
|
||||
"symfony/stopwatch": "^5.4 || ^6.4 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.5",
|
||||
"infection/infection": "^0.29.10",
|
||||
"justinrainbow/json-schema": "^5.3 || ^6.0",
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.6",
|
||||
"infection/infection": "^0.29.14",
|
||||
"justinrainbow/json-schema": "^5.3 || ^6.2",
|
||||
"keradus/cli-executor": "^2.1",
|
||||
"mikey179/vfsstream": "^1.6.12",
|
||||
"php-coveralls/php-coveralls": "^2.7",
|
||||
"php-cs-fixer/accessible-object": "^1.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
|
||||
"phpunit/phpunit": "^9.6.22 || ^10.5.45 || ^11.5.7",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.18 || ^7.2.0",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.18 || ^7.2.0"
|
||||
"phpunit/phpunit": "^9.6.22 || ^10.5.45 || ^11.5.12",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.18 || ^7.2.3",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.18 || ^7.2.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "For handling output formats in XML",
|
||||
@@ -2858,7 +2995,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.70.2"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.75.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2866,7 +3003,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-03T21:07:23+00:00"
|
||||
"time": "2025-03-31T18:40:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "humbug/box",
|
||||
@@ -3579,40 +3716,40 @@
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/collision",
|
||||
"version": "v7.11.0",
|
||||
"version": "v7.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nunomaduro/collision.git",
|
||||
"reference": "994ea93df5d4132f69d3f1bd74730509df6e8a05"
|
||||
"reference": "995245421d3d7593a6960822063bdba4f5d7cf1a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/994ea93df5d4132f69d3f1bd74730509df6e8a05",
|
||||
"reference": "994ea93df5d4132f69d3f1bd74730509df6e8a05",
|
||||
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/995245421d3d7593a6960822063bdba4f5d7cf1a",
|
||||
"reference": "995245421d3d7593a6960822063bdba4f5d7cf1a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"filp/whoops": "^2.16.0",
|
||||
"nunomaduro/termwind": "^1.15.1",
|
||||
"filp/whoops": "^2.17.0",
|
||||
"nunomaduro/termwind": "^1.17.0",
|
||||
"php": "^8.1.0",
|
||||
"symfony/console": "^6.4.12"
|
||||
"symfony/console": "^6.4.17"
|
||||
},
|
||||
"conflict": {
|
||||
"laravel/framework": ">=11.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"brianium/paratest": "^7.3.1",
|
||||
"laravel/framework": "^10.48.22",
|
||||
"laravel/pint": "^1.18.1",
|
||||
"laravel/sail": "^1.36.0",
|
||||
"brianium/paratest": "^7.4.8",
|
||||
"laravel/framework": "^10.48.29",
|
||||
"laravel/pint": "^1.21.2",
|
||||
"laravel/sail": "^1.41.0",
|
||||
"laravel/sanctum": "^3.3.3",
|
||||
"laravel/tinker": "^2.10.0",
|
||||
"nunomaduro/larastan": "^2.9.8",
|
||||
"orchestra/testbench-core": "^8.28.3",
|
||||
"pestphp/pest": "^2.35.1",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"nunomaduro/larastan": "^2.10.0",
|
||||
"orchestra/testbench-core": "^8.35.0",
|
||||
"pestphp/pest": "^2.36.0",
|
||||
"phpunit/phpunit": "^10.5.36",
|
||||
"sebastian/environment": "^6.1.0",
|
||||
"spatie/laravel-ignition": "^2.8.0"
|
||||
"spatie/laravel-ignition": "^2.9.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -3671,7 +3808,7 @@
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2024-10-15T15:12:40+00:00"
|
||||
"time": "2025-03-14T22:35:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nunomaduro/termwind",
|
||||
@@ -4145,16 +4282,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-docblock",
|
||||
"version": "5.6.1",
|
||||
"version": "5.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
||||
"reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
|
||||
"reference": "92dde6a5919e34835c506ac8c523ef095a95ed62"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
|
||||
"reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
|
||||
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62",
|
||||
"reference": "92dde6a5919e34835c506ac8c523ef095a95ed62",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4203,9 +4340,9 @@
|
||||
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
|
||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
|
||||
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2"
|
||||
},
|
||||
"time": "2024-12-07T09:39:29+00:00"
|
||||
"time": "2025-04-13T19:20:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/type-resolver",
|
||||
@@ -4314,16 +4451,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.12.20",
|
||||
"version": "1.12.24",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "3240b1972042c7f73cf1045e879ea5bd5f761bb7"
|
||||
"reference": "338b92068f58d9f8035b76aed6cf2b9e5624c025"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/3240b1972042c7f73cf1045e879ea5bd5f761bb7",
|
||||
"reference": "3240b1972042c7f73cf1045e879ea5bd5f761bb7",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/338b92068f58d9f8035b76aed6cf2b9e5624c025",
|
||||
"reference": "338b92068f58d9f8035b76aed6cf2b9e5624c025",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4368,7 +4505,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-03-05T13:37:43+00:00"
|
||||
"time": "2025-04-16T13:01:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -7085,67 +7222,6 @@
|
||||
],
|
||||
"time": "2024-09-09T12:04:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v7.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf",
|
||||
"reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Process\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v7.2.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-05T08:33:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/stopwatch",
|
||||
"version": "v7.2.4",
|
||||
@@ -7293,16 +7369,16 @@
|
||||
},
|
||||
{
|
||||
"name": "thecodingmachine/safe",
|
||||
"version": "v3.0.2",
|
||||
"version": "v3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thecodingmachine/safe.git",
|
||||
"reference": "22ffad3248982a784f9870a37aeb2e522bd19645"
|
||||
"reference": "e14ac96126e6c19ea9d1f4029abb51487f4cf2cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/22ffad3248982a784f9870a37aeb2e522bd19645",
|
||||
"reference": "22ffad3248982a784f9870a37aeb2e522bd19645",
|
||||
"url": "https://api.github.com/repos/thecodingmachine/safe/zipball/e14ac96126e6c19ea9d1f4029abb51487f4cf2cf",
|
||||
"reference": "e14ac96126e6c19ea9d1f4029abb51487f4cf2cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -7412,7 +7488,7 @@
|
||||
"description": "PHP core functions that throw exceptions instead of returning FALSE on error",
|
||||
"support": {
|
||||
"issues": "https://github.com/thecodingmachine/safe/issues",
|
||||
"source": "https://github.com/thecodingmachine/safe/tree/v3.0.2"
|
||||
"source": "https://github.com/thecodingmachine/safe/tree/v3.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -7428,7 +7504,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-19T19:23:00+00:00"
|
||||
"time": "2025-04-12T06:41:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
@@ -7545,7 +7621,7 @@
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": "~8.4.0",
|
||||
"php": ">= 8.3",
|
||||
"ext-mbstring": "*",
|
||||
"ext-zlib": "*"
|
||||
},
|
||||
|
||||
@@ -42,6 +42,9 @@ SPC_CONCURRENCY=${CPU_COUNT}
|
||||
SPC_SKIP_PHP_VERSION_CHECK="no"
|
||||
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
|
||||
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
||||
; extra modules that xcaddy will include in the FrankenPHP build
|
||||
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
|
||||
|
||||
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
||||
; only useful for builds targeting not pure-static linking
|
||||
; default paths
|
||||
@@ -66,10 +69,10 @@ SPC_LIBC=musl
|
||||
CC=${SPC_LINUX_DEFAULT_CC}
|
||||
CXX=${SPC_LINUX_DEFAULT_CXX}
|
||||
AR=${SPC_LINUX_DEFAULT_AR}
|
||||
LD=ld.gold
|
||||
LD=${SPC_LINUX_DEFAULT_LD}
|
||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
||||
SPC_DEFAULT_C_FLAGS="-fPIC"
|
||||
SPC_DEFAULT_CXX_FLAGS=
|
||||
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
|
||||
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
|
||||
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
||||
SPC_EXTRA_LIBS=
|
||||
; upx executable path
|
||||
@@ -81,7 +84,7 @@ SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime
|
||||
; buildconf command
|
||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||
; configure command
|
||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg --with-pic"
|
||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-cgi --disable-phpdbg --with-pic"
|
||||
; make command
|
||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${CPU_COUNT}"
|
||||
; embed type for php, static (libphp.a) or shared (libphp.so)
|
||||
@@ -97,9 +100,11 @@ SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
||||
; LIBS for configuring php
|
||||
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
|
||||
; EXTRA_CFLAGS for `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-ident -fPIE -fPIC"
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
|
||||
; EXTRA_LIBS for `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm"
|
||||
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
||||
; EXTRA_LDFLAGS_PROGRAM for `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"
|
||||
|
||||
@@ -108,8 +113,8 @@ SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
||||
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin"
|
||||
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin"
|
||||
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
||||
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
||||
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
||||
SPC_EXTRA_LIBS=
|
||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||
@@ -131,7 +136,7 @@ SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
|
||||
; LDFLAGS for configuring php
|
||||
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
||||
; EXTRA_CFLAGS for `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Os -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
|
||||
; EXTRA_LIBS for `make` php
|
||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
|
||||
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
||||
|
||||
116
config/ext.json
116
config/ext.json
@@ -24,6 +24,14 @@
|
||||
"bcmath": {
|
||||
"type": "builtin"
|
||||
},
|
||||
"brotli": {
|
||||
"type": "external",
|
||||
"source": "ext-brotli",
|
||||
"arg-type": "enable",
|
||||
"lib-depends": [
|
||||
"brotli"
|
||||
]
|
||||
},
|
||||
"bz2": {
|
||||
"type": "builtin",
|
||||
"arg-type-unix": "with-prefix",
|
||||
@@ -95,7 +103,10 @@
|
||||
"ev": {
|
||||
"type": "external",
|
||||
"source": "ev",
|
||||
"arg-type-windows": "with"
|
||||
"arg-type-windows": "with",
|
||||
"ext-depends": [
|
||||
"sockets"
|
||||
]
|
||||
},
|
||||
"event": {
|
||||
"support": {
|
||||
@@ -124,10 +135,6 @@
|
||||
"Linux": "partial",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"target": [
|
||||
"static",
|
||||
"shared"
|
||||
],
|
||||
"notes": true,
|
||||
"arg-type": "custom",
|
||||
"type": "builtin",
|
||||
@@ -297,12 +304,14 @@
|
||||
},
|
||||
"intl": {
|
||||
"support": {
|
||||
"Windows": "no",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "builtin",
|
||||
"lib-depends": [
|
||||
"lib-depends-unix": [
|
||||
"icu"
|
||||
],
|
||||
"lib-depends-windows": [
|
||||
"icu-static-win"
|
||||
]
|
||||
},
|
||||
"ldap": {
|
||||
@@ -331,11 +340,29 @@
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"xml"
|
||||
],
|
||||
"target": [
|
||||
"static"
|
||||
]
|
||||
},
|
||||
"lz4": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "ext-lz4",
|
||||
"arg-type": "custom",
|
||||
"lib-depends": [
|
||||
"liblz4"
|
||||
]
|
||||
},
|
||||
"mbregex": {
|
||||
"type": "builtin",
|
||||
"arg-type": "custom",
|
||||
"target": [
|
||||
"static"
|
||||
],
|
||||
"ext-depends": [
|
||||
"mbstring"
|
||||
],
|
||||
@@ -368,13 +395,13 @@
|
||||
"ext-depends": [
|
||||
"zlib",
|
||||
"session"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"memcached": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip",
|
||||
"Linux": "no"
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
"source": "memcached",
|
||||
@@ -383,6 +410,10 @@
|
||||
"lib-depends": [
|
||||
"libmemcached"
|
||||
],
|
||||
"lib-depends-unix": [
|
||||
"libmemcached",
|
||||
"fastlz"
|
||||
],
|
||||
"ext-depends": [
|
||||
"session",
|
||||
"zlib"
|
||||
@@ -401,6 +432,10 @@
|
||||
"openssl",
|
||||
"zstd",
|
||||
"zlib"
|
||||
],
|
||||
"frameworks": [
|
||||
"CoreFoundation",
|
||||
"Security"
|
||||
]
|
||||
},
|
||||
"msgpack": {
|
||||
@@ -410,7 +445,10 @@
|
||||
"type": "external",
|
||||
"source": "msgpack",
|
||||
"arg-type-unix": "with",
|
||||
"arg-type-win": "enable"
|
||||
"arg-type-win": "enable",
|
||||
"ext-depends": [
|
||||
"session"
|
||||
]
|
||||
},
|
||||
"mysqli": {
|
||||
"type": "builtin",
|
||||
@@ -449,7 +487,8 @@
|
||||
},
|
||||
"opcache": {
|
||||
"type": "builtin",
|
||||
"arg-type-unix": "custom"
|
||||
"arg-type-unix": "custom",
|
||||
"zend-extension": true
|
||||
},
|
||||
"openssl": {
|
||||
"notes": true,
|
||||
@@ -638,6 +677,9 @@
|
||||
"arg-type": "with-prefix",
|
||||
"lib-depends": [
|
||||
"readline"
|
||||
],
|
||||
"target": [
|
||||
"static"
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
@@ -657,10 +699,12 @@
|
||||
]
|
||||
},
|
||||
"session": {
|
||||
"type": "builtin"
|
||||
"type": "builtin",
|
||||
"build-with-php": true
|
||||
},
|
||||
"shmop": {
|
||||
"type": "builtin"
|
||||
"type": "builtin",
|
||||
"build-with-php": true
|
||||
},
|
||||
"simdjson": {
|
||||
"type": "external",
|
||||
@@ -678,7 +722,8 @@
|
||||
],
|
||||
"ext-depends-windows": [
|
||||
"xml"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"snappy": {
|
||||
"support": {
|
||||
@@ -771,7 +816,7 @@
|
||||
"lib-depends": [
|
||||
"libssh2"
|
||||
],
|
||||
"ext-depends-windows": [
|
||||
"ext-depends": [
|
||||
"openssl",
|
||||
"zlib"
|
||||
]
|
||||
@@ -781,9 +826,6 @@
|
||||
"Windows": "no",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"target": [
|
||||
"static"
|
||||
],
|
||||
"notes": true,
|
||||
"type": "external",
|
||||
"source": "swoole",
|
||||
@@ -901,7 +943,8 @@
|
||||
]
|
||||
},
|
||||
"tokenizer": {
|
||||
"type": "builtin"
|
||||
"type": "builtin",
|
||||
"build-with-php": true
|
||||
},
|
||||
"uuid": {
|
||||
"support": {
|
||||
@@ -942,7 +985,8 @@
|
||||
"Darwin": "partial",
|
||||
"Linux": "partial"
|
||||
},
|
||||
"notes": true
|
||||
"notes": true,
|
||||
"zend-extension": true
|
||||
},
|
||||
"xhprof": {
|
||||
"support": {
|
||||
@@ -954,11 +998,11 @@
|
||||
"source": "xhprof",
|
||||
"ext-depends": [
|
||||
"ctype"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"xlswriter": {
|
||||
"support": {
|
||||
"Windows": "wip",
|
||||
"BSD": "wip"
|
||||
},
|
||||
"type": "external",
|
||||
@@ -985,7 +1029,8 @@
|
||||
],
|
||||
"ext-depends-windows": [
|
||||
"iconv"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"xmlreader": {
|
||||
"support": {
|
||||
@@ -999,7 +1044,8 @@
|
||||
"ext-depends-windows": [
|
||||
"xml",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"xmlwriter": {
|
||||
"support": {
|
||||
@@ -1012,7 +1058,8 @@
|
||||
],
|
||||
"ext-depends-windows": [
|
||||
"xml"
|
||||
]
|
||||
],
|
||||
"build-with-php": true
|
||||
},
|
||||
"xsl": {
|
||||
"support": {
|
||||
@@ -1029,6 +1076,14 @@
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"xz": {
|
||||
"type": "external",
|
||||
"source": "ext-xz",
|
||||
"arg-type": "with",
|
||||
"lib-depends": [
|
||||
"xz"
|
||||
]
|
||||
},
|
||||
"yac": {
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
@@ -1036,6 +1091,9 @@
|
||||
"type": "external",
|
||||
"source": "yac",
|
||||
"arg-type-unix": "custom",
|
||||
"lib-depends-unix": [
|
||||
"fastlz"
|
||||
],
|
||||
"ext-depends-unix": [
|
||||
"igbinary"
|
||||
]
|
||||
@@ -1056,9 +1114,6 @@
|
||||
"support": {
|
||||
"BSD": "wip"
|
||||
},
|
||||
"target": [
|
||||
"static"
|
||||
],
|
||||
"type": "builtin",
|
||||
"arg-type": "with-prefix",
|
||||
"arg-type-windows": "enable",
|
||||
@@ -1082,6 +1137,9 @@
|
||||
"arg-type-windows": "enable",
|
||||
"lib-depends": [
|
||||
"zlib"
|
||||
],
|
||||
"target": [
|
||||
"static"
|
||||
]
|
||||
},
|
||||
"zstd": {
|
||||
|
||||
@@ -86,6 +86,8 @@
|
||||
"libssh2",
|
||||
"brotli",
|
||||
"nghttp2",
|
||||
"nghttp3",
|
||||
"ngtcp2",
|
||||
"zstd",
|
||||
"libcares"
|
||||
],
|
||||
@@ -99,6 +101,15 @@
|
||||
"SystemConfiguration"
|
||||
]
|
||||
},
|
||||
"fastlz": {
|
||||
"source": "fastlz",
|
||||
"static-libs-unix": [
|
||||
"libfastlz.a"
|
||||
],
|
||||
"headers": [
|
||||
"fastlz/fastlz.h"
|
||||
]
|
||||
},
|
||||
"freetype": {
|
||||
"source": "freetype",
|
||||
"static-libs-unix": [
|
||||
@@ -196,6 +207,18 @@
|
||||
"libicudata.a"
|
||||
]
|
||||
},
|
||||
"icu-static-win": {
|
||||
"source": "icu-static-win",
|
||||
"static-libs-windows": [
|
||||
"icudt.lib",
|
||||
"icuin.lib",
|
||||
"icuio.lib",
|
||||
"icuuc.lib"
|
||||
],
|
||||
"headers-windows": [
|
||||
"unicode"
|
||||
]
|
||||
},
|
||||
"imagemagick": {
|
||||
"source": "imagemagick",
|
||||
"static-libs-unix": [
|
||||
@@ -232,8 +255,8 @@
|
||||
"ldap": {
|
||||
"source": "ldap",
|
||||
"static-libs-unix": [
|
||||
"liblber.a",
|
||||
"libldap.a"
|
||||
"libldap.a",
|
||||
"liblber.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl",
|
||||
@@ -387,7 +410,9 @@
|
||||
"source": "libmemcached",
|
||||
"static-libs-unix": [
|
||||
"libmemcached.a",
|
||||
"libmemcachedutil.a"
|
||||
"libmemcachedprotocol.a",
|
||||
"libmemcachedutil.a",
|
||||
"libhashkit.a"
|
||||
]
|
||||
},
|
||||
"libpng": {
|
||||
@@ -615,7 +640,45 @@
|
||||
"openssl"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"libxml2"
|
||||
"libxml2",
|
||||
"nghttp3",
|
||||
"ngtcp2"
|
||||
]
|
||||
},
|
||||
"nghttp3": {
|
||||
"source": "nghttp3",
|
||||
"static-libs-unix": [
|
||||
"libnghttp3.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"nghttp3.lib"
|
||||
],
|
||||
"headers": [
|
||||
"nghttp3"
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"ngtcp2": {
|
||||
"source": "ngtcp2",
|
||||
"static-libs-unix": [
|
||||
"libngtcp2.a",
|
||||
"libngtcp2_crypto_ossl.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"ngtcp2.lib",
|
||||
"ngtcp2_crypto_ossl.lib"
|
||||
],
|
||||
"headers": [
|
||||
"ngtcp2"
|
||||
],
|
||||
"lib-depends": [
|
||||
"openssl"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"nghttp3",
|
||||
"brotli"
|
||||
]
|
||||
},
|
||||
"onig": {
|
||||
@@ -803,5 +866,14 @@
|
||||
"zstd.h",
|
||||
"zstd_errors.h"
|
||||
]
|
||||
},
|
||||
"watcher": {
|
||||
"source": "watcher",
|
||||
"static-libs-unix": [
|
||||
"libwatcher-c.a"
|
||||
],
|
||||
"headers": [
|
||||
"wtr/watcher-c.h"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,5 +42,17 @@
|
||||
"extract-files": {
|
||||
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
|
||||
}
|
||||
},
|
||||
"go-xcaddy-x86_64-linux": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-xcaddy-aarch64-linux": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-xcaddy-x86_64-macos": {
|
||||
"type": "custom"
|
||||
},
|
||||
"go-xcaddy-aarch64-macos": {
|
||||
"type": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"repo": "static-php/static-php-cli-hosted",
|
||||
"prefer-stable": true,
|
||||
"match-pattern-linux": "{name}-{arch}-{os}-{libc}-{libcver}.txz",
|
||||
"match-pattern": "{name}-{arch}-{os}.txz"
|
||||
"match-pattern-macos": "{name}-{arch}-{os}.txz",
|
||||
"match-pattern-windows": "{name}-{arch}-{os}.tgz"
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@
|
||||
}
|
||||
},
|
||||
"brotli": {
|
||||
"type": "ghtar",
|
||||
"type": "ghtagtar",
|
||||
"repo": "google/brotli",
|
||||
"match": "v1\\.\\d.*",
|
||||
"provide-pre-built": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
@@ -102,6 +103,16 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-brotli": {
|
||||
"type": "git",
|
||||
"path": "php-src/ext/brotli",
|
||||
"rev": "master",
|
||||
"url": "https://github.com/kjdev/php-ext-brotli",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-ds": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/ds",
|
||||
@@ -161,6 +172,17 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"ext-lz4": {
|
||||
"type": "ghtagtar",
|
||||
"repo": "kjdev/php-ext-lz4",
|
||||
"path": "php-src/ext/lz4",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": [
|
||||
"LICENSE"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ext-memcache": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/memcache",
|
||||
@@ -230,6 +252,16 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-xz": {
|
||||
"type": "git",
|
||||
"path": "php-src/ext/xz",
|
||||
"rev": "main",
|
||||
"url": "https://github.com/codemasher/php-ext-xz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"ext-zstd": {
|
||||
"type": "git",
|
||||
"path": "php-src/ext/zstd",
|
||||
@@ -240,6 +272,15 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"fastlz": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ariya/FastLZ.git",
|
||||
"rev": "master",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE.MIT"
|
||||
}
|
||||
},
|
||||
"freetype": {
|
||||
"type": "git",
|
||||
"rev": "VER-2-13-2",
|
||||
@@ -301,6 +342,14 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"icu-static-win": {
|
||||
"type": "url",
|
||||
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",
|
||||
"license": {
|
||||
"type": "text",
|
||||
"text": "none"
|
||||
}
|
||||
},
|
||||
"igbinary": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/igbinary",
|
||||
@@ -496,12 +545,12 @@
|
||||
}
|
||||
},
|
||||
"libmemcached": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/static-php/libmemcached-macos.git",
|
||||
"rev": "master",
|
||||
"type": "ghtagtar",
|
||||
"repo": "awesomized/libmemcached",
|
||||
"match": "1.\\d.\\d",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"libpng": {
|
||||
@@ -703,6 +752,26 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"nghttp3": {
|
||||
"type": "ghrel",
|
||||
"repo": "ngtcp2/nghttp3",
|
||||
"match": "nghttp3.+\\.tar\\.xz",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"ngtcp2": {
|
||||
"type": "ghrel",
|
||||
"repo": "ngtcp2/ngtcp2",
|
||||
"match": "ngtcp2.+\\.tar\\.xz",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"onig": {
|
||||
"type": "ghrel",
|
||||
"repo": "kkos/oniguruma",
|
||||
@@ -770,8 +839,9 @@
|
||||
}
|
||||
},
|
||||
"postgresql": {
|
||||
"type": "url",
|
||||
"url": "https://ftp.postgresql.org/pub/source/v16.2/postgresql-16.2.tar.bz2",
|
||||
"type": "ghtagtar",
|
||||
"repo": "postgres/postgres",
|
||||
"match": "REL_16_\\d+",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "COPYRIGHT"
|
||||
@@ -905,7 +975,6 @@
|
||||
"path": "php-src/ext/swow-src",
|
||||
"rev": "ci",
|
||||
"url": "https://github.com/swow/swow",
|
||||
"patch": "patchSwow",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
@@ -1009,5 +1078,14 @@
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"watcher": {
|
||||
"type": "ghtar",
|
||||
"repo": "e-dant/watcher",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "license"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-btn" v-if="selectedSystem !== 'windows'" @click="selectCommon">{{ I18N[lang].selectCommon }}</div>
|
||||
<div class="my-btn" v-if="selectedSystem !== 'windows'" @click="selectAll">{{ I18N[lang].selectAll }}</div>
|
||||
<div class="my-btn" @click="checkedExts = []">{{ I18N[lang].selectNone }}</div>
|
||||
|
||||
<details class="details custom-block" open>
|
||||
@@ -44,6 +45,7 @@
|
||||
<div class="tip custom-block">
|
||||
<p class="custom-block-title">TIP</p>
|
||||
<p>{{ I18N[lang].depTips }}</p>
|
||||
<p>{{ I18N[lang].depTips2 }}</p>
|
||||
</div>
|
||||
<h2>{{ I18N[lang].buildTarget }}</h2>
|
||||
<div class="box">
|
||||
@@ -175,6 +177,12 @@
|
||||
{{ buildCommandString }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="command-container">
|
||||
<b>craft.yml</b>
|
||||
<div id="craft-cmd" class="command-preview pre">
|
||||
{{ craftCommandString }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -246,6 +254,7 @@ const I18N = {
|
||||
no: '否',
|
||||
resultShow: '结果展示',
|
||||
selectCommon: '选择常用扩展',
|
||||
selectAll: '选择全部',
|
||||
selectNone: '全部取消选择',
|
||||
useZTS: '是否编译线程安全版',
|
||||
hardcodedINI: '硬编码 INI 选项',
|
||||
@@ -261,6 +270,7 @@ const I18N = {
|
||||
selectedSystem: '选择操作系统',
|
||||
buildLibs: '要构建的库',
|
||||
depTips: '选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。',
|
||||
depTips2: '无法同时构建所有扩展,因为有些扩展之间相互冲突。请根据需要选择扩展。',
|
||||
microUnavailable: 'micro 不支持 PHP 7.4 及更早版本!',
|
||||
windowsSAPIUnavailable: 'Windows 目前不支持 fpm、embed 构建!',
|
||||
useUPX: '是否开启 UPX 压缩(减小二进制体积)',
|
||||
@@ -280,6 +290,7 @@ const I18N = {
|
||||
no: 'No',
|
||||
resultShow: 'Result',
|
||||
selectCommon: 'Select common extensions',
|
||||
selectAll: 'Select all',
|
||||
selectNone: 'Unselect all',
|
||||
useZTS: 'Enable ZTS',
|
||||
hardcodedINI: 'Hardcoded INI options',
|
||||
@@ -295,6 +306,7 @@ const I18N = {
|
||||
selectedSystem: 'Select Build OS',
|
||||
buildLibs: 'Select Dependencies',
|
||||
depTips: 'After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.',
|
||||
depTips2: 'It is not possible to build all extensions at the same time, as some extensions conflict with each other. Please select the extensions you need.',
|
||||
microUnavailable: 'Micro does not support PHP 7.4 and earlier versions!',
|
||||
windowsSAPIUnavailable: 'Windows does not support fpm and embed build!',
|
||||
useUPX: 'Enable UPX compression (reduce binary size)',
|
||||
@@ -331,6 +343,10 @@ const selectCommon = () => {
|
||||
];
|
||||
};
|
||||
|
||||
const selectAll = () => {
|
||||
checkedExts.value = extFilter.value;
|
||||
};
|
||||
|
||||
const extList = computed(() => {
|
||||
return checkedExts.value.join(',');
|
||||
});
|
||||
@@ -358,7 +374,7 @@ const checkedTargets = ref(['cli']);
|
||||
const selectedEnv = ref('spc');
|
||||
|
||||
// chosen php version
|
||||
const selectedPhpVersion = ref('8.2');
|
||||
const selectedPhpVersion = ref('8.4');
|
||||
|
||||
// chosen debug
|
||||
const debug = ref(0);
|
||||
@@ -499,6 +515,38 @@ const buildCommandString = computed(() => {
|
||||
return `${spcCommand.value} build ${buildCommand.value} "${extList.value}"${additionalLibs.value}${debug.value ? ' --debug' : ''}${zts.value ? ' --enable-zts' : ''}${enableUPX.value ? ' --with-upx-pack' : ''}${displayINI.value}`;
|
||||
});
|
||||
|
||||
const craftCommandString = computed(() => {
|
||||
let str = `php-version: ${selectedPhpVersion.value}\n`;
|
||||
str += `extensions: "${extList.value}"\n`;
|
||||
if (checkedTargets.value.join(',') === 'all') {
|
||||
str += 'sapi: ' + ['cli', 'fpm', 'micro', 'embed'].join(',') + '\n';
|
||||
} else {
|
||||
str += `sapi: ${checkedTargets.value.join(',')}\n`;
|
||||
}
|
||||
if (additionalLibs.value) {
|
||||
str += `libs: ${additionalLibs.value.replace('--with-libs="', '').replace('"', '').trim()}\n`;
|
||||
}
|
||||
if (debug.value) {
|
||||
str += 'debug: true\n';
|
||||
}
|
||||
str += '{{position_hold}}';
|
||||
if (enableUPX.value) {
|
||||
str += ' with-upx-pack: true\n';
|
||||
}
|
||||
if (zts.value) {
|
||||
str += ' enable-zts: true\n';
|
||||
}
|
||||
if (preBuilt.value) {
|
||||
str += ' prefer-pre-built: true\n';
|
||||
}
|
||||
if (!str.endsWith('{{position_hold}}')) {
|
||||
str = str.replace('{{position_hold}}', 'build-options:\n');
|
||||
} else {
|
||||
str = str.replace('{{position_hold}}', '');
|
||||
}
|
||||
return str;
|
||||
});
|
||||
|
||||
const calculateExtLibDepends = (input) => {
|
||||
const result = new Set();
|
||||
|
||||
@@ -617,6 +665,12 @@ h2 {
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.option-line {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
@@ -1,56 +1,57 @@
|
||||
export default {
|
||||
'/en/guide/': [
|
||||
{
|
||||
text: 'Basic Build Guides',
|
||||
items: [
|
||||
{text: 'Guide', link: '/en/guide/'},
|
||||
{text: 'Build (Local)', link: '/en/guide/manual-build'},
|
||||
{text: 'Build (CI)', link: '/en/guide/action-build'},
|
||||
{text: 'Supported Extensions', link: '/en/guide/extensions'},
|
||||
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
|
||||
{text: 'Build Command Generator', link: '/en/guide/cli-generator'},
|
||||
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
|
||||
{text: 'Dependency Table', link: '/en/guide/deps-map'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Extended Build Guides',
|
||||
items: [
|
||||
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
|
||||
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
|
||||
{text: 'Build with GNU libc', link: '/en/guide/build-with-glibc'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/en/develop/': [
|
||||
{
|
||||
text: 'Development',
|
||||
items: [
|
||||
{text: 'Get Started', link: '/en/develop/'},
|
||||
{text: 'Project Structure', link: '/en/develop/structure'},
|
||||
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Module',
|
||||
items: [
|
||||
{text: 'Doctor ', link: '/en/develop/doctor-module'},
|
||||
{text: 'Source', link: '/en/develop/source-module'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Extra',
|
||||
items: [
|
||||
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/en/contributing/': [
|
||||
{
|
||||
text: 'Contributing',
|
||||
items: [
|
||||
{text: 'Contributing', link: '/en/contributing/'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/en/guide/': [
|
||||
{
|
||||
text: 'Basic Build Guides',
|
||||
items: [
|
||||
{text: 'Guide', link: '/en/guide/'},
|
||||
{text: 'Build (Local)', link: '/en/guide/manual-build'},
|
||||
{text: 'Build (CI)', link: '/en/guide/action-build'},
|
||||
{text: 'Supported Extensions', link: '/en/guide/extensions'},
|
||||
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
|
||||
{text: 'Build Command Generator', link: '/en/guide/cli-generator'},
|
||||
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
|
||||
{text: 'Dependency Table', link: '/en/guide/deps-map'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Extended Build Guides',
|
||||
items: [
|
||||
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
|
||||
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
|
||||
{text: 'Build with GNU libc', link: '/en/guide/build-with-glibc'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/en/develop/': [
|
||||
{
|
||||
text: 'Development',
|
||||
items: [
|
||||
{text: 'Get Started', link: '/en/develop/'},
|
||||
{text: 'Project Structure', link: '/en/develop/structure'},
|
||||
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Module',
|
||||
items: [
|
||||
{text: 'Doctor ', link: '/en/develop/doctor-module'},
|
||||
{text: 'Source', link: '/en/develop/source-module'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Extra',
|
||||
items: [
|
||||
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
|
||||
{text: 'craft.yml Configuration', link: '/zh/develop/craft-yml'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/en/contributing/': [
|
||||
{
|
||||
text: 'Contributing',
|
||||
items: [
|
||||
{text: 'Contributing', link: '/en/contributing/'},
|
||||
],
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,56 +1,57 @@
|
||||
export default {
|
||||
'/zh/guide/': [
|
||||
{
|
||||
text: '构建指南',
|
||||
items: [
|
||||
{text: '指南', link: '/zh/guide/'},
|
||||
{text: '本地构建', link: '/zh/guide/manual-build'},
|
||||
{text: 'Actions 构建', link: '/zh/guide/action-build'},
|
||||
{text: '扩展列表', link: '/zh/guide/extensions'},
|
||||
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
|
||||
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
|
||||
{text: '环境变量列表', link: '/zh/guide/env-vars'},
|
||||
{text: '依赖关系图表', link: '/zh/guide/deps-map'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '扩展构建指南',
|
||||
items: [
|
||||
{text: '故障排除', link: '/zh/guide/troubleshooting'},
|
||||
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
|
||||
{text: '构建 GNU libc 兼容的二进制', link: '/zh/guide/build-with-glibc'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/zh/develop/': [
|
||||
{
|
||||
text: '开发指南',
|
||||
items: [
|
||||
{ text: '开发简介', link: '/zh/develop/' },
|
||||
{ text: '项目结构简介', link: '/zh/develop/structure' },
|
||||
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '模块',
|
||||
items: [
|
||||
{ text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module' },
|
||||
{ text: '资源模块', link: '/zh/develop/source-module' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '其他',
|
||||
items: [
|
||||
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/zh/contributing/': [
|
||||
{
|
||||
text: '贡献指南',
|
||||
items: [
|
||||
{text: '贡献指南', link: '/zh/contributing/'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/zh/guide/': [
|
||||
{
|
||||
text: '构建指南',
|
||||
items: [
|
||||
{text: '指南', link: '/zh/guide/'},
|
||||
{text: '本地构建', link: '/zh/guide/manual-build'},
|
||||
{text: 'Actions 构建', link: '/zh/guide/action-build'},
|
||||
{text: '扩展列表', link: '/zh/guide/extensions'},
|
||||
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
|
||||
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
|
||||
{text: '环境变量列表', link: '/zh/guide/env-vars'},
|
||||
{text: '依赖关系图表', link: '/zh/guide/deps-map'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '扩展构建指南',
|
||||
items: [
|
||||
{text: '故障排除', link: '/zh/guide/troubleshooting'},
|
||||
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
|
||||
{text: '构建 GNU libc 兼容的二进制', link: '/zh/guide/build-with-glibc'},
|
||||
],
|
||||
}
|
||||
],
|
||||
'/zh/develop/': [
|
||||
{
|
||||
text: '开发指南',
|
||||
items: [
|
||||
{text: '开发简介', link: '/zh/develop/'},
|
||||
{text: '项目结构简介', link: '/zh/develop/structure'},
|
||||
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '模块',
|
||||
items: [
|
||||
{text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module'},
|
||||
{text: '资源模块', link: '/zh/develop/source-module'},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '其他',
|
||||
items: [
|
||||
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
|
||||
{text: 'craft.yml 配置详解', link: '/zh/develop/craft-yml'},
|
||||
]
|
||||
}
|
||||
],
|
||||
'/zh/contributing/': [
|
||||
{
|
||||
text: '贡献指南',
|
||||
items: [
|
||||
{text: '贡献指南', link: '/zh/contributing/'},
|
||||
],
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
70
docs/deps-craft-yml.md
Normal file
70
docs/deps-craft-yml.md
Normal file
@@ -0,0 +1,70 @@
|
||||
```yaml
|
||||
# PHP version to build (default: 8.4)
|
||||
php-version: 8.4
|
||||
# [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
|
||||
extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
|
||||
# Extra libraries to build (list or comma-separated are both accepted)
|
||||
libs: [ ]
|
||||
# [REQUIRED] Build SAPIs (list or comma-separated are both accepted)
|
||||
sapi: cli,micro,fpm
|
||||
# Show full console output (default: false)
|
||||
debug: false
|
||||
# Build options (same as `build` command options, all options are optional)
|
||||
build-options:
|
||||
# Before build, remove all old build files and sources (default: false)
|
||||
with-clean: false
|
||||
# Build with all suggested libraries (default: false)
|
||||
with-suggested-libs: false
|
||||
# Build with all suggested extensions (default: false)
|
||||
with-suggested-exts: false
|
||||
# Build extra shared extensions (list or comma-separated are both accepted)
|
||||
build-shared: [ ]
|
||||
# Build without stripping the binary (default: false)
|
||||
no-strip: false
|
||||
# Disable Opcache JIT (default: false)
|
||||
disable-opcache-jit: false
|
||||
# PHP configuration options (same as --with-config-file-path)
|
||||
with-config-file-path: ""
|
||||
# PHP configuration options (same as --with-config-file-scan-dir)
|
||||
with-config-file-scan-dir: ""
|
||||
# Hardcoded INI options for cli and micro SAPI (e.g. "memory_limit=4G", list accepted)
|
||||
with-hardcoded-ini: [ ]
|
||||
# Pretend micro SAPI as cli SAPI to avoid some frameworks to limit the usage of micro SAPI
|
||||
with-micro-fake-cli: false
|
||||
# Additional patch point injection files (e.g. "path/to/patch.php", list accepted)
|
||||
with-added-patch: [ ]
|
||||
# Ignore micro extension tests (if you are using micro SAPI, default: false)
|
||||
without-micro-ext-test: false
|
||||
# UPX pack the binary (default: false)
|
||||
with-upx-pack: false
|
||||
# Set the micro.exe program icon (only for Windows, default: "")
|
||||
with-micro-logo: ""
|
||||
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
|
||||
enable-micro-win32: false
|
||||
|
||||
# Build options for shared extensions (list or comma-separated are both accepted)
|
||||
shared-extensions: [ ]
|
||||
|
||||
# Download options
|
||||
download-options:
|
||||
# Use custom url for specified sources, format: "{source-name}:{url}" (e.g. "php-src:https://example.com/php-8.4.0.tar.gz")
|
||||
custom-url: [ ]
|
||||
# Use custom git repo for specified sources, format: "{source-name}:{branch}:{url}" (e.g. "php-src:master:https://github.com/php/php-src.git")
|
||||
custom-git: [ ]
|
||||
# Retries count for downloading sources (default: 5)
|
||||
retry: 5
|
||||
# Use pre-built libraries if available (default: false)
|
||||
prefer-pre-built: true
|
||||
# Do not download from alternative sources (default: false)
|
||||
no-alt: false
|
||||
|
||||
craft-options:
|
||||
doctor: true
|
||||
download: true
|
||||
build: true
|
||||
|
||||
# Extra environment variables
|
||||
extra-env:
|
||||
# e.g. Use github token to avoid rate limit
|
||||
GITHUB_TOKEN: your-github-token
|
||||
```
|
||||
7
docs/en/develop/craft-yml.md
Normal file
7
docs/en/develop/craft-yml.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
aside: false
|
||||
---
|
||||
|
||||
# craft.yml Configuration
|
||||
|
||||
<!--@include: ../../deps-craft-yml.md-->
|
||||
@@ -38,17 +38,11 @@ buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" -
|
||||
```
|
||||
|
||||
For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: `/usr/lib/libresolv.9.dylib` and `/usr/lib/libSystem.B.dylib`.
|
||||
So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:
|
||||
So on macOS, you can **directly** use SPC to build statically compiled PHP binaries with dynamically linked extensions:
|
||||
|
||||
1. Using the `--no-strip` parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as `Xdebug`.
|
||||
2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
|
||||
3. Use the `phpize && ./configure && make` command to compile the extensions you want to use.
|
||||
4. Copy the extension file `xxxx.so` to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: `cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`.
|
||||
|
||||
```bash
|
||||
# build statically linked php-cli but not stripped
|
||||
bin/spc build ffi --build-cli --no-strip
|
||||
```
|
||||
1. Build shared extension `xxx.so` using: `--build-shared=XXX` option. e.g. `bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
|
||||
2. You will get `buildroot/modules/xdebug.so` and `buildroot/bin/php`.
|
||||
3. The `xdebug.so` file could be used for php that version and thread-safe are the same.
|
||||
|
||||
## Can it support Oracle database extension?
|
||||
|
||||
|
||||
@@ -61,6 +61,4 @@ If you have related issues or requirements, please indicate that you are buildin
|
||||
If you need to build glibc-based binaries without using Docker,
|
||||
please refer to the `bin/spc-gnu-docker` script to manually create a similar environment.
|
||||
|
||||
Since glibc binaries are not the main goal of the project,
|
||||
we generally do not test the compatibility of various libraries and extensions under glibc.
|
||||
If any specific library builds successfully on musl-libc but fails on glibc, please submit an issue.
|
||||
Please keep in mind that we only support glibc build with `bin/spc-gnu-docker`. Compilation on RHEL 9 & 10 has been tested and is stable, but if you run into issues, we may choose not to fix them.
|
||||
|
||||
@@ -6,6 +6,8 @@ which will be listed one by one here.
|
||||
|
||||
## curl
|
||||
|
||||
HTTP3 support is not enabled by default, compile with `--with-libs="nghttp2,nghttp3,ngtcp2"` to enable HTTP3 support for PHP >= 8.4.
|
||||
|
||||
When using curl to request HTTPS, there may be an `error:80000002:system library::No such file or directory` error.
|
||||
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
|
||||
|
||||
@@ -149,11 +151,10 @@ Parallel is only supported on PHP 8.0 ZTS and above.
|
||||
|
||||
## spx
|
||||
|
||||
1. The [SPX extension](https://github.com/NoiseByNorthwest/php-spx) only supports NTS mode.
|
||||
2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
|
||||
1. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
|
||||
|
||||
## mimalloc
|
||||
|
||||
1. This is not technically an extension, but a library.
|
||||
2. Building with `--with-libs="mimalloc"` on Linux or macOS will override the default allocator.
|
||||
3. This is experimental for now, but is recommended in threaded environments.
|
||||
3. This is experimental for now, but is recommended in threaded environments.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
outline: 'deep'
|
||||
---
|
||||
|
||||
# Build (Linux, macOS, FreeBSD)
|
||||
|
||||
This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
|
||||
@@ -133,7 +137,48 @@ and then install the latest version of PHP and tokenizer, XML, and phar extensio
|
||||
Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.
|
||||
:::
|
||||
|
||||
## Command - download
|
||||
## Build with craft (recommended)
|
||||
|
||||
Using `bin/spc craft`, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.
|
||||
|
||||
You need to write a `craft.yml` file and save it in the current working directory. `craft.yml` can be generated by [command generator](./cli-generator) or written manually.
|
||||
|
||||
For manual writing, please refer to the comments in [craft.yml configuration](../develop/craft-yml.md) to write it.
|
||||
Let's assume that you compile an extension combination and choose PHP 8.4, outputting `cli` and `fpm`:
|
||||
|
||||
```yaml
|
||||
# path/to/craft.yml
|
||||
php-version: 8.4
|
||||
extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
|
||||
sapi:
|
||||
- cli
|
||||
- fpm
|
||||
```
|
||||
|
||||
Then use the `bin/spc craft` command to compile:
|
||||
|
||||
```bash
|
||||
bin/spc craft --debug
|
||||
```
|
||||
|
||||
If the build is successful, you will see the `buildroot/bin` directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.
|
||||
|
||||
- cli: The build result is `buildroot/bin/php.exe` on Windows and `buildroot/bin/php` on other platforms.
|
||||
- fpm: The build result is `buildroot/bin/php-fpm`.
|
||||
- micro: The build result is `buildroot/bin/micro.sfx`. If you need to further package it with PHP code, please refer to [Packaging micro binary](./manual-build#command-micro-combine).
|
||||
- embed: See [Using embed](./manual-build#embed-usage).
|
||||
- frankenphp: The build result is `buildroot/bin/frankenphp`.
|
||||
|
||||
If the build fails, you can use the `--debug` parameter to view detailed error information,
|
||||
or use the `--with-clean` to clear the old compilation results and recompile.
|
||||
|
||||
If the build still fails to use the above method, please submit an issue and attach your `craft.yml` and `craft.log`.
|
||||
|
||||
## Step-by-step build command
|
||||
|
||||
If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the `bin/spc` command to execute step by step.
|
||||
|
||||
### Command download - Download dependency packages
|
||||
|
||||
Use the command `bin/spc download` to download the source code required for compilation,
|
||||
including php-src and the source code of various dependent libraries.
|
||||
@@ -217,7 +262,7 @@ bin/spc download --for-extensions=redis -G "php-src:master:https://github.com/ph
|
||||
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
||||
```
|
||||
|
||||
## Command - doctor
|
||||
### Command - doctor
|
||||
|
||||
If you can run `bin/spc` normally but cannot compile static PHP or dependent libraries normally,
|
||||
you can run `bin/spc doctor` first to check whether the system itself lacks dependencies.
|
||||
@@ -230,13 +275,13 @@ bin/spc doctor
|
||||
bin/spc doctor --auto-fix
|
||||
```
|
||||
|
||||
## Command - build
|
||||
### Command - build
|
||||
|
||||
Use the build command to start building the static php binary.
|
||||
Before executing the `bin/spc build` command, be sure to use the `download` command to download sources.
|
||||
It is recommended to use `doctor` to check the environment.
|
||||
|
||||
### Basic build
|
||||
#### Basic build
|
||||
|
||||
You need to go to [Extension List](./extensions) or [Command Generator](./cli-generator) to select the extension you want to add,
|
||||
and then use the command `bin/spc build` to compile.
|
||||
@@ -246,6 +291,7 @@ You need to specify a compilation target, choose from the following parameters:
|
||||
- `--build-fpm`: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
|
||||
- `--build-micro`: Build a micro sapi (used to build a standalone executable binary containing PHP code)
|
||||
- `--build-embed`: Build an embed sapi (used to embed into other C language programs)
|
||||
- `--build-frankenphp`: Build a [FrankenPHP](https://github.com/php/frankenphp) executable
|
||||
- `--build-all`: build all above sapi
|
||||
|
||||
```bash
|
||||
@@ -283,16 +329,7 @@ bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
|
||||
```
|
||||
:::
|
||||
|
||||
### Debug
|
||||
|
||||
If you encounter problems during the compilation process, or want to view each executing shell command,
|
||||
you can use `--debug` to enable debug mode and view all terminal logs:
|
||||
|
||||
```bash
|
||||
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||
```
|
||||
|
||||
### Build Options
|
||||
#### Build Options
|
||||
|
||||
During the compilation process, in some special cases,
|
||||
the compiler and the content of the compilation directory need to be intervened.
|
||||
@@ -302,7 +339,7 @@ You can try to use the following commands:
|
||||
- `--cxx=XXX`: Specifies the execution command of the C++ language compiler (Linux defaults to `g++`, macOS defaults to `clang++`)
|
||||
- `--with-clean`: clean up old make files before compiling PHP
|
||||
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
|
||||
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
|
||||
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size
|
||||
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
|
||||
- `--with-config-file-path=XXX`: Set the path in which to look for `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
||||
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
||||
@@ -322,6 +359,15 @@ For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simpl
|
||||
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"
|
||||
```
|
||||
|
||||
## Debug
|
||||
|
||||
If you encounter problems during the compilation process, or want to view each executing shell command,
|
||||
you can use `--debug` to enable debug mode and view all terminal logs:
|
||||
|
||||
```bash
|
||||
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||
```
|
||||
|
||||
## Command - micro:combine
|
||||
|
||||
Use the `micro:combine` command to build the compiled `micro.sfx` and your code (`.php` or `.phar` file) into an executable binary.
|
||||
@@ -465,6 +511,8 @@ When `bin/spc doctor` automatically repairs the Windows environment, tools such
|
||||
Here is an example of installing the tool:
|
||||
|
||||
- Download and install UPX (Linux and Windows only): `bin/spc install-pkg upx`
|
||||
- Download and install nasm (Windows only): `bin/spc install-pkg nasm`
|
||||
- Download and install go-xcaddy: `bin/spc install-pkg go-xcaddy`
|
||||
|
||||
## Command - del-download
|
||||
|
||||
|
||||
7
docs/zh/develop/craft-yml.md
Normal file
7
docs/zh/develop/craft-yml.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
aside: false
|
||||
---
|
||||
|
||||
# craft.yml 配置
|
||||
|
||||
<!--@include: ../../deps-craft-yml.md-->
|
||||
@@ -35,17 +35,11 @@ buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" -
|
||||
```
|
||||
|
||||
对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:`/usr/lib/libresolv.9.dylib` 和 `/usr/lib/libSystem.B.dylib`。
|
||||
所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,可使用动态链接的扩展:
|
||||
因此,在 macOS 上,您可以直接构建出使用静态编译的 PHP 二进制文件和动态链接的扩展:
|
||||
|
||||
1. 使用 `--no-strip` 参数,将不会对二进制文件去除调试符号等信息,以供使用 `Xdebug` 等外部 Zend 扩展。
|
||||
2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
|
||||
3. 使用 `phpize && ./configure && make` 命令编译想要使用的扩展。
|
||||
4. 将扩展文件 `xxxx.so` 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:`cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`。
|
||||
|
||||
```bash
|
||||
# 构建静态 php-cli
|
||||
bin/spc build ffi --build-cli --no-strip
|
||||
```
|
||||
1. 使用 `--build-shared=XXX` 选项构建共享扩展 `xxx.so`。例如:`bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
|
||||
2. 您将获得 `buildroot/modules/xdebug.so` 和 `buildroot/bin/php`。
|
||||
3. `xdebug.so` 文件可用于版本和线程安全相同的 php。
|
||||
|
||||
## 可以支持 Oracle 数据库扩展吗
|
||||
|
||||
|
||||
@@ -51,5 +51,4 @@ glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。
|
||||
|
||||
如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 `bin/spc-gnu-docker` 脚本,手动构建一个类似的环境。
|
||||
|
||||
由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。
|
||||
任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。
|
||||
请注意,我们仅支持使用 bin/spc-gnu-docker 构建的 glibc 版本。已在 RHEL 9 和 10 上进行了编译测试并验证其稳定性,但如果您遇到问题,我们可能不会进行修复。
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
## curl
|
||||
|
||||
HTTP3 支持默认未启用,需在编译时添加 `--with-libs="nghttp2,nghttp3,ngtcp2"` 以启用 PHP 8.4 及以上版本的 HTTP3 支持。
|
||||
|
||||
使用 curl 请求 HTTPS 时,可能存在 `error:80000002:system library::No such file or directory` 错误,
|
||||
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)。
|
||||
|
||||
@@ -139,8 +141,7 @@ parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(`--
|
||||
|
||||
## spx
|
||||
|
||||
1. [SPX 扩展](https://github.com/NoiseByNorthwest/php-spx) 只支持非线程模式。
|
||||
2. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
|
||||
1. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
|
||||
|
||||
## mimalloc
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
outline: 'deep'
|
||||
---
|
||||
|
||||
# 本地构建(Linux、macOS、FreeBSD)
|
||||
|
||||
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)。
|
||||
@@ -112,7 +116,46 @@ sudo apt install php-cli composer php-tokenizer
|
||||
较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。
|
||||
:::
|
||||
|
||||
## 命令 download - 下载依赖包
|
||||
## 使用 craft 构建(推荐)
|
||||
|
||||
使用 `bin/spc craft` 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。
|
||||
|
||||
你需要编写一个 `craft.yml` 文件,存放在当前工作目录下。`craft.yml` 可以由 [命令生成器](./cli-generator) 生成,或者手动编写。
|
||||
|
||||
手动编写可参考 [craft.yml 配置](../develop/craft-yml.md) 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 `cli` 和 `fpm`:
|
||||
|
||||
```yaml
|
||||
# path/to/craft.yml
|
||||
php-version: 8.4
|
||||
extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
|
||||
sapi:
|
||||
- cli
|
||||
- fpm
|
||||
```
|
||||
|
||||
然后使用 `bin/spc craft` 命令来编译:
|
||||
|
||||
```bash
|
||||
bin/spc craft --debug
|
||||
```
|
||||
|
||||
如果构建成功,你会在当前目录下看到 `buildroot/bin` 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。
|
||||
|
||||
- cli: Windows 下构建结果为 `buildroot/bin/php.exe`,其他平台为 `buildroot/bin/php`。
|
||||
- fpm: 构建结果为 `buildroot/bin/php-fpm`。
|
||||
- micro: 构建结果为 `buildroot/bin/micro.sfx`,如需进一步与 PHP 代码打包,请查看 [打包 micro 二进制](./manual-build#命令-micro-combine-打包-micro-二进制)。
|
||||
- embed: 参见 [embed 使用](./manual-build#embed-使用)。
|
||||
- frankenphp: 构建结果为 `buildroot/bin/frankenphp`。
|
||||
|
||||
如果中途构建出错,你可以使用 `--debug` 参数查看详细的错误信息,或者使用 `--with-clean` 参数清除旧的编译结果,重新编译。
|
||||
|
||||
如使用以上方式仍构建失败,请提交一个 issue,附上你的 `craft.yml`、`craft.log`。
|
||||
|
||||
## 分步构建命令
|
||||
|
||||
如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 `bin/spc` 命令分步执行。
|
||||
|
||||
### 命令 download - 下载依赖包
|
||||
|
||||
使用命令 `bin/spc download` 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。
|
||||
|
||||
@@ -184,7 +227,7 @@ bin/spc download --for-extensions=redis,phar -G "php-src:master:https://github.c
|
||||
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
||||
```
|
||||
|
||||
## 命令 doctor - 环境检查
|
||||
### 命令 doctor - 环境检查
|
||||
|
||||
如果你可以正常运行 `bin/spc` 但无法正常编译静态的 PHP 或依赖库,可以先运行 `bin/spc doctor` 检查系统自身是否缺少依赖。
|
||||
|
||||
@@ -196,11 +239,11 @@ bin/spc doctor
|
||||
bin/spc doctor --auto-fix
|
||||
```
|
||||
|
||||
## 命令 build - 编译 PHP
|
||||
### 命令 build - 编译 PHP
|
||||
|
||||
使用 build 命令可以开始构建静态 php 二进制,在执行 `bin/spc build` 命令前,务必先使用 `download` 命令下载资源,建议使用 `doctor` 检查环境。
|
||||
|
||||
### 基本用法
|
||||
#### 基本用法
|
||||
|
||||
你需要先到 [扩展列表](./extensions) 或 [命令生成器](./cli-generator) 选择你要加入的扩展,然后使用命令 `bin/spc build` 进行编译。你需要指定一个编译目标,从如下参数中选择:
|
||||
|
||||
@@ -208,6 +251,7 @@ bin/spc doctor --auto-fix
|
||||
- `--build-fpm`: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
|
||||
- `--build-micro`: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
|
||||
- `--build-embed`: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
|
||||
- `--build-frankenphp`: 构建一个 [frankenphp](https://github.com/php/frankenphp) 二进制
|
||||
- `--build-all`: 构建以上所有 sapi
|
||||
|
||||
```bash
|
||||
@@ -244,15 +288,7 @@ bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
|
||||
```
|
||||
:::
|
||||
|
||||
### 调试
|
||||
|
||||
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
|
||||
|
||||
```bash
|
||||
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||
```
|
||||
|
||||
### 编译运行选项
|
||||
#### 编译运行选项
|
||||
|
||||
在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:
|
||||
|
||||
@@ -260,7 +296,7 @@ bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||
- `--cxx=XXX`: 指定 C++ 语言编译器的执行命令(Linux 默认 `g++`,macOS 默认 `clang++`)
|
||||
- `--with-clean`: 编译 PHP 前先清理旧的 make 产生的文件
|
||||
- `--enable-zts`: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
|
||||
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
|
||||
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积
|
||||
- `--with-libs=XXX,YYY`: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
|
||||
- `--with-config-file-path=XXX`: 查找 `php.ini` 的路径(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
||||
- `--with-config-file-scan-dir=XXX`: 读取 `php.ini` 后扫描 `.ini` 文件的目录(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
||||
@@ -340,6 +376,14 @@ memory_limit=1G
|
||||
|
||||
如果要打包 phar,只需要将 `a.php` 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 [Developing - Phar 路径问题](../develop/structure#phar-应用目录问题)
|
||||
|
||||
## 调试
|
||||
|
||||
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
|
||||
|
||||
```bash
|
||||
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||
```
|
||||
|
||||
## 命令 extract - 手动解压某个库
|
||||
|
||||
使用命令 `bin/spc extract` 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。
|
||||
@@ -415,6 +459,8 @@ bin/spc dev:sort-config ext
|
||||
下面是安装工具的示例:
|
||||
|
||||
- 下载安装 UPX(仅限 Linux 和 Windows): `bin/spc install-pkg upx`
|
||||
- 下载安装 nasm(仅限 Windows): `bin/spc install-pkg nasm`
|
||||
- 下载安装 go-xcaddy: `bin/spc install-pkg go-xcaddy`
|
||||
|
||||
## 命令 del-download - 删除已下载的资源
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"docs:preview": "vitepress preview docs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.0.0-rc.35",
|
||||
"vitepress": "^2.0.0-alpha.5",
|
||||
"vue": "^3.2.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,7 @@
|
||||
<phpunit
|
||||
bootstrap="tests/bootstrap.php"
|
||||
>
|
||||
</phpunit>
|
||||
<php>
|
||||
<env name="SPC_IGNORE_BAD_HASH" value="yes" force="true" />
|
||||
</php>
|
||||
</phpunit>
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace SPC;
|
||||
|
||||
use SPC\command\BuildLibsCommand;
|
||||
use SPC\command\BuildPHPCommand;
|
||||
use SPC\command\CraftCommand;
|
||||
use SPC\command\DeleteDownloadCommand;
|
||||
use SPC\command\dev\AllExtCommand;
|
||||
use SPC\command\dev\ExtVerCommand;
|
||||
@@ -32,7 +33,7 @@ use Symfony\Component\Console\Application;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const VERSION = '2.5.2';
|
||||
public const VERSION = '2.6.1';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -43,6 +44,8 @@ final class ConsoleApplication extends Application
|
||||
|
||||
$this->addCommands(
|
||||
[
|
||||
// Craft command
|
||||
new CraftCommand(),
|
||||
// Common commands
|
||||
new BuildPHPCommand(),
|
||||
new BuildLibsCommand(),
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder;
|
||||
|
||||
use PharIo\FileSystem\File;
|
||||
use SPC\exception\ExceptionHandler;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\InterruptException;
|
||||
@@ -11,6 +12,7 @@ use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\Config;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\LockFile;
|
||||
use SPC\store\SourceManager;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
@@ -127,7 +129,7 @@ abstract class BuilderBase
|
||||
if ($including_shared) {
|
||||
return $this->exts;
|
||||
}
|
||||
return array_filter($this->exts, fn ($ext) => !$ext->isBuildShared());
|
||||
return array_filter($this->exts, fn ($ext) => $ext->isBuildStatic());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,15 +235,41 @@ abstract class BuilderBase
|
||||
*/
|
||||
abstract public function buildPHP(int $build_target = BUILD_TARGET_NONE);
|
||||
|
||||
/**
|
||||
* Test PHP
|
||||
*/
|
||||
abstract public function testPHP(int $build_target = BUILD_TARGET_NONE);
|
||||
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function buildSharedExts(): void
|
||||
{
|
||||
foreach ($this->getExts() as $ext) {
|
||||
if (!$ext->isBuildShared()) {
|
||||
continue;
|
||||
$lines = file(BUILD_BIN_PATH . '/php-config');
|
||||
$extension_dir_line = null;
|
||||
foreach ($lines as $key => $value) {
|
||||
if (str_starts_with($value, 'extension_dir=')) {
|
||||
$lines[$key] = 'extension_dir="' . BUILD_MODULES_PATH . '"' . PHP_EOL;
|
||||
$extension_dir_line = $value;
|
||||
break;
|
||||
}
|
||||
logger()->info('Building extension [' . $ext->getName() . '] as shared extension (' . $ext->getName() . '.so)');
|
||||
$ext->buildShared();
|
||||
}
|
||||
file_put_contents(BUILD_BIN_PATH . '/php-config', implode('', $lines));
|
||||
FileSystem::createDir(BUILD_MODULES_PATH);
|
||||
try {
|
||||
foreach ($this->getExts() as $ext) {
|
||||
if (!$ext->isBuildShared()) {
|
||||
continue;
|
||||
}
|
||||
$ext->buildShared();
|
||||
}
|
||||
} catch (RuntimeException $e) {
|
||||
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
|
||||
throw $e;
|
||||
}
|
||||
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,9 +282,21 @@ abstract class BuilderBase
|
||||
public function makeStaticExtensionArgs(): string
|
||||
{
|
||||
$ret = [];
|
||||
foreach ($this->getExts(false) as $ext) {
|
||||
logger()->info($ext->getName() . ' is using ' . $ext->getConfigureArg());
|
||||
$ret[] = trim($ext->getConfigureArg());
|
||||
foreach ($this->getExts() as $ext) {
|
||||
$arg = $ext->getConfigureArg();
|
||||
if ($ext->isBuildShared() && !$ext->isBuildStatic()) {
|
||||
if (
|
||||
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
|
||||
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
|
||||
Config::getExt($ext->getName(), 'build-with-php') === true
|
||||
) {
|
||||
$arg = $ext->getConfigureArg(true);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
logger()->info($ext->getName() . ' is using ' . $arg);
|
||||
$ret[] = trim($arg);
|
||||
}
|
||||
logger()->debug('Using configure: ' . implode(' ', $ret));
|
||||
return implode(' ', $ret);
|
||||
@@ -311,15 +351,11 @@ abstract class BuilderBase
|
||||
public function getPHPVersionFromArchive(?string $file = null): false|string
|
||||
{
|
||||
if ($file === null) {
|
||||
$lock = file_exists(DOWNLOAD_PATH . '/.lock.json') ? file_get_contents(DOWNLOAD_PATH . '/.lock.json') : false;
|
||||
if ($lock === false) {
|
||||
return false;
|
||||
}
|
||||
$lock = json_decode($lock, true);
|
||||
$file = $lock['php-src']['filename'] ?? null;
|
||||
if ($file === null) {
|
||||
$lock = LockFile::get('php-src');
|
||||
if ($lock === null) {
|
||||
return false;
|
||||
}
|
||||
$file = LockFile::getLockFullPath($lock);
|
||||
}
|
||||
if (preg_match('/php-(\d+\.\d+\.\d+(?:RC\d+)?)\.tar\.(?:gz|bz2|xz)/', $file, $match)) {
|
||||
return $match[1];
|
||||
@@ -365,6 +401,9 @@ abstract class BuilderBase
|
||||
if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
|
||||
$ls[] = 'embed';
|
||||
}
|
||||
if (($type & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
|
||||
$ls[] = 'frankenphp';
|
||||
}
|
||||
return implode(', ', $ls);
|
||||
}
|
||||
|
||||
@@ -471,6 +510,29 @@ abstract class BuilderBase
|
||||
}
|
||||
}
|
||||
|
||||
public function checkBeforeBuildPHP(int $rule): void
|
||||
{
|
||||
if (($rule & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
|
||||
if (!$this->getOption('enable-zts')) {
|
||||
throw new WrongUsageException('FrankenPHP SAPI requires ZTS enabled PHP, build with `--enable-zts`!');
|
||||
}
|
||||
// frankenphp doesn't support windows, BSD is currently not supported by static-php-cli
|
||||
if (!in_array(PHP_OS_FAMILY, ['Linux', 'Darwin'])) {
|
||||
throw new WrongUsageException('FrankenPHP SAPI is only available on Linux and macOS!');
|
||||
}
|
||||
// frankenphp needs package go-xcaddy installed
|
||||
$pkg_dir = PKG_ROOT_PATH . '/go-xcaddy-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname();
|
||||
if (!file_exists("{$pkg_dir}/bin/go") || !file_exists("{$pkg_dir}/bin/xcaddy")) {
|
||||
global $argv;
|
||||
throw new WrongUsageException("FrankenPHP SAPI requires the go-xcaddy package, please install it first: {$argv[0]} install-pkg go-xcaddy");
|
||||
}
|
||||
// frankenphp needs libxml2 lib on macos, see: https://github.com/php/frankenphp/blob/main/frankenphp.go#L17
|
||||
if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) {
|
||||
throw new WrongUsageException('FrankenPHP SAPI for macOS requires libxml2 library, please include the `xml` extension in your build.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate micro extension test php code.
|
||||
*/
|
||||
|
||||
@@ -40,7 +40,7 @@ class Extension
|
||||
// set source_dir for builtin
|
||||
if ($ext_type === 'builtin') {
|
||||
$this->source_dir = SOURCE_PATH . '/php-src/ext/' . $this->name;
|
||||
} else {
|
||||
} elseif ($ext_type === 'external') {
|
||||
$source = Config::getExt($this->name, 'source');
|
||||
if ($source === null) {
|
||||
throw new RuntimeException("{$ext_type} extension {$name} source not found");
|
||||
@@ -48,29 +48,31 @@ class Extension
|
||||
$source_path = Config::getSource($source)['path'] ?? null;
|
||||
$source_path = $source_path === null ? SOURCE_PATH . '/' . $source : SOURCE_PATH . '/' . $source_path;
|
||||
$this->source_dir = $source_path;
|
||||
} else {
|
||||
$this->source_dir = SOURCE_PATH . '/php-src';
|
||||
}
|
||||
}
|
||||
|
||||
public function getFrameworks(): array
|
||||
{
|
||||
return Config::getExt($this->getName(), 'frameworks', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开启该扩展的 PHP 编译添加的参数
|
||||
*
|
||||
* @throws FileSystemException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function getConfigureArg(): string
|
||||
public function getConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = $this->getEnableArg();
|
||||
switch (PHP_OS_FAMILY) {
|
||||
case 'Windows':
|
||||
$arg .= $this->getWindowsConfigureArg();
|
||||
break;
|
||||
case 'Darwin':
|
||||
case 'Linux':
|
||||
case 'BSD':
|
||||
$arg .= $this->getUnixConfigureArg();
|
||||
break;
|
||||
}
|
||||
return $arg;
|
||||
return match (PHP_OS_FAMILY) {
|
||||
'Windows' => $this->getWindowsConfigureArg($shared),
|
||||
'Darwin',
|
||||
'Linux',
|
||||
'BSD' => $this->getUnixConfigureArg($shared),
|
||||
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build is not supported yet'),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,13 +81,13 @@ class Extension
|
||||
* @throws FileSystemException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function getEnableArg(): string
|
||||
public function getEnableArg(bool $shared = false): string
|
||||
{
|
||||
$_name = str_replace('_', '-', $this->name);
|
||||
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
|
||||
'enable' => '--enable-' . $_name . ' ',
|
||||
'with' => '--with-' . $_name . ' ',
|
||||
'with-prefix' => '--with-' . $_name . '="' . BUILD_ROOT_PATH . '" ',
|
||||
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',
|
||||
'with' => '--with-' . $_name . ($shared ? '=shared' : '') . ' ',
|
||||
'with-prefix' => '--with-' . $_name . '=' . ($shared ? 'shared,' : '') . '"' . BUILD_ROOT_PATH . '" ',
|
||||
'none', 'custom' => '',
|
||||
default => throw new WrongUsageException("argType does not accept {$arg_type}, use [enable/with/with-prefix] ."),
|
||||
};
|
||||
@@ -145,15 +147,15 @@ class Extension
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '';
|
||||
return $this->getEnableArg();
|
||||
// Windows is not supported yet
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '';
|
||||
return $this->getEnableArg($shared);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,18 +189,80 @@ class Extension
|
||||
}
|
||||
|
||||
/**
|
||||
* Run shared extension check when cli is enabled
|
||||
* @throws RuntimeException
|
||||
* Patch code before shared extension phpize
|
||||
* If you need to patch some code, overwrite this
|
||||
* return true if you patched something, false if not
|
||||
*/
|
||||
public function runSharedExtensionCheckUnix(): void
|
||||
public function patchBeforeSharedPhpize(): bool
|
||||
{
|
||||
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -d "extension=' . BUILD_LIB_PATH . '/' . $this->getName() . '.so" --ri ' . $this->getName());
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException($this->getName() . '.so failed to load');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before shared extension ./configure
|
||||
* If you need to patch some code, overwrite this
|
||||
* return true if you patched something, false if not
|
||||
*/
|
||||
public function patchBeforeSharedConfigure(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before shared extension make
|
||||
* If you need to patch some code, overwrite this
|
||||
* return true if you patched something, false if not
|
||||
*/
|
||||
public function patchBeforeSharedMake(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* returns a command line string with all required shared extensions to load
|
||||
* i.e.; pdo_pgsql would return:
|
||||
*
|
||||
* `-d "extension=pgsql" -d "extension=pdo_pgsql"`
|
||||
* @throws FileSystemException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function getSharedExtensionLoadString(): string
|
||||
{
|
||||
$loaded = [];
|
||||
$order = [];
|
||||
|
||||
$resolve = function ($extension) use (&$resolve, &$loaded, &$order) {
|
||||
if (isset($loaded[$extension->getName()])) {
|
||||
return;
|
||||
}
|
||||
$loaded[$extension->getName()] = true;
|
||||
|
||||
foreach ($this->dependencies as $dependency) {
|
||||
$resolve($dependency);
|
||||
}
|
||||
|
||||
$order[] = $extension;
|
||||
};
|
||||
|
||||
$resolve($this);
|
||||
|
||||
$ret = '';
|
||||
foreach ($order as $ext) {
|
||||
if ($ext instanceof Extension && $ext->isBuildShared()) {
|
||||
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
|
||||
$ret .= " -d \"zend_extension={$ext->getName()}\"";
|
||||
} else {
|
||||
$ret .= " -d \"extension={$ext->getName()}\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->isBuildStatic()) {
|
||||
logger()->warning($this->getName() . '.so test succeeded, but has little significance since it is also compiled in statically.');
|
||||
|
||||
if ($ret !== '') {
|
||||
$ret = ' -d "extension_dir=' . BUILD_MODULES_PATH . '"' . $ret;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,9 +273,13 @@ class Extension
|
||||
// Run compile check if build target is cli
|
||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||
// If check failed, throw RuntimeException
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "' . $this->getDistName() . '"', false);
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
throw new RuntimeException(
|
||||
'extension ' . $this->getName() . ' failed runtime check: php-cli returned ' . $ret . "\n" .
|
||||
join("\n", $out)
|
||||
);
|
||||
}
|
||||
|
||||
if (file_exists(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')) {
|
||||
@@ -222,7 +290,7 @@ class Extension
|
||||
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
|
||||
);
|
||||
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "' . trim($test) . '"');
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' -r "' . trim($test) . '"');
|
||||
if ($ret !== 0) {
|
||||
if ($this->builder->getOption('debug')) {
|
||||
var_dump($out);
|
||||
@@ -273,6 +341,30 @@ class Extension
|
||||
*/
|
||||
public function buildShared(): void
|
||||
{
|
||||
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||
logger()->info('Shared extension [' . $this->getName() . '] was already built by php-src/configure (' . $this->getName() . '.so)');
|
||||
return;
|
||||
}
|
||||
if (Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||
logger()->warning('Shared extension [' . $this->getName() . '] did not build with php-src/configure (' . $this->getName() . '.so)');
|
||||
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||
logger()->info('Shared extension [' . $this->getName() . '] was already built, skipping (' . $this->getName() . '.so)');
|
||||
}
|
||||
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
|
||||
foreach ($this->dependencies as $dependency) {
|
||||
if (!$dependency instanceof Extension) {
|
||||
continue;
|
||||
}
|
||||
if (!$dependency->isBuildStatic()) {
|
||||
logger()->info('extension ' . $this->getName() . ' requires extension ' . $dependency->getName());
|
||||
$dependency->buildShared();
|
||||
}
|
||||
}
|
||||
match (PHP_OS_FAMILY) {
|
||||
'Darwin', 'Linux' => $this->buildUnixShared(),
|
||||
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),
|
||||
@@ -290,26 +382,58 @@ class Extension
|
||||
*/
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()]);
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], with_dependencies: true);
|
||||
[$staticLibString, $sharedLibString] = $this->getStaticAndSharedLibs();
|
||||
|
||||
// macOS ld64 doesn't understand these, while Linux and BSD do
|
||||
// use them to make sure that all symbols are picked up, even if a library has already been visited before
|
||||
$preStatic = PHP_OS_FAMILY !== 'Darwin' ? '-Wl,-Bstatic -Wl,--start-group ' : '';
|
||||
$postStatic = PHP_OS_FAMILY !== 'Darwin' ? ' -Wl,--end-group -Wl,-Bdynamic ' : ' ';
|
||||
$env = [
|
||||
'CFLAGS' => $config['cflags'],
|
||||
'CXXFLAGS' => $config['cflags'],
|
||||
'LDFLAGS' => $config['ldflags'],
|
||||
'LIBS' => $config['libs'],
|
||||
'LIBS' => $preStatic . $staticLibString . $postStatic . $sharedLibString,
|
||||
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
|
||||
];
|
||||
|
||||
if ($this->patchBeforeSharedPhpize()) {
|
||||
logger()->info("Extension [{$this->getName()}] patched before shared phpize");
|
||||
}
|
||||
|
||||
// prepare configure args
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv($env)
|
||||
->execWithEnv(BUILD_BIN_PATH . '/phpize')
|
||||
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static')
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv('make -j' . $this->builder->concurrency);
|
||||
->exec(BUILD_BIN_PATH . '/phpize');
|
||||
|
||||
// copy shared library
|
||||
copy($this->source_dir . '/modules/' . $this->getDistName() . '.so', BUILD_LIB_PATH . '/' . $this->getDistName() . '.so');
|
||||
// check shared extension with php-cli
|
||||
if (file_exists(BUILD_BIN_PATH . '/php')) {
|
||||
$this->runSharedExtensionCheckUnix();
|
||||
if ($this->patchBeforeSharedConfigure()) {
|
||||
logger()->info("Extension [{$this->getName()}] patched before shared configure");
|
||||
}
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv($env)
|
||||
->exec(
|
||||
'./configure ' . $this->getUnixConfigureArg(true) .
|
||||
' --with-php-config=' . BUILD_BIN_PATH . '/php-config ' .
|
||||
'--enable-shared --disable-static'
|
||||
);
|
||||
|
||||
// some extensions don't define their dependencies well, this patch is only needed for a few
|
||||
FileSystem::replaceFileRegex(
|
||||
$this->source_dir . '/Makefile',
|
||||
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
||||
'$1 ' . $staticLibString
|
||||
);
|
||||
|
||||
if ($this->patchBeforeSharedMake()) {
|
||||
logger()->info("Extension [{$this->getName()}] patched before shared make");
|
||||
}
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv($env)
|
||||
->exec('make clean')
|
||||
->exec('make -j' . $this->builder->concurrency)
|
||||
->exec('make install');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,6 +504,37 @@ class Extension
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get required static and shared libraries as a pair of strings in format -l{libname} -l{libname2}
|
||||
*
|
||||
* @return array [staticLibString, sharedLibString]
|
||||
*/
|
||||
protected function getStaticAndSharedLibs(): array
|
||||
{
|
||||
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], with_dependencies: true);
|
||||
$sharedLibString = '';
|
||||
$staticLibString = '';
|
||||
$staticLibs = $this->getLibFilesString();
|
||||
$staticLibs = str_replace(BUILD_LIB_PATH . '/lib', '-l', $staticLibs);
|
||||
$staticLibs = str_replace('.a', '', $staticLibs);
|
||||
$staticLibs = explode('-l', $staticLibs . ' ' . $config['libs']);
|
||||
foreach ($staticLibs as $lib) {
|
||||
$lib = trim($lib);
|
||||
if ($lib === '') {
|
||||
continue;
|
||||
}
|
||||
$static_lib = 'lib' . $lib . '.a';
|
||||
if (file_exists(BUILD_LIB_PATH . '/' . $static_lib) && !str_contains($static_lib, 'libphp')) {
|
||||
if (!str_contains($staticLibString, '-l' . $lib . ' ')) {
|
||||
$staticLibString .= '-l' . $lib . ' ';
|
||||
}
|
||||
} elseif (!str_contains($sharedLibString, '-l' . $lib . ' ')) {
|
||||
$sharedLibString .= '-l' . $lib . ' ';
|
||||
}
|
||||
}
|
||||
return [trim($staticLibString), trim($sharedLibString)];
|
||||
}
|
||||
|
||||
private function getLibraryDependencies(bool $recursive = false): array
|
||||
{
|
||||
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
|
||||
@@ -405,6 +560,11 @@ class Extension
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists(0, $deps)) {
|
||||
$zero = [0 => $deps[0]];
|
||||
unset($deps[0]);
|
||||
return $zero + $deps;
|
||||
}
|
||||
return $deps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,14 @@ use SPC\exception\WrongUsageException;
|
||||
use SPC\store\Config;
|
||||
use SPC\store\Downloader;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\store\LockFile;
|
||||
use SPC\store\SourceManager;
|
||||
use SPC\util\GlobalValueTrait;
|
||||
|
||||
abstract class LibraryBase
|
||||
{
|
||||
use GlobalValueTrait;
|
||||
|
||||
/** @var string */
|
||||
public const NAME = 'unknown';
|
||||
|
||||
@@ -31,7 +35,7 @@ abstract class LibraryBase
|
||||
if (static::NAME === 'unknown') {
|
||||
throw new RuntimeException('no unknown!!!!!');
|
||||
}
|
||||
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . static::NAME);
|
||||
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . Config::getLib(static::NAME, 'source'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,12 +47,11 @@ abstract class LibraryBase
|
||||
*/
|
||||
public function setup(bool $force = false): int
|
||||
{
|
||||
$lock = json_decode(FileSystem::readFile(DOWNLOAD_PATH . '/.lock.json'), true) ?? [];
|
||||
$source = Config::getLib(static::NAME, 'source');
|
||||
// if source is locked as pre-built, we just tryInstall it
|
||||
$pre_built_name = Downloader::getPreBuiltLockName($source);
|
||||
if (isset($lock[$pre_built_name]) && ($lock[$pre_built_name]['lock_as'] ?? SPC_DOWNLOAD_SOURCE) === SPC_DOWNLOAD_PRE_BUILT) {
|
||||
return $this->tryInstall($lock[$pre_built_name]['filename'], $force);
|
||||
if (($lock = LockFile::get($pre_built_name)) && $lock['lock_as'] === SPC_DOWNLOAD_PRE_BUILT) {
|
||||
return $this->tryInstall($lock, $force);
|
||||
}
|
||||
return $this->tryBuild($force);
|
||||
}
|
||||
@@ -163,14 +166,15 @@ abstract class LibraryBase
|
||||
* @throws WrongUsageException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function tryInstall(string $install_file, bool $force_install = false): int
|
||||
public function tryInstall(array $lock, bool $force_install = false): int
|
||||
{
|
||||
$install_file = $lock['filename'];
|
||||
if ($force_install) {
|
||||
logger()->info('Installing required library [' . static::NAME . '] from pre-built binaries');
|
||||
|
||||
// Extract files
|
||||
try {
|
||||
FileSystem::extractPackage($install_file, DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
||||
FileSystem::extractPackage($install_file, $lock['source_type'], DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
||||
$this->install();
|
||||
return LIB_STATUS_OK;
|
||||
} catch (FileSystemException|RuntimeException $e) {
|
||||
@@ -180,19 +184,19 @@ abstract class LibraryBase
|
||||
}
|
||||
foreach ($this->getStaticLibs() as $name) {
|
||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
||||
$this->tryInstall($install_file, true);
|
||||
$this->tryInstall($lock, true);
|
||||
return LIB_STATUS_OK;
|
||||
}
|
||||
}
|
||||
foreach ($this->getHeaders() as $name) {
|
||||
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
|
||||
$this->tryInstall($install_file, true);
|
||||
$this->tryInstall($lock, true);
|
||||
return LIB_STATUS_OK;
|
||||
}
|
||||
}
|
||||
// pkg-config is treated specially. If it is pkg-config, check if the pkg-config binary exists
|
||||
if (static::NAME === 'pkg-config' && !file_exists(BUILD_ROOT_PATH . '/bin/pkg-config')) {
|
||||
$this->tryInstall($install_file, true);
|
||||
$this->tryInstall($lock, true);
|
||||
return LIB_STATUS_OK;
|
||||
}
|
||||
return LIB_STATUS_ALREADY;
|
||||
|
||||
@@ -25,10 +25,10 @@ class amqp extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-amqp --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
|
||||
return '--with-amqp' . ($shared ? '=shared' : '') . ' --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg($shared = false): string
|
||||
{
|
||||
return '--with-amqp';
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\builder\linux\LinuxBuilder;
|
||||
use SPC\builder\macos\MacOSBuilder;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
@@ -21,7 +22,7 @@ class curl extends Extension
|
||||
{
|
||||
logger()->info('patching before-configure for curl checks');
|
||||
$file1 = "AC_DEFUN([PHP_CHECK_LIBRARY], [\n $3\n])";
|
||||
$files = FileSystem::readFile(SOURCE_PATH . '/php-src/ext/curl/config.m4');
|
||||
$files = FileSystem::readFile($this->source_dir . '/config.m4');
|
||||
$file2 = 'AC_DEFUN([PHP_CHECK_LIBRARY], [
|
||||
save_old_LDFLAGS=$LDFLAGS
|
||||
ac_stuff="$5"
|
||||
@@ -40,7 +41,7 @@ class curl extends Extension
|
||||
$4
|
||||
])dnl
|
||||
])';
|
||||
file_put_contents(SOURCE_PATH . '/php-src/ext/curl/config.m4', $file1 . "\n" . $files . "\n" . $file2);
|
||||
file_put_contents($this->source_dir . '/config.m4', $file1 . "\n" . $files . "\n" . $file2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,6 +53,72 @@ class curl extends Extension
|
||||
{
|
||||
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
|
||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lcurl/', $this->getLibFilesString() . $frameworks);
|
||||
$this->patchBeforeSharedConfigure();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function patchBeforeSharedConfigure(): bool
|
||||
{
|
||||
$file = $this->source_dir . '/config.m4';
|
||||
$content = FileSystem::readFile($file);
|
||||
|
||||
// Inject patch before it
|
||||
$patch = ' save_LIBS="$LIBS"
|
||||
LIBS="$LIBS $CURL_LIBS"
|
||||
';
|
||||
// Check if already patched
|
||||
if (str_contains($content, $patch)) {
|
||||
return false; // Already patched
|
||||
}
|
||||
|
||||
// Match the line containing PHP_CHECK_LIBRARY for curl
|
||||
$pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/';
|
||||
|
||||
// Restore LIBS after the check — append this just after the macro block
|
||||
$restore = '
|
||||
LIBS="$save_LIBS"';
|
||||
|
||||
// Apply patch
|
||||
$patched = preg_replace_callback($pattern, function ($matches) use ($patch) {
|
||||
return $patch . $matches[1];
|
||||
}, $content, 1);
|
||||
|
||||
// Inject restore after the matching PHP_CHECK_LIBRARY block
|
||||
$patched = preg_replace(
|
||||
'/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s',
|
||||
"$1{$restore}\n",
|
||||
$patched,
|
||||
1
|
||||
);
|
||||
|
||||
if ($patched === null) {
|
||||
throw new \RuntimeException('Failed to patch config.m4 due to a regex error');
|
||||
}
|
||||
|
||||
FileSystem::writeFile($file, $patched);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
if (!$this->builder instanceof LinuxBuilder) {
|
||||
parent::buildUnixShared();
|
||||
return;
|
||||
}
|
||||
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/config.m4',
|
||||
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
|
||||
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
|
||||
);
|
||||
try {
|
||||
parent::buildUnixShared();
|
||||
} finally {
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/config.m4',
|
||||
['${ext_dir}phar.1', '${ext_dir}phar.phar.1'],
|
||||
['$ext_dir/phar.1', '$ext_dir/phar.phar.1']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ class dba extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . BUILD_ROOT_PATH) : '';
|
||||
return '--enable-dba' . $qdbm;
|
||||
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH) : '';
|
||||
return '--enable-dba' . ($shared ? '=shared' : '') . $qdbm;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$qdbm = $this->builder->getLib('qdbm') ? ' --with-qdbm' : '';
|
||||
return '--with-dba' . $qdbm;
|
||||
|
||||
35
src/SPC/builder/extension/dom.php
Normal file
35
src/SPC/builder/extension/dom.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('dom')]
|
||||
class dom extends Extension
|
||||
{
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-dom' . ($shared ? '=shared' : '');
|
||||
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', '');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg($shared = false): string
|
||||
{
|
||||
return '--with-dom';
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,10 @@ class ffi extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-ffi --enable-zend-signals';
|
||||
return '--with-ffi' . ($shared ? '=shared' : '') . ' --enable-zend-signals';
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-ffi';
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class gd extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-gd';
|
||||
$arg = '--enable-gd' . ($shared ? '=shared' : '');
|
||||
$arg .= $this->builder->getLib('freetype') ? ' --with-freetype' : '';
|
||||
$arg .= $this->builder->getLib('libjpeg') ? ' --with-jpeg' : '';
|
||||
$arg .= $this->builder->getLib('libwebp') ? ' --with-webp' : '';
|
||||
|
||||
@@ -35,7 +35,7 @@ class glfw extends Extension
|
||||
return '--enable-glfw --with-glfw-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-glfw=static';
|
||||
}
|
||||
|
||||
@@ -12,10 +12,13 @@ class imagick extends Extension
|
||||
{
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
if (getenv('SPC_LIBC') !== 'musl') {
|
||||
if (PHP_OS_FAMILY !== 'Linux') {
|
||||
return false;
|
||||
}
|
||||
// imagick with calls omp_pause_all which requires -lgomp, on non-musl we build imagick without openmp
|
||||
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||
return false;
|
||||
}
|
||||
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
|
||||
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lgomp');
|
||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
||||
return true;
|
||||
@@ -23,7 +26,18 @@ class imagick extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$disable_omp = getenv('SPC_LIBC') === 'musl' ? '' : ' ac_cv_func_omp_pause_resource_all=no';
|
||||
return '--with-imagick=' . BUILD_ROOT_PATH . $disable_omp;
|
||||
$disable_omp = !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) ? '' : ' ac_cv_func_omp_pause_resource_all=no';
|
||||
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
|
||||
}
|
||||
|
||||
protected function getStaticAndSharedLibs(): array
|
||||
{
|
||||
// on centos 7, it will use the symbol _ZTINSt6thread6_StateE, which is not defined in system libstdc++.so.6
|
||||
[$static, $shared] = parent::getStaticAndSharedLibs();
|
||||
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
|
||||
$static .= ' -lstdc++';
|
||||
$shared = str_replace('-lstdc++', '', $shared);
|
||||
}
|
||||
return [$static, $shared];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\builder\windows\WindowsBuilder;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
@@ -13,14 +14,19 @@ class intl extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17');
|
||||
// Also need to use clang++ -std=c++17 to force override the default C++ standard
|
||||
if (is_string($env = getenv('CXX')) && !str_contains($env, 'std=c++17')) {
|
||||
f_putenv('CXX=' . $env . ' -std=c++17');
|
||||
} else {
|
||||
f_putenv('CXX=clang++ -std=c++17');
|
||||
if ($this->builder instanceof WindowsBuilder) {
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/php-src/ext/intl/config.w32',
|
||||
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,',
|
||||
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function patchBeforeSharedPhpize(): bool
|
||||
{
|
||||
return $this->patchBeforeBuildconf();
|
||||
}
|
||||
}
|
||||
|
||||
22
src/SPC/builder/extension/lz4.php
Normal file
22
src/SPC/builder/extension/lz4.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('lz4')]
|
||||
class lz4 extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-lz4' . ($shared ? '=shared' : '') . ' --with-lz4-includedir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-lz4';
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class mbregex extends Extension
|
||||
return 'mbstring';
|
||||
}
|
||||
|
||||
public function getConfigureArg(): string
|
||||
public function getConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
@@ -26,7 +26,8 @@ class mbregex extends Extension
|
||||
*/
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "mbstring" | grep regex', false);
|
||||
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? '-d "extension_dir=' . BUILD_MODULES_PATH . '" -d "extension=mbstring"' : '';
|
||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
||||
}
|
||||
|
||||
@@ -10,9 +10,20 @@ use SPC\util\CustomExt;
|
||||
#[CustomExt('mbstring')]
|
||||
class mbstring extends Extension
|
||||
{
|
||||
public function getConfigureArg(): string
|
||||
public function getConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-mbstring';
|
||||
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
|
||||
if ($this->builder->getExt('mbregex') === null) {
|
||||
$arg .= ' --disable-mbregex';
|
||||
} else {
|
||||
$arg .= ' --enable-mbregex';
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
|
||||
if ($this->builder->getExt('mbregex') === null) {
|
||||
$arg .= ' --disable-mbregex';
|
||||
} else {
|
||||
|
||||
@@ -14,7 +14,7 @@ class memcache extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-memcache --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||
return '--enable-memcache' . ($shared ? '=shared' : '') . ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,8 +12,11 @@ class memcached extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$rootdir = BUILD_ROOT_PATH;
|
||||
$zlib_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : "--with-zlib-dir={$rootdir}";
|
||||
return "--enable-memcached {$zlib_dir} --with-libmemcached-dir={$rootdir} --disable-memcached-sasl --enable-memcached-json";
|
||||
return '--enable-memcached' . ($shared ? '=shared' : '') . ' ' .
|
||||
'--with-zlib-dir=' . BUILD_ROOT_PATH . ' ' .
|
||||
'--with-libmemcached-dir=' . BUILD_ROOT_PATH . ' ' .
|
||||
'--disable-memcached-sasl ' .
|
||||
'--enable-memcached-json ' .
|
||||
'--with-system-fastlz';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ class odbc extends Extension
|
||||
{
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-unixODBC=' . BUILD_ROOT_PATH;
|
||||
return '--with-unixODBC=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ class openssl extends Extension
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH;
|
||||
return '--with-openssl=' . BUILD_ROOT_PATH . $openssl_dir;
|
||||
return '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ class pdo_odbc extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
|
||||
return '--with-pdo-odbc=' . ($shared ? 'shared,' : '') . 'unixODBC,' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-pdo-odbc';
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use SPC\util\CustomExt;
|
||||
#[CustomExt('pdo_pgsql')]
|
||||
class pdo_pgsql extends Extension
|
||||
{
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-pdo-pgsql=yes';
|
||||
}
|
||||
|
||||
@@ -36,16 +36,21 @@ class pgsql extends Extension
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||
return '--with-pgsql PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH . ' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' -lpq -lpgport -lpgcommon"';
|
||||
$libfiles = $this->getLibFilesString();
|
||||
$libfiles = str_replace(BUILD_LIB_PATH . '/lib', '-l', $libfiles);
|
||||
$libfiles = str_replace('.a', '', $libfiles);
|
||||
return '--with-pgsql' . ($shared ? '=shared' : '') .
|
||||
' PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH .
|
||||
' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' ' . $libfiles . '"';
|
||||
}
|
||||
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
||||
return '--with-pgsql=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||
return '--with-pgsql';
|
||||
|
||||
37
src/SPC/builder/extension/phar.php
Normal file
37
src/SPC/builder/extension/phar.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\builder\linux\LinuxBuilder;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('phar')]
|
||||
class phar extends Extension
|
||||
{
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
if (!$this->builder instanceof LinuxBuilder) {
|
||||
parent::buildUnixShared();
|
||||
return;
|
||||
}
|
||||
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/config.m4',
|
||||
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
|
||||
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
|
||||
);
|
||||
try {
|
||||
parent::buildUnixShared();
|
||||
} finally {
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/config.m4',
|
||||
['${ext_dir}phar.1', '${ext_dir}phar.phar.1'],
|
||||
['$ext_dir/phar.1', '$ext_dir/phar.phar.1']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,9 @@ class protobuf extends Extension
|
||||
if ($this->builder->getPHPVersionID() < 80000 && getenv('SPC_SKIP_PHP_VERSION_CHECK') !== 'yes') {
|
||||
throw new \RuntimeException('The latest protobuf extension requires PHP 8.0 or later');
|
||||
}
|
||||
$grpc = $this->builder->getExt('grpc');
|
||||
// protobuf conflicts with grpc
|
||||
if ($this->builder->getExt('grpc') !== null) {
|
||||
if ($grpc?->isBuildStatic()) {
|
||||
throw new \RuntimeException('protobuf conflicts with grpc, please remove grpc or protobuf extension');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,13 @@ use SPC\util\CustomExt;
|
||||
#[CustomExt('rdkafka')]
|
||||
class rdkafka extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm\n", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm \$RDKAFKA_LIBS\n");
|
||||
FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm\"\n", '-L$RDKAFKA_DIR/$PHP_LIBDIR -lm $RDKAFKA_LIBS"');
|
||||
return true;
|
||||
}
|
||||
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
// when compiling rdkafka with inline builds, it shows some errors, I don't know why.
|
||||
@@ -27,10 +34,10 @@ class rdkafka extends Extension
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getConfigureArg(): string
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$pkgconf_libs = shell()->execWithResult('pkg-config --libs --static rdkafka')[1];
|
||||
$pkgconf_libs = trim(implode('', $pkgconf_libs));
|
||||
return '--with-rdkafka=' . BUILD_ROOT_PATH . ' LIBS="' . $pkgconf_libs . '"';
|
||||
return '--with-rdkafka=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . ' RDKAFKA_LIBS="' . $pkgconf_libs . '"';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,18 @@ class readline extends Extension
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
public function buildUnixShared(): void
|
||||
{
|
||||
if (!file_exists(BUILD_BIN_PATH . '/php') || !file_exists(BUILD_INCLUDE_PATH . '/php/sapi/cli/cli.h')) {
|
||||
logger()->warning('CLI mode is not enabled, skipping readline build');
|
||||
return;
|
||||
}
|
||||
parent::buildUnixShared();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class redis extends Extension
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-redis';
|
||||
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
||||
|
||||
@@ -5,28 +5,28 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('spx')]
|
||||
class spx extends Extension
|
||||
{
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function validate(): void
|
||||
{
|
||||
if ($this->builder->getOption('enable-zts')) {
|
||||
throw new WrongUsageException('ext-spx is not thread safe, do not build it with ZTS builds');
|
||||
}
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-spx';
|
||||
if ($this->builder->getExt('zlib') === null) {
|
||||
$arg = '--enable-spx' . ($shared ? '=shared' : '');
|
||||
if ($this->builder->getLib('zlib') !== null) {
|
||||
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/Makefile.frag',
|
||||
'@cp -r assets/web-ui/*',
|
||||
'@cp -r ' . $this->source_dir . '/assets/web-ui/*',
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class swoole_hook_mysql extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $this->getSharedExtensionLoadString() . ' --ri "swoole"', false);
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@@ -37,7 +37,8 @@ class swoole_hook_pgsql extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@@ -37,7 +37,8 @@ class swoole_hook_sqlite extends Extension
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n --ri "swoole"', false);
|
||||
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
||||
|
||||
@@ -18,7 +18,7 @@ class swow extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
public function getConfigureArg(): string
|
||||
public function getConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = '--enable-swow';
|
||||
$arg .= $this->builder->getLib('openssl') ? ' --enable-swow-ssl' : ' --disable-swow-ssl';
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('uv')]
|
||||
@@ -16,4 +17,13 @@ class uv extends Extension
|
||||
throw new \RuntimeException('The latest uv extension requires PHP 8.0 or later');
|
||||
}
|
||||
}
|
||||
|
||||
public function patchBeforeSharedMake(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY !== 'Linux' || arch2gnu(php_uname('m')) !== 'aarch64') {
|
||||
return false;
|
||||
}
|
||||
FileSystem::replaceFileRegex($this->source_dir . '/Makefile', '/^(LDFLAGS =.*)$/m', '$1 -luv -ldl -lrt -pthread');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('xdebug')]
|
||||
class xdebug extends Extension
|
||||
{
|
||||
public function runSharedExtensionCheckUnix(): void
|
||||
{
|
||||
[$ret] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -d "zend_extension=' . BUILD_LIB_PATH . '/xdebug.so" --ri xdebug');
|
||||
if ($ret !== 0) {
|
||||
throw new RuntimeException('xdebug.so failed to load.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('xlswriter')]
|
||||
@@ -18,4 +19,24 @@ class xlswriter extends Extension
|
||||
}
|
||||
return $arg;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--with-xlswriter';
|
||||
}
|
||||
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
// fix windows build with openssl extension duplicate symbol bug
|
||||
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->source_dir);
|
||||
$content = file_get_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c');
|
||||
$bom = pack('CCC', 0xEF, 0xBB, 0xBF);
|
||||
if (substr($content, 0, 3) !== $bom) {
|
||||
file_put_contents($this->source_dir . '/library/libxlsxwriter/src/theme.c', $bom . $content);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ use SPC\util\CustomExt;
|
||||
#[CustomExt('soap')]
|
||||
#[CustomExt('xmlreader')]
|
||||
#[CustomExt('xmlwriter')]
|
||||
#[CustomExt('dom')]
|
||||
#[CustomExt('simplexml')]
|
||||
class xml extends Extension
|
||||
{
|
||||
@@ -27,11 +26,10 @@ class xml extends Extension
|
||||
'soap' => '--enable-soap',
|
||||
'xmlreader' => '--enable-xmlreader',
|
||||
'xmlwriter' => '--enable-xmlwriter',
|
||||
'dom' => '--enable-dom',
|
||||
'simplexml' => '--enable-simplexml',
|
||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
||||
};
|
||||
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||
$arg .= ($shared ? '=shared' : '') . ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||
return $arg;
|
||||
}
|
||||
|
||||
@@ -41,14 +39,13 @@ class xml extends Extension
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getWindowsConfigureArg(): string
|
||||
public function getWindowsConfigureArg(bool $shared = false): string
|
||||
{
|
||||
$arg = match ($this->name) {
|
||||
'xml' => '--with-xml',
|
||||
'soap' => '--enable-soap',
|
||||
'xmlreader' => '--enable-xmlreader',
|
||||
'xmlwriter' => '--enable-xmlwriter',
|
||||
'dom' => '--with-dom',
|
||||
'simplexml' => '--with-simplexml',
|
||||
default => throw new RuntimeException('Not accept non-xml extension'),
|
||||
};
|
||||
|
||||
@@ -21,6 +21,6 @@ class yac extends Extension
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return '--enable-yac --enable-igbinary --enable-json';
|
||||
return '--enable-yac' . ($shared ? '=shared' : '') . ' --enable-igbinary --enable-json --with-system-fastlz';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,6 @@ class BSDBuilder extends UnixBuilderBase
|
||||
// cflags
|
||||
$this->arch_c_flags = SystemUtil::getArchCFlags($this->getOption('arch'));
|
||||
$this->arch_cxx_flags = SystemUtil::getArchCFlags($this->getOption('arch'));
|
||||
// cmake toolchain
|
||||
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile('BSD', $this->getOption('arch'), $this->arch_c_flags);
|
||||
|
||||
// create pkgconfig and include dir (some libs cannot create them automatically)
|
||||
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
|
||||
@@ -98,6 +96,7 @@ class BSDBuilder extends UnixBuilderBase
|
||||
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
||||
$enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
||||
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
||||
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
@@ -145,7 +144,14 @@ class BSDBuilder extends UnixBuilderBase
|
||||
}
|
||||
$this->buildEmbed();
|
||||
}
|
||||
if ($enableFrankenphp) {
|
||||
logger()->info('building frankenphp');
|
||||
$this->buildFrankenphp();
|
||||
}
|
||||
}
|
||||
|
||||
public function testPHP(int $build_target = BUILD_TARGET_NONE)
|
||||
{
|
||||
if (php_uname('m') === $this->getOption('arch')) {
|
||||
$this->emitPatchPoint('before-sanity-check');
|
||||
$this->sanityCheck($build_target);
|
||||
|
||||
@@ -10,9 +10,9 @@ class curl extends BSDLibraryBase
|
||||
|
||||
public const NAME = 'curl';
|
||||
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true): string
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true, bool $include_self = true): string
|
||||
{
|
||||
$libs = parent::getStaticLibFiles($style, $recursive);
|
||||
$libs = parent::getStaticLibFiles($style, $recursive, $include_self);
|
||||
if ($this->builder->getLib('openssl')) {
|
||||
$this->builder->setOption('extra-libs', $this->builder->getOption('extra-libs') . ' /usr/lib/libpthread.a /usr/lib/libdl.a');
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class openssl extends BSDLibraryBase
|
||||
$ex_lib = trim($zlib->getStaticLibFiles() . ' ' . $ex_lib);
|
||||
}
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
"./Configure no-shared {$extra} " .
|
||||
'--prefix=/ ' . // use prefix=/
|
||||
|
||||
12
src/SPC/builder/freebsd/library/watcher.php
Normal file
12
src/SPC/builder/freebsd/library/watcher.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\freebsd\library;
|
||||
|
||||
class watcher extends BSDLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\watcher;
|
||||
|
||||
public const NAME = 'watcher';
|
||||
}
|
||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux;
|
||||
|
||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||
use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
@@ -29,12 +28,11 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
// check musl-cross make installed if we use musl-cross-make
|
||||
$arch = arch2gnu(php_uname('m'));
|
||||
|
||||
GlobalEnvManager::init($this);
|
||||
GlobalEnvManager::init();
|
||||
|
||||
if (getenv('SPC_LIBC') === 'musl' && !SystemUtil::isMuslDist()) {
|
||||
$this->setOptionIfNotExist('library_path', "LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
|
||||
$this->setOptionIfNotExist('ld_library_path', "LD_LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\"");
|
||||
GlobalEnvManager::putenv("PATH=/usr/local/musl/bin:/usr/local/musl/{$arch}-linux-musl/bin:" . getenv('PATH'));
|
||||
$configure = getenv('SPC_CMD_PREFIX_PHP_CONFIGURE');
|
||||
$configure = "LD_LIBRARY_PATH=\"/usr/local/musl/{$arch}-linux-musl/lib\" " . $configure;
|
||||
GlobalEnvManager::putenv("SPC_CMD_PREFIX_PHP_CONFIGURE={$configure}");
|
||||
@@ -49,14 +47,6 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
// cflags
|
||||
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
||||
// cmake toolchain
|
||||
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile(
|
||||
'Linux',
|
||||
$arch,
|
||||
$this->arch_c_flags,
|
||||
getenv('CC'),
|
||||
getenv('CXX'),
|
||||
);
|
||||
|
||||
// cross-compiling is not supported yet
|
||||
/*if (php_uname('m') !== $this->arch) {
|
||||
@@ -70,32 +60,6 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function makeAutoconfArgs(string $name, array $libSpecs): string
|
||||
{
|
||||
$ret = '';
|
||||
foreach ($libSpecs as $libName => $arr) {
|
||||
$lib = $this->getLib($libName);
|
||||
|
||||
$arr = $arr ?? [];
|
||||
|
||||
$disableArgs = $arr[0] ?? null;
|
||||
$prefix = $arr[1] ?? null;
|
||||
if ($lib instanceof LinuxLibraryBase) {
|
||||
logger()->info("{$name} \033[32;1mwith\033[0;1m {$libName} support");
|
||||
$ret .= $lib->makeAutoconfEnv($prefix) . ' ';
|
||||
} else {
|
||||
logger()->info("{$name} \033[31;1mwithout\033[0;1m {$libName} support");
|
||||
$ret .= ($disableArgs ?? "--with-{$libName}=no") . ' ';
|
||||
}
|
||||
}
|
||||
return rtrim($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build PHP from source.
|
||||
*
|
||||
@@ -145,10 +109,11 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
$config_file_scan_dir = $this->getOption('with-config-file-scan-dir', false) ?
|
||||
('--with-config-file-scan-dir=' . $this->getOption('with-config-file-scan-dir') . ' ') : '';
|
||||
|
||||
$enable_cli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI;
|
||||
$enable_fpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
||||
$enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
||||
$enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
||||
$enableCli = ($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI;
|
||||
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
||||
$enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
||||
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
||||
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;
|
||||
|
||||
$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
|
||||
// prepare build php envs
|
||||
@@ -160,7 +125,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
]);
|
||||
|
||||
// process micro upx patch if micro sapi enabled
|
||||
if ($enable_micro) {
|
||||
if ($enableMicro) {
|
||||
if (version_compare($this->getMicroVersion(), '0.2.0') < 0) {
|
||||
// for phpmicro 0.1.x
|
||||
$this->processMicroUPXLegacy();
|
||||
@@ -172,10 +137,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(
|
||||
getenv('SPC_CMD_PREFIX_PHP_CONFIGURE') . ' ' .
|
||||
($enable_cli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enable_fpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
($enable_embed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||
($enable_micro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
||||
($enableCli ? '--enable-cli ' : '--disable-cli ') .
|
||||
($enableFpm ? '--enable-fpm ' . ($this->getLib('libacl') !== null ? '--with-fpm-acl ' : '') : '--disable-fpm ') .
|
||||
($enableEmbed ? "--enable-embed={$embed_type} " : '--disable-embed ') .
|
||||
($enableMicro ? '--enable-micro=all-static ' : '--disable-micro ') .
|
||||
$config_file_path .
|
||||
$config_file_scan_dir .
|
||||
$disable_jit .
|
||||
@@ -191,26 +156,33 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
|
||||
$this->cleanMake();
|
||||
|
||||
if ($enable_cli) {
|
||||
if ($enableCli) {
|
||||
logger()->info('building cli');
|
||||
$this->buildCli();
|
||||
}
|
||||
if ($enable_fpm) {
|
||||
if ($enableFpm) {
|
||||
logger()->info('building fpm');
|
||||
$this->buildFpm();
|
||||
}
|
||||
if ($enable_micro) {
|
||||
if ($enableMicro) {
|
||||
logger()->info('building micro');
|
||||
$this->buildMicro();
|
||||
}
|
||||
if ($enable_embed) {
|
||||
if ($enableEmbed) {
|
||||
logger()->info('building embed');
|
||||
if ($enable_micro) {
|
||||
if ($enableMicro) {
|
||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/Makefile', 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la');
|
||||
}
|
||||
$this->buildEmbed();
|
||||
}
|
||||
if ($enableFrankenphp) {
|
||||
logger()->info('building frankenphp');
|
||||
$this->buildFrankenphp();
|
||||
}
|
||||
}
|
||||
|
||||
public function testPHP(int $build_target = BUILD_TARGET_NONE)
|
||||
{
|
||||
$this->emitPatchPoint('before-sanity-check');
|
||||
$this->sanityCheck($build_target);
|
||||
}
|
||||
@@ -224,9 +196,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
protected function buildCli(): void
|
||||
{
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("\$SPC_CMD_PREFIX_PHP_MAKE {$vars} cli");
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
||||
|
||||
if ($this->getOption('with-upx-pack')) {
|
||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/cli')
|
||||
@@ -262,10 +235,11 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
// patch fake cli for micro
|
||||
$vars['EXTRA_CFLAGS'] .= $enable_fake_cli;
|
||||
$vars = SystemUtil::makeEnvVarString($vars);
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("\$SPC_CMD_PREFIX_PHP_MAKE {$vars} micro");
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} micro");
|
||||
|
||||
$this->processMicroUPX();
|
||||
|
||||
@@ -285,9 +259,10 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
protected function buildFpm(): void
|
||||
{
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec("\$SPC_CMD_PREFIX_PHP_MAKE {$vars} fpm");
|
||||
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} fpm");
|
||||
|
||||
if ($this->getOption('with-upx-pack')) {
|
||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/fpm')
|
||||
@@ -310,7 +285,38 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
||||
->exec('sed -i "s|^EXTENSION_DIR = .*|EXTENSION_DIR = /' . basename(BUILD_MODULES_PATH) . '|" Makefile')
|
||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
||||
|
||||
$ldflags = getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS');
|
||||
if (preg_match('/-release\s+(\S+)/', $ldflags, $matches)) {
|
||||
$release = $matches[1];
|
||||
$realLibName = 'libphp-' . $release . '.so';
|
||||
$realLib = BUILD_LIB_PATH . '/' . $realLibName;
|
||||
rename(BUILD_LIB_PATH . '/libphp.so', $realLib);
|
||||
$cwd = getcwd();
|
||||
chdir(BUILD_LIB_PATH);
|
||||
symlink($realLibName, 'libphp.so');
|
||||
chdir(BUILD_MODULES_PATH);
|
||||
foreach ($this->getExts() as $ext) {
|
||||
if (!$ext->isBuildShared()) {
|
||||
continue;
|
||||
}
|
||||
$name = $ext->getName();
|
||||
$versioned = "{$name}-{$release}.so";
|
||||
$unversioned = "{$name}.so";
|
||||
if (is_file(BUILD_MODULES_PATH . "/{$versioned}")) {
|
||||
rename(BUILD_MODULES_PATH . "/{$versioned}", BUILD_MODULES_PATH . "/{$unversioned}");
|
||||
shell()->cd(BUILD_MODULES_PATH)
|
||||
->exec(sprintf(
|
||||
'patchelf --set-soname %s %s',
|
||||
escapeshellarg($unversioned),
|
||||
escapeshellarg($unversioned)
|
||||
));
|
||||
}
|
||||
}
|
||||
chdir($cwd);
|
||||
}
|
||||
$this->patchPhpScripts();
|
||||
}
|
||||
|
||||
@@ -319,6 +325,7 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
return [
|
||||
'EXTRA_CFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS'),
|
||||
'EXTRA_LIBS' => getenv('SPC_EXTRA_LIBS') . ' ' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS'),
|
||||
'EXTRA_LDFLAGS' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'),
|
||||
'EXTRA_LDFLAGS_PROGRAM' => getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ class SystemUtil
|
||||
{
|
||||
use UnixSystemUtilTrait;
|
||||
|
||||
public static ?string $libc_version = null;
|
||||
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
public static function getOSRelease(): array
|
||||
{
|
||||
@@ -188,6 +190,9 @@ class SystemUtil
|
||||
*/
|
||||
public static function getLibcVersionIfExists(): ?string
|
||||
{
|
||||
if (self::$libc_version !== null) {
|
||||
return self::$libc_version;
|
||||
}
|
||||
if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'glibc') {
|
||||
$result = shell()->execWithResult('ldd --version', false);
|
||||
if ($result[0] !== 0) {
|
||||
@@ -198,7 +203,8 @@ class SystemUtil
|
||||
// match ldd version: "ldd (some useless text) 2.17" match 2.17
|
||||
$pattern = '/ldd\s+\(.*?\)\s+(\d+\.\d+)/';
|
||||
if (preg_match($pattern, $first_line, $matches)) {
|
||||
return $matches[1];
|
||||
self::$libc_version = $matches[1];
|
||||
return self::$libc_version;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -212,7 +218,8 @@ class SystemUtil
|
||||
// match ldd version: "Version 1.2.3" match 1.2.3
|
||||
$pattern = '/Version\s+(\d+\.\d+\.\d+)/';
|
||||
if (preg_match($pattern, $result[1][1] ?? '', $matches)) {
|
||||
return $matches[1];
|
||||
self::$libc_version = $matches[1];
|
||||
return self::$libc_version;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -10,9 +10,9 @@ class curl extends LinuxLibraryBase
|
||||
|
||||
public const NAME = 'curl';
|
||||
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true): string
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true, bool $include_self = true): string
|
||||
{
|
||||
$libs = parent::getStaticLibFiles($style, $recursive);
|
||||
$libs = parent::getStaticLibFiles($style, $recursive, $include_self);
|
||||
if ($this->builder->getLib('openssl')) {
|
||||
$libs .= ' -ldl -lpthread';
|
||||
}
|
||||
|
||||
12
src/SPC/builder/linux/library/fastlz.php
Normal file
12
src/SPC/builder/linux/library/fastlz.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class fastlz extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\fastlz;
|
||||
|
||||
public const NAME = 'fastlz';
|
||||
}
|
||||
@@ -14,10 +14,10 @@ class icu extends LinuxLibraryBase
|
||||
|
||||
protected function build(): void
|
||||
{
|
||||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -fPIC -fPIE -fno-ident"';
|
||||
$cxxflags = 'CXXFLAGS="-std=c++17"';
|
||||
$cppflags = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1 -DPIC -fPIC"';
|
||||
$cxxflags = 'CXXFLAGS="-std=c++17 -DPIC -fPIC -fno-ident"';
|
||||
$ldflags = getenv('SPC_LIBC') !== 'glibc' ? 'LDFLAGS="-static"' : '';
|
||||
shell()->cd($this->source_dir . '/source')
|
||||
shell()->cd($this->source_dir . '/source')->initializeEnv($this)
|
||||
->exec(
|
||||
"{$cppflags} {$cxxflags} {$ldflags} " .
|
||||
'./runConfigureICU Linux ' .
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libffi extends LinuxLibraryBase
|
||||
{
|
||||
@@ -17,23 +18,14 @@ class libffi extends LinuxLibraryBase
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
[$lib, , $destdir] = SEPARATED_PATH;
|
||||
$arch = getenv('SPC_ARCH');
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||
->execWithEnv(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
"--host={$arch}-unknown-linux " .
|
||||
"--target={$arch}-unknown-linux " .
|
||||
'--prefix= ' .
|
||||
"--libdir={$lib}"
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->configure(
|
||||
"--host={$arch}-unknown-linux",
|
||||
"--target={$arch}-unknown-linux",
|
||||
"--libdir={$this->getLibDir()}"
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency}")
|
||||
->execWithEnv("make install DESTDIR={$destdir}");
|
||||
->make();
|
||||
|
||||
if (is_file(BUILD_ROOT_PATH . '/lib64/libffi.a')) {
|
||||
copy(BUILD_ROOT_PATH . '/lib64/libffi.a', BUILD_ROOT_PATH . '/lib/libffi.a');
|
||||
|
||||
@@ -4,17 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
class libmemcached extends LinuxLibraryBase
|
||||
{
|
||||
public const NAME = 'libmemcached';
|
||||
|
||||
public function build()
|
||||
public function build(): void
|
||||
{
|
||||
throw new RuntimeException('libmemcached is currently not supported on Linux platform');
|
||||
UnixCMakeExecutor::create($this)->build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace SPC\builder\linux\library;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libpng extends LinuxLibraryBase
|
||||
{
|
||||
@@ -36,33 +37,22 @@ class libpng extends LinuxLibraryBase
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
$optimizations = match (getenv('SPC_ARCH')) {
|
||||
'x86_64' => '--enable-intel-sse ',
|
||||
'aarch64' => '--enable-arm-neon ',
|
||||
default => '',
|
||||
};
|
||||
shell()->cd($this->source_dir)
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->exec('chmod +x ./configure')
|
||||
->exec('chmod +x ./install-sh')
|
||||
->setEnv([
|
||||
'CFLAGS' => trim($this->getLibExtraCFlags() . ' ' . $this->builder->arch_c_flags),
|
||||
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
||||
'LIBS' => $this->getLibExtraLibs(),
|
||||
])
|
||||
->execWithEnv(
|
||||
'LDFLAGS="-L' . BUILD_LIB_PATH . '" ' .
|
||||
'./configure ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-static ' .
|
||||
'--enable-hardware-optimizations ' .
|
||||
'--with-zlib-prefix="' . BUILD_ROOT_PATH . '" ' .
|
||||
$optimizations .
|
||||
'--prefix='
|
||||
->appendEnv(['LDFLAGS' => "-L{$this->getLibDir()}"])
|
||||
->configure(
|
||||
'--enable-hardware-optimizations',
|
||||
"--with-zlib-prefix={$this->getBuildRootPath()}",
|
||||
match (getenv('SPC_ARCH')) {
|
||||
'x86_64' => '--enable-intel-sse',
|
||||
'aarch64' => '--enable-arm-neon',
|
||||
default => '',
|
||||
}
|
||||
)
|
||||
->execWithEnv('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I{$this->source_dir} -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
|
||||
->execWithEnv('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH);
|
||||
->make('libpng16.la', 'install-libLTLIBRARIES install-data-am', after_env_vars: ['DEFAULT_INCLUDES' => "-I{$this->source_dir} -I{$this->getIncludeDir()}"]);
|
||||
|
||||
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
|
||||
$this->cleanLaFiles();
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,50 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class libxml2 extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libxml2;
|
||||
|
||||
public const NAME = 'libxml2';
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
$enable_zlib = $this->builder->getLib('zlib') ? ('ON -DZLIB_LIBRARY=' . BUILD_LIB_PATH . '/libz.a -DZLIB_INCLUDE_DIR=' . BUILD_INCLUDE_PATH) : 'OFF';
|
||||
$enable_icu = $this->builder->getLib('icu') ? 'ON' : 'OFF';
|
||||
$enable_xz = $this->builder->getLib('xz') ? 'ON' : 'OFF';
|
||||
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec(
|
||||
'cmake ' .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||
'-DCMAKE_INSTALL_LIBDIR=' . BUILD_LIB_PATH . ' ' .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DIconv_IS_BUILT_IN=OFF ' .
|
||||
'-DLIBXML2_WITH_ICONV=ON ' .
|
||||
"-DLIBXML2_WITH_ZLIB={$enable_zlib} " .
|
||||
"-DLIBXML2_WITH_ICU={$enable_icu} " .
|
||||
"-DLIBXML2_WITH_LZMA={$enable_xz} " .
|
||||
'-DLIBXML2_WITH_PYTHON=OFF ' .
|
||||
'-DLIBXML2_WITH_PROGRAMS=OFF ' .
|
||||
'-DLIBXML2_WITH_TESTS=OFF ' .
|
||||
'..'
|
||||
)
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
|
||||
FileSystem::replaceFileStr(
|
||||
BUILD_LIB_PATH . '/pkgconfig/libxml-2.0.pc',
|
||||
'-licudata -licui18n -licuuc',
|
||||
'-licui18n -licuuc -licudata'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
12
src/SPC/builder/linux/library/nghttp3.php
Normal file
12
src/SPC/builder/linux/library/nghttp3.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class nghttp3 extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\nghttp3;
|
||||
|
||||
public const NAME = 'nghttp3';
|
||||
}
|
||||
12
src/SPC/builder/linux/library/ngtcp2.php
Normal file
12
src/SPC/builder/linux/library/ngtcp2.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class ngtcp2 extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\ngtcp2;
|
||||
|
||||
public const NAME = 'ngtcp2';
|
||||
}
|
||||
@@ -64,9 +64,8 @@ class openssl extends LinuxLibraryBase
|
||||
|
||||
$clang_postfix = SystemUtil::getCCType(getenv('CC')) === 'clang' ? '-clang' : '';
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags() ?: $this->builder->arch_c_flags, 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||
->execWithEnv(
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
"{$env} ./Configure no-shared {$extra} " .
|
||||
'--prefix=/ ' .
|
||||
'--libdir=lib ' .
|
||||
@@ -76,7 +75,7 @@ class openssl extends LinuxLibraryBase
|
||||
"linux-{$arch}{$clang_postfix}"
|
||||
)
|
||||
->exec('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency} CNF_EX_LIBS=\"{$ex_lib}\"")
|
||||
->exec("make -j{$this->builder->concurrency} CNF_EX_LIBS=\"{$ex_lib}\"")
|
||||
->exec("make install_sw DESTDIR={$destdir}");
|
||||
$this->patchPkgconfPrefix(['libssl.pc', 'openssl.pc', 'libcrypto.pc']);
|
||||
// patch for openssl 3.3.0+
|
||||
@@ -92,4 +91,13 @@ class openssl extends LinuxLibraryBase
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/pkgconfig/libcrypto.pc', '/Libs.private:.*/m', 'Libs.private: ${libdir}/libz.a');
|
||||
FileSystem::replaceFileRegex(BUILD_LIB_PATH . '/cmake/OpenSSL/OpenSSLConfig.cmake', '/set\(OPENSSL_LIBCRYPTO_DEPENDENCIES .*\)/m', 'set(OPENSSL_LIBCRYPTO_DEPENDENCIES "${OPENSSL_LIBRARY_DIR}/libz.a")');
|
||||
}
|
||||
|
||||
public function getStaticLibFiles(string $style = 'autoconf', bool $recursive = true, bool $include_self = true): string
|
||||
{
|
||||
$libFiles = parent::getStaticLibFiles($style, $recursive, $include_self);
|
||||
if (!str_contains('-ldl -lpthread', $libFiles)) {
|
||||
$libFiles .= ' -ldl -lpthread';
|
||||
}
|
||||
return $libFiles;
|
||||
}
|
||||
}
|
||||
|
||||
12
src/SPC/builder/linux/library/watcher.php
Normal file
12
src/SPC/builder/linux/library/watcher.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class watcher extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\watcher;
|
||||
|
||||
public const NAME = 'watcher';
|
||||
}
|
||||
@@ -28,7 +28,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$this->options = $options;
|
||||
|
||||
// apply global environment variables
|
||||
GlobalEnvManager::init($this);
|
||||
GlobalEnvManager::init();
|
||||
|
||||
// ---------- set necessary compile vars ----------
|
||||
// concurrency
|
||||
@@ -36,40 +36,12 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
// cflags
|
||||
$this->arch_c_flags = getenv('SPC_DEFAULT_C_FLAGS');
|
||||
$this->arch_cxx_flags = getenv('SPC_DEFAULT_CXX_FLAGS');
|
||||
// cmake toolchain
|
||||
$this->cmake_toolchain_file = SystemUtil::makeCmakeToolchainFile('Darwin', getenv('SPC_ARCH'), $this->arch_c_flags);
|
||||
|
||||
// create pkgconfig and include dir (some libs cannot create them automatically)
|
||||
f_mkdir(BUILD_LIB_PATH . '/pkgconfig', recursive: true);
|
||||
f_mkdir(BUILD_INCLUDE_PATH, recursive: true);
|
||||
}
|
||||
|
||||
/**
|
||||
* [deprecated] 生成库构建采用的 autoconf 参数列表
|
||||
*
|
||||
* @param string $name 要构建的 lib 库名,传入仅供输出日志
|
||||
* @param array $lib_specs 依赖的 lib 库的 autoconf 文件
|
||||
*/
|
||||
public function makeAutoconfArgs(string $name, array $lib_specs): string
|
||||
{
|
||||
$ret = '';
|
||||
foreach ($lib_specs as $libName => $arr) {
|
||||
$lib = $this->getLib($libName);
|
||||
|
||||
$arr = $arr ?? [];
|
||||
|
||||
$disableArgs = $arr[0] ?? null;
|
||||
if ($lib instanceof MacOSLibraryBase) {
|
||||
logger()->info("{$name} \033[32;1mwith\033[0;1m {$libName} support");
|
||||
$ret .= '--with-' . $libName . '=yes ';
|
||||
} else {
|
||||
logger()->info("{$name} \033[31;1mwithout\033[0;1m {$libName} support");
|
||||
$ret .= ($disableArgs ?? "--with-{$libName}=no") . ' ';
|
||||
}
|
||||
}
|
||||
return rtrim($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dynamically linked macOS frameworks
|
||||
*
|
||||
@@ -95,6 +67,10 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
array_push($frameworks, ...$lib->getFrameworks());
|
||||
}
|
||||
|
||||
foreach ($this->exts as $ext) {
|
||||
array_push($frameworks, ...$ext->getFrameworks());
|
||||
}
|
||||
|
||||
if ($asString) {
|
||||
return implode(' ', array_map(fn ($x) => "-framework {$x}", $frameworks));
|
||||
}
|
||||
@@ -146,6 +122,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$enableFpm = ($build_target & BUILD_TARGET_FPM) === BUILD_TARGET_FPM;
|
||||
$enableMicro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
|
||||
$enableEmbed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
|
||||
$enableFrankenphp = ($build_target & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP;
|
||||
|
||||
// prepare build php envs
|
||||
$mimallocLibs = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
|
||||
@@ -204,7 +181,14 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
}
|
||||
$this->buildEmbed();
|
||||
}
|
||||
if ($enableFrankenphp) {
|
||||
logger()->info('building frankenphp');
|
||||
$this->buildFrankenphp();
|
||||
}
|
||||
}
|
||||
|
||||
public function testPHP(int $build_target = BUILD_TARGET_NONE)
|
||||
{
|
||||
$this->emitPatchPoint('before-sanity-check');
|
||||
$this->sanityCheck($build_target);
|
||||
}
|
||||
@@ -220,9 +204,10 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
$shell->exec("\$SPC_CMD_PREFIX_PHP_MAKE {$vars} cli");
|
||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||
$shell->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip sapi/cli/php');
|
||||
$shell->exec('dsymutil -f sapi/cli/php')->exec('strip -S sapi/cli/php');
|
||||
}
|
||||
$this->deployBinary(BUILD_TARGET_CLI);
|
||||
}
|
||||
@@ -249,12 +234,15 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
|
||||
// patch fake cli for micro
|
||||
$vars['EXTRA_CFLAGS'] .= $enable_fake_cli;
|
||||
if ($this->getOption('no-strip', false)) {
|
||||
$vars['STRIP'] = 'dsymutil -f ';
|
||||
}
|
||||
$vars = SystemUtil::makeEnvVarString($vars);
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} micro");
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
// build
|
||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} micro");
|
||||
// strip
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/micro/micro.sfx')->exec('strip -S sapi/micro/micro.sfx');
|
||||
}
|
||||
|
||||
$this->deployBinary(BUILD_TARGET_MICRO);
|
||||
|
||||
@@ -276,7 +264,7 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$shell = shell()->cd(SOURCE_PATH . '/php-src');
|
||||
$shell->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . " {$vars} fpm");
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip sapi/fpm/php-fpm');
|
||||
$shell->exec('dsymutil -f sapi/fpm/php-fpm')->exec('strip -S sapi/fpm/php-fpm');
|
||||
}
|
||||
$this->deployBinary(BUILD_TARGET_FPM);
|
||||
}
|
||||
@@ -291,15 +279,12 @@ class MacOSBuilder extends UnixBuilderBase
|
||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install")
|
||||
// Workaround for https://github.com/php/php-src/issues/12082
|
||||
->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o')
|
||||
->exec('mkdir ' . BUILD_ROOT_PATH . '/lib/php-o')
|
||||
->cd(BUILD_ROOT_PATH . '/lib/php-o')
|
||||
->exec('ar x ' . BUILD_ROOT_PATH . '/lib/libphp.a')
|
||||
->exec('rm ' . BUILD_ROOT_PATH . '/lib/libphp.a')
|
||||
->exec('ar rcs ' . BUILD_ROOT_PATH . '/lib/libphp.a *.o')
|
||||
->exec('rm -Rf ' . BUILD_ROOT_PATH . '/lib/php-o');
|
||||
->exec(getenv('SPC_CMD_PREFIX_PHP_MAKE') . ' INSTALL_ROOT=' . BUILD_ROOT_PATH . " {$vars} install");
|
||||
|
||||
if (getenv('SPC_CMD_VAR_PHP_EMBED_TYPE') === 'static') {
|
||||
shell()->cd(SOURCE_PATH . '/php-src')
|
||||
->exec('ar -t ' . BUILD_LIB_PATH . "/libphp.a | grep '\\.a$' | xargs -n1 ar d " . BUILD_LIB_PATH . '/libphp.a');
|
||||
}
|
||||
$this->patchPhpScripts();
|
||||
}
|
||||
|
||||
|
||||
12
src/SPC/builder/macos/library/fastlz.php
Normal file
12
src/SPC/builder/macos/library/fastlz.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class fastlz extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\fastlz;
|
||||
|
||||
public const NAME = 'fastlz';
|
||||
}
|
||||
@@ -6,6 +6,7 @@ namespace SPC\builder\macos\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
class glfw extends MacOSLibraryBase
|
||||
{
|
||||
@@ -17,11 +18,14 @@ class glfw extends MacOSLibraryBase
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
// compile!
|
||||
shell()->cd(SOURCE_PATH . '/ext-glfw/vendor/glfw')
|
||||
->exec("cmake . {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF")
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
UnixCMakeExecutor::create($this)
|
||||
->setBuildDir("{$this->source_dir}/vendor/glfw")
|
||||
->setReset(false)
|
||||
->addConfigureArgs(
|
||||
'-DGLFW_BUILD_EXAMPLES=OFF',
|
||||
'-DGLFW_BUILD_TESTS=OFF',
|
||||
)
|
||||
->build('.');
|
||||
// patch pkgconf
|
||||
$this->patchPkgconfPrefix(['glfw3.pc']);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace SPC\builder\macos\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libffi extends MacOSLibraryBase
|
||||
{
|
||||
@@ -17,20 +18,13 @@ class libffi extends MacOSLibraryBase
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
[, , $destdir] = SEPARATED_PATH;
|
||||
$arch = getenv('SPC_ARCH');
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static ' .
|
||||
'--disable-shared ' .
|
||||
"--host={$arch}-apple-darwin " .
|
||||
"--target={$arch}-apple-darwin " .
|
||||
'--prefix= ' // use prefix=/
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->configure(
|
||||
"--host={$arch}-apple-darwin",
|
||||
"--target={$arch}-apple-darwin",
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec("make install DESTDIR={$destdir}");
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['libffi.pc']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,24 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class libheif extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libheif;
|
||||
|
||||
public const NAME = 'libheif';
|
||||
|
||||
public function patchBeforeBuild(): bool
|
||||
{
|
||||
if (!str_contains(file_get_contents($this->source_dir . '/CMakeLists.txt'), 'libbrotlienc')) {
|
||||
FileSystem::replaceFileStr(
|
||||
$this->source_dir . '/CMakeLists.txt',
|
||||
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")',
|
||||
'list(APPEND REQUIRES_PRIVATE "libbrotlidec")' . "\n" . ' list(APPEND REQUIRES_PRIVATE "libbrotlienc")'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,28 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* gmp is a template library class for unix
|
||||
*/
|
||||
use SPC\util\executor\UnixCMakeExecutor;
|
||||
|
||||
class libmemcached extends MacOSLibraryBase
|
||||
{
|
||||
public const NAME = 'libmemcached';
|
||||
|
||||
public function build(): void
|
||||
{
|
||||
$rootdir = BUILD_ROOT_PATH;
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->exec('chmod +x configure')
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--enable-static --disable-shared ' .
|
||||
'--disable-sasl ' .
|
||||
"--prefix={$rootdir}"
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec('sed -ie "s/-Werror//g" ' . $this->source_dir . '/Makefile')
|
||||
->exec("make -j{$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
UnixCMakeExecutor::create($this)->build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace SPC\builder\macos\library;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\util\executor\UnixAutoconfExecutor;
|
||||
|
||||
class libpng extends MacOSLibraryBase
|
||||
{
|
||||
@@ -36,29 +37,25 @@ class libpng extends MacOSLibraryBase
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$optimizations = match (php_uname('m')) {
|
||||
'x86_64' => '--enable-intel-sse ',
|
||||
'arm64' => '--enable-arm-neon ',
|
||||
default => '',
|
||||
};
|
||||
shell()->cd($this->source_dir)
|
||||
$arch = arch2gnu(php_uname('m'));
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->exec('chmod +x ./configure')
|
||||
->exec('chmod +x ./install-sh')
|
||||
->exec(
|
||||
'./configure ' .
|
||||
'--host=' . arch2gnu(php_uname('m')) . '-apple-darwin ' .
|
||||
'--disable-shared ' .
|
||||
'--enable-static ' .
|
||||
'--enable-hardware-optimizations ' .
|
||||
$optimizations .
|
||||
'--prefix='
|
||||
->appendEnv(['LDFLAGS' => "-L{$this->getLibDir()}"])
|
||||
->configure(
|
||||
"--host={$arch}-apple-darwin",
|
||||
'--enable-hardware-optimizations',
|
||||
"--with-zlib-prefix={$this->getBuildRootPath()}",
|
||||
match (getenv('SPC_ARCH')) {
|
||||
'x86_64' => '--enable-intel-sse',
|
||||
'aarch64' => '--enable-arm-neon',
|
||||
default => '',
|
||||
}
|
||||
)
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency} DEFAULT_INCLUDES='-I. -I" . BUILD_INCLUDE_PATH . "' LIBS= libpng16.la")
|
||||
->exec('make install-libLTLIBRARIES install-data-am DESTDIR=' . BUILD_ROOT_PATH)
|
||||
->cd(BUILD_LIB_PATH)
|
||||
->exec('ln -sf libpng16.a libpng.a');
|
||||
->make('libpng16.la', 'install-libLTLIBRARIES install-data-am', after_env_vars: ['DEFAULT_INCLUDES' => "-I{$this->source_dir} -I{$this->getIncludeDir()}"]);
|
||||
|
||||
shell()->cd(BUILD_LIB_PATH)->exec('ln -sf libpng16.a libpng.a');
|
||||
$this->patchPkgconfPrefix(['libpng16.pc'], PKGCONF_PATCH_PREFIX);
|
||||
$this->cleanLaFiles();
|
||||
$this->patchLaDependencyPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,44 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
class libxml2 extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\libxml2;
|
||||
|
||||
public const NAME = 'libxml2';
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
$enable_zlib = $this->builder->getLib('zlib') ? ('ON -DZLIB_LIBRARY=' . BUILD_LIB_PATH . '/libz.a -DZLIB_INCLUDE_DIR=' . BUILD_INCLUDE_PATH) : 'OFF';
|
||||
$enable_icu = $this->builder->getLib('icu') ? 'ON' : 'OFF';
|
||||
$enable_xz = $this->builder->getLib('xz') ? 'ON' : 'OFF';
|
||||
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
shell()->cd($this->source_dir . '/build')
|
||||
->exec(
|
||||
'cmake ' .
|
||||
// '--debug-find ' .
|
||||
'-DCMAKE_BUILD_TYPE=Release ' .
|
||||
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
|
||||
'-DCMAKE_INSTALL_LIBDIR=' . BUILD_LIB_PATH . ' ' .
|
||||
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
|
||||
'-DBUILD_SHARED_LIBS=OFF ' .
|
||||
'-DLIBXML2_WITH_ICONV=ON ' .
|
||||
"-DLIBXML2_WITH_ZLIB={$enable_zlib} " .
|
||||
"-DLIBXML2_WITH_ICU={$enable_icu} " .
|
||||
"-DLIBXML2_WITH_LZMA={$enable_xz} " .
|
||||
'-DLIBXML2_WITH_PYTHON=OFF ' .
|
||||
'-DLIBXML2_WITH_PROGRAMS=OFF ' .
|
||||
'-DLIBXML2_WITH_TESTS=OFF ' .
|
||||
'..'
|
||||
)
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec('make install');
|
||||
}
|
||||
}
|
||||
|
||||
12
src/SPC/builder/macos/library/nghttp3.php
Normal file
12
src/SPC/builder/macos/library/nghttp3.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class nghttp3 extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\nghttp3;
|
||||
|
||||
public const NAME = 'nghttp3';
|
||||
}
|
||||
12
src/SPC/builder/macos/library/ngtcp2.php
Normal file
12
src/SPC/builder/macos/library/ngtcp2.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class ngtcp2 extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\ngtcp2;
|
||||
|
||||
public const NAME = 'ngtcp2';
|
||||
}
|
||||
@@ -49,8 +49,7 @@ class openssl extends MacOSLibraryBase
|
||||
}
|
||||
$arch = getenv('SPC_ARCH');
|
||||
|
||||
shell()->cd($this->source_dir)
|
||||
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
|
||||
shell()->cd($this->source_dir)->initializeEnv($this)
|
||||
->exec(
|
||||
"./Configure no-shared {$extra} " .
|
||||
'--prefix=/ ' . // use prefix=/
|
||||
@@ -59,7 +58,7 @@ class openssl extends MacOSLibraryBase
|
||||
"darwin64-{$arch}-cc"
|
||||
)
|
||||
->exec('make clean')
|
||||
->execWithEnv("make -j{$this->builder->concurrency} CNF_EX_LIBS=\"{$ex_lib}\"")
|
||||
->exec("make -j{$this->builder->concurrency} CNF_EX_LIBS=\"{$ex_lib}\"")
|
||||
->exec("make install_sw DESTDIR={$destdir}");
|
||||
$this->patchPkgconfPrefix(['libssl.pc', 'openssl.pc', 'libcrypto.pc']);
|
||||
// patch for openssl 3.3.0+
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user