Compare commits

...

316 Commits
2.5.2 ... 2.6.0

Author SHA1 Message Date
Jerry Ma
d9cd4d7e36 Update version to 2.6.0 2025-06-12 13:16:45 +08:00
Marc
56080f40ef Merge pull request #763 from crazywhalecc/docs
update documentation for glibc
2025-06-12 12:12:26 +07:00
Marc
bb0a3589c1 Merge pull request #760 from lyrixx/better-exception
Better exception
2025-06-12 12:10:20 +07:00
DubbleClick
db109e3586 update documentation for glibc 2025-06-12 12:07:48 +07:00
Marc
289f4b300a Merge pull request #726 from crazywhalecc/fix/icurel
Fix PIC errors when building libphp.so | extensive extension building rework
2025-06-12 11:48:33 +07:00
DubbleClick
0ee9a0cfa4 oops, don't pass -fpic to CPPflags, I misread it as CXXflags 2025-06-12 11:45:47 +07:00
DubbleClick
d9f7aa760e update default env (shouldn't we pass -fpic to default c flags on macos?) 2025-06-12 11:40:32 +07:00
DubbleClick
01ab0d3530 update default flags 2025-06-12 11:01:05 +07:00
Jerry Ma
8bd7794a2e Add -v compatibility for command 2025-06-12 11:57:42 +08:00
DubbleClick
fcfbb59637 fix phpstan 2025-06-12 10:48:15 +07:00
DubbleClick
089b94d753 add fastlz, libmemcached for linux 2025-06-12 10:46:35 +07:00
crazywhalecc
bfba598ef4 Fix glfw source path 2025-06-12 10:58:58 +08:00
DubbleClick
e2efaab2b2 fix attempted ar deletions when building shared libphp 2025-06-12 08:18:32 +07:00
crazywhalecc
28e5e584b4 Revert ext-matrix-tests and test-extensions 2025-06-12 01:20:02 +08:00
crazywhalecc
e0734fe848 Add frameworks for extension 2025-06-12 01:16:57 +08:00
crazywhalecc
2ea8a7e662 Fix macOS embed re-archive bug 2025-06-12 01:16:30 +08:00
crazywhalecc
c0ea47ce75 I really got redundant test error 2025-06-12 00:41:33 +08:00
DubbleClick
84fb354bc0 this is not needed anymore 2025-06-11 22:46:22 +07:00
DubbleClick
9f35c954ac cs fix 2025-06-11 22:45:08 +07:00
DubbleClick
78b3778442 err 2025-06-11 22:43:51 +07:00
DubbleClick
0e092284eb err 2025-06-11 22:43:41 +07:00
DubbleClick
4be1e75128 dirty as fuck, I don't understand why AMQP_SHARED_LIBADD is not available in ./configure 2025-06-11 22:41:55 +07:00
DubbleClick
62a581393d compatibility with RHEL 10? 2025-06-11 21:55:08 +07:00
crazywhalecc
cec5274ea3 Re-test 2025-06-11 22:42:26 +08:00
crazywhalecc
80f2912026 Fix rdkafka with zstd build failed bug, reset test-extensions 2025-06-11 22:40:43 +08:00
crazywhalecc
70b91867cb Lets' fuzz it 2025-06-11 21:37:00 +08:00
crazywhalecc
a1ccddb53c Test macOS 15 for all php version 2025-06-11 20:57:43 +08:00
Grégoire Pineau
5a7db86471 Better exception 2025-06-11 14:20:24 +02:00
DubbleClick
518ed3a7fd don't add -lomp on macos (not required) 2025-06-11 15:38:43 +07:00
DubbleClick
d322be1666 err, add it back in 2025-06-11 15:02:07 +07:00
DubbleClick
a503aaa8a0 -lomp on macos 2025-06-11 15:01:16 +07:00
DubbleClick
a7771e95f2 enable musl too 2025-06-11 13:49:38 +07:00
DubbleClick
311de9381c fix gomp error 2025-06-11 13:47:32 +07:00
DubbleClick
c3aa7356ec update tests to all static 2025-06-11 11:43:00 +07:00
DubbleClick
63656cf383 cs fixer, of course 2025-06-10 19:58:25 +07:00
DubbleClick
6d3e2d9316 revert extension tests 2025-06-10 19:57:31 +07:00
DubbleClick
dcdd167db3 Merge remote-tracking branch 'origin/fix/icurel' into fix/icurel
# Conflicts:
#	src/SPC/builder/unix/library/gettext.php
#	src/SPC/builder/unix/library/libiconv.php
#	src/SPC/builder/unix/library/libxslt.php
2025-06-10 19:48:22 +07:00
DubbleClick
9ed62b02b6 make patchLaDependencyPrefix argument optional, remove cleanLaFiles 2025-06-10 19:46:55 +07:00
crazywhalecc
145fe7ce13 Remove curl libbrotli patches 2025-06-10 17:17:46 +08:00
crazywhalecc
b320eb853a Rename ignoreConfigureArgs to removeConfigureArgs 2025-06-10 17:17:46 +08:00
crazywhalecc
474fe63ad3 Add optional lib log 2025-06-10 17:17:46 +08:00
crazywhalecc
da45aa7f15 Fix ngtcp2 and libheif build missing lib bug 2025-06-10 17:17:46 +08:00
crazywhalecc
11f21304f9 Fix libxslt lib compile bug 2025-06-10 17:17:46 +08:00
crazywhalecc
6cb2cdd5a2 Add ignoreConfigureArgs for UnixAutoconfExecutor 2025-06-10 17:17:46 +08:00
crazywhalecc
9e8119e69c Fix ldap build 2025-06-10 17:17:46 +08:00
crazywhalecc
25c2bafa88 Fix brotlienc pkgconfig patching 2025-06-10 17:17:46 +08:00
crazywhalecc
ae56bed032 Fix ncurses build 2025-06-10 17:17:46 +08:00
crazywhalecc
4c8f9e154d Remove attr and libacl tests 2025-06-10 17:17:46 +08:00
crazywhalecc
0ed6f2924e Add tests for autoconf libs 2025-06-10 17:17:46 +08:00
crazywhalecc
8896d477aa Add tests for autoconf libs 2025-06-10 17:17:46 +08:00
crazywhalecc
1b08a250f6 Add --enable-pic for default autoconf args 2025-06-10 17:17:46 +08:00
crazywhalecc
8b09e1a446 Fix zlib autoconf builder 2025-06-10 17:17:46 +08:00
crazywhalecc
720251458f Add autoconf executor 2025-06-10 17:17:46 +08:00
crazywhalecc
a48680c26f Use tar gzip for windows 2025-06-09 19:33:10 +08:00
DubbleClick
684b5d4534 remove alpine tests for now https://github.com/php/php-src/pull/18779 2025-06-09 16:16:54 +07:00
DubbleClick
aedcc86fc5 fix cmake minimum version for libtidy 2025-06-09 15:52:17 +07:00
DubbleClick
978975d396 import class 2025-06-09 14:54:58 +07:00
DubbleClick
c9e9119bff remove gd from static extension test 2025-06-09 14:48:42 +07:00
DubbleClick
20f222d19e post merge fixes 2025-06-09 14:48:05 +07:00
DubbleClick
187d51e501 -DPOSITION_INDEPENDENT_CODE=ON for cmake 2025-06-09 14:41:14 +07:00
DubbleClick
fa744bb802 merge cmake changes from master into icurel 2025-06-09 14:38:45 +07:00
Jerry Ma
bed5b9d4ef Merge pull request #751 from crazywhalecc/shell-improvement
Extract default build env to unix shell
2025-06-09 13:37:12 +08:00
crazywhalecc
13540c8008 Remove shared tidy 2025-06-09 13:08:28 +08:00
crazywhalecc
48df491c31 Fix brotli build on macOS 2025-06-09 13:00:43 +08:00
crazywhalecc
3fbf8fcfb8 Merge branch 'main' into shell-improvement 2025-06-09 12:51:00 +08:00
Jerry Ma
104038bc7e Merge pull request #752 from crazywhalecc/cmake-test
Trigger tests
2025-06-09 12:50:32 +08:00
crazywhalecc
bb37c0058e Fix CMake related options 2025-06-09 12:49:33 +08:00
crazywhalecc
f4e1d7d4c1 Trigger tests 2025-06-09 12:37:50 +08:00
crazywhalecc
e6c9a82cd3 Fix gitignore 2025-06-09 12:14:25 +08:00
crazywhalecc
0ca71b62db Fix gitignore 2025-06-09 12:13:14 +08:00
crazywhalecc
936c4d8696 Change env string inject order 2025-06-09 12:12:22 +08:00
crazywhalecc
1c1f7b19dd Add XXX_CXXFLAGS for common build 2025-06-09 11:13:54 +08:00
crazywhalecc
0558d67240 Rename initBuildEnv to initializeEnv 2025-06-09 11:12:34 +08:00
Jerry Ma
3bb9a7b1f8 Feat: UnixCMakeExecutor (#750)
* Add cmake executor and default library path var wrapper

* Add cmake tool functions

* Use cmake executor instead of raw command

* Fix UnixCMakeExecutor.php missing return

* Fix UnixCMakeExecutor.php

* Refactor remaining cmake libs

* Add reset function

* Remove unused cmake things

* Remove unused cmake things

* Whoops

* Update src/SPC/builder/unix/library/libzip.php

Co-authored-by: Marc <m@pyc.ac>

* Update src/SPC/builder/unix/library/libzip.php

Co-authored-by: Marc <m@pyc.ac>

* For tomorrow windows executor, move it

* Rename setCMakeBuildDir to setBuildDir

---------

Co-authored-by: Marc <m@pyc.ac>
2025-06-09 11:09:41 +08:00
crazywhalecc
123cc92756 Extract default build env to unix shell 2025-06-09 10:24:06 +08:00
crazywhalecc
9babe7f1d2 Rename setCMakeBuildDir to setBuildDir 2025-06-09 09:26:39 +08:00
crazywhalecc
f46b714990 For tomorrow windows executor, move it 2025-06-09 09:24:31 +08:00
Jerry Ma
3497b2a760 Update src/SPC/builder/unix/library/libzip.php
Co-authored-by: Marc <m@pyc.ac>
2025-06-09 09:17:11 +08:00
Jerry Ma
acd10bd978 Update src/SPC/builder/unix/library/libzip.php
Co-authored-by: Marc <m@pyc.ac>
2025-06-09 09:17:04 +08:00
crazywhalecc
802950d941 Whoops 2025-06-09 01:52:23 +08:00
crazywhalecc
f158fba48d Remove unused cmake things 2025-06-09 01:48:48 +08:00
crazywhalecc
059d134990 Remove unused cmake things 2025-06-09 01:34:32 +08:00
crazywhalecc
f7871c0036 Add reset function 2025-06-09 01:33:21 +08:00
crazywhalecc
42943b315c Refactor remaining cmake libs 2025-06-09 01:33:06 +08:00
crazywhalecc
37b9ccfaa8 Fix UnixCMakeExecutor.php 2025-06-09 01:15:48 +08:00
crazywhalecc
1cf2a3dd3f Fix UnixCMakeExecutor.php missing return 2025-06-09 01:08:24 +08:00
crazywhalecc
1718806042 Use cmake executor instead of raw command 2025-06-09 01:07:30 +08:00
crazywhalecc
7d26aa533a Add cmake tool functions 2025-06-09 00:34:25 +08:00
crazywhalecc
521af84797 Add cmake executor and default library path var wrapper 2025-06-09 00:16:18 +08:00
DubbleClick
53eb6dcc80 cs fix hook isn't working on windows 2025-06-08 14:49:06 +07:00
DubbleClick
6ed440d861 refactor out method to get static and shared libraries 2025-06-08 14:45:09 +07:00
DubbleClick
a99c4a3fee remove getLibFilesString from Extension buildUnixShared 2025-06-08 08:13:03 +07:00
DubbleClick
0ebd44bc4f bring back zstd cmake flags 2025-06-07 23:19:32 +07:00
DubbleClick
2f53915064 fix ldap for postgresql 2025-06-07 23:00:26 +07:00
DubbleClick
08d3849c43 cs fix 2025-06-07 22:00:01 +07:00
DubbleClick
bb1f086674 pq forgets to link against -llber, only links against -lldap 2025-06-07 21:57:04 +07:00
DubbleClick
f4771b4f21 test macos too 2025-06-07 21:33:02 +07:00
DubbleClick
2093b4ec85 cs fix 2025-06-07 21:19:17 +07:00
DubbleClick
e5f483de1d libtidy uses strange cmake options 2025-06-07 21:16:53 +07:00
DubbleClick
23be5484e3 thread safety for pgsql (in version 17, remove this entirely) 2025-06-07 21:16:15 +07:00
DubbleClick
0b8543e6dd thread safety for pgsql? 2025-06-07 20:50:54 +07:00
DubbleClick
a3025479e7 fix libyaml install dir 2025-06-07 20:50:46 +07:00
DubbleClick
a6ea49981d ngtcp2 patch la files 2025-06-07 20:29:19 +07:00
DubbleClick
2a39fb0bd5 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-07 20:10:04 +07:00
DubbleClick
2dde53760a makeCmakeArgs 2025-06-07 20:09:50 +07:00
Marc
a7e48a8d3b Merge pull request #748 from crazywhalecc/feat/h3
simplify makeAutoConfArgs, fix macOS differences
2025-06-07 10:51:03 +07:00
DubbleClick
4fae158a3c cs fix 2025-06-07 10:33:41 +07:00
DubbleClick
7d87856f4a remove static libraries from libngtcp_crypto_ossl.a 2025-06-07 10:23:10 +07:00
DubbleClick
cfa525351a cs fix 2025-06-07 10:11:57 +07:00
DubbleClick
f9de43c7d4 =yes 2025-06-07 10:11:23 +07:00
DubbleClick
e00227f0c6 remove separate method from macosbuilder, move method from LinuxBuilder into UnixBuilderBase 2025-06-07 09:45:19 +07:00
DubbleClick
e31942bf1e uncommented buildphp, haha 2025-06-07 08:21:56 +07:00
DubbleClick
111de20a57 fix cs 2025-06-07 00:00:17 +07:00
DubbleClick
635fbae3c9 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-07 00:00:00 +07:00
DubbleClick
f29ee95176 remove buildUnixShared method from xhprof 2025-06-06 23:58:33 +07:00
DubbleClick
0d91ad7d94 remove buildUnixShared method from sqlsrv 2025-06-06 23:57:48 +07:00
DubbleClick
715650c4db add "which" to spc doctor 2025-06-06 23:51:58 +07:00
DubbleClick
a68212672b apply suggestions 2025-06-06 23:49:58 +07:00
Marc
fce115d39c Merge pull request #747 from crazywhalecc/feat/h3
fix ngtcp2 with openssl on glibc <= 2.17, macos still pending
2025-06-06 17:08:14 +07:00
DubbleClick
301f2d8a97 nghttp2 has brotlienc and brotlidec too 2025-06-06 17:02:35 +07:00
DubbleClick
500c19d900 phpstan 2025-06-06 16:59:36 +07:00
DubbleClick
617b0de31f add -lpthread and -ldl in openssl::getStaticLibFiles 2025-06-06 16:56:08 +07:00
DubbleClick
92ad792eff oops 2025-06-06 16:24:52 +07:00
DubbleClick
560f684f7f remove more unused options 2025-06-06 16:20:34 +07:00
DubbleClick
a0c0555089 add -lpthread -dl 2025-06-06 16:00:24 +07:00
DubbleClick
9fa1fb7b44 fix cs 2025-06-06 14:58:18 +07:00
DubbleClick
f5fa49338d macos is stupid now? 2025-06-06 14:49:09 +07:00
DubbleClick
df7cfa0d6a different extension combination fails? 2025-06-06 14:33:39 +07:00
DubbleClick
a0579efbc2 test 2025-06-06 14:32:28 +07:00
DubbleClick
b6a1182876 patch la files 2025-06-06 14:26:06 +07:00
DubbleClick
4582e1f508 cs fix 2025-06-06 13:57:45 +07:00
DubbleClick
621e396373 Merge branch 'fix/icurel' of https://github.com/crazywhalecc/static-php-cli into fix/icurel 2025-06-06 13:55:11 +07:00
DubbleClick
300723419b Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-06 13:55:00 +07:00
Marc
f75ab9f428 Merge pull request #743 from crazywhalecc/feat/h3
Feature: add http/3 support to curl.
2025-06-06 13:53:25 +07:00
Marc
dbc7ff5de7 Merge pull request #746 from crazywhalecc/fix/embed-soname
-release (soname) compilation support for linux shared embed
2025-06-06 13:44:34 +07:00
Marc
856db3df08 Merge pull request #745 from crazywhalecc/feat/lz4
add lz4 extension
2025-06-06 13:28:54 +07:00
DubbleClick
1479bef00d brotli was matching /dev/null, which should not be used 2025-06-06 13:21:20 +07:00
DubbleClick
3761a9c8ba brotli was matching /dev/null, which should not be used 2025-06-06 13:18:49 +07:00
DubbleClick
7c4c8c6275 cache libc version 2025-06-06 13:10:28 +07:00
DubbleClick
3b9670c202 fpic for liblzma 2025-06-06 09:57:20 +07:00
DubbleClick
861010af0e trim envs 2025-06-06 09:35:05 +07:00
DubbleClick
57b527c886 gzencode, of course 2025-06-05 21:29:20 +07:00
DubbleClick
31652e8b04 I HATE WINDOWS 2025-06-05 20:26:41 +07:00
DubbleClick
8b94a7174f cs fix 2025-06-05 20:14:02 +07:00
DubbleClick
01a79fcc6e unify tests for all compression extensions 2025-06-05 20:07:55 +07:00
DubbleClick
17b4c18830 accidental space 2025-06-05 19:59:45 +07:00
DubbleClick
86541b1aa8 only apply ffi patch at version >= 8.3.16 2025-06-05 19:58:38 +07:00
DubbleClick
e022a45048 only apply ffi patch at version >= 8.3.16 2025-06-05 19:57:59 +07:00
DubbleClick
94e31f1953 doms 2025-06-05 17:32:54 +07:00
DubbleClick
ad8581db97 Merge remote-tracking branch 'origin/main' into fix/icurel 2025-06-05 16:48:47 +07:00
DubbleClick
e2191113b0 tests for brotli and xz 2025-06-05 16:42:52 +07:00
DubbleClick
161a553948 -release (soname) compilation support for linux shared embed 2025-06-05 13:54:17 +07:00
DubbleClick
80f63e66c3 check static compilation 2025-06-05 11:48:28 +07:00
DubbleClick
2f25409475 add lz4 test 2025-06-05 11:48:07 +07:00
DubbleClick
67320d3eb3 add to tests 2025-06-05 11:37:36 +07:00
DubbleClick
92aeb2d816 enable shared 2025-06-05 11:35:50 +07:00
DubbleClick
3420f6ca42 add lz4 extension 2025-06-05 11:33:51 +07:00
DubbleClick
8e5efb923f update docs 2025-06-05 10:27:18 +07:00
Marc
ab4e0bc406 Merge pull request #741 from crazywhalecc/fix/freetype-cmake
force minimum version 3.5 for cmake policies in freetype
2025-06-05 10:22:51 +07:00
DubbleClick
8993b3f4f0 add pkgconf prefix patch for ngtcp2 crypto library 2025-06-05 10:06:20 +07:00
DubbleClick
499c281931 cs fix 2025-06-05 09:50:14 +07:00
DubbleClick
bb7e0f6f89 add nghttp3 and ngtcp2 2025-06-05 09:44:03 +07:00
DubbleClick
8919a2fcca goddamn windows 2025-06-04 21:50:28 +07:00
DubbleClick
ba0796c9ea nghttp3 2025-06-04 21:42:44 +07:00
DubbleClick
1b7404f194 php cs fix 2025-06-04 21:22:05 +07:00
DubbleClick
5add534848 don't use two extra variables 2025-06-04 21:20:00 +07:00
DubbleClick
ef7ebdfd1f force minimum version 3.12 for cmake policies in freetype, only when cmake >= 4 2025-06-04 21:18:44 +07:00
Marc
42f356d322 Merge pull request #739 from crazywhalecc/fix/curlca
force curl to respect SSL_CERT_FILE
2025-06-04 19:09:57 +07:00
DubbleClick
dabf52511f force minimum version 3.5 for cmake policies in freetype 2025-06-04 17:18:09 +07:00
DubbleClick
df85f97646 force curl to respect SSL_CERT_FILE 2025-06-04 13:44:18 +07:00
DubbleClick
a9d37bb2a2 add source patch for ffi on centos 7 2025-06-04 08:58:46 +07:00
DubbleClick
6b689f1584 explicitly pass env to process handler, fails in docker otherwise (??????) 2025-06-02 15:12:44 +07:00
DubbleClick
4b0fa94b3c stan 2025-06-02 12:32:53 +07:00
DubbleClick
c53b06c3d2 shared-extensions instead of build-shared 2025-06-02 12:27:58 +07:00
DubbleClick
ed87a7cd67 don't force invalidate php-src if the download option is explicitly passed 2025-06-02 12:00:20 +07:00
DubbleClick
108bf34cca craft needs to download shared extensions too 2025-06-02 11:55:55 +07:00
DubbleClick
8b98792ccf zts of course 2025-06-01 13:59:18 +07:00
DubbleClick
7c009b6dce add rdkafka 2025-06-01 13:53:56 +07:00
DubbleClick
5ae5a3d75d cs fix 2025-06-01 13:53:33 +07:00
DubbleClick
396ddd3e6f cs fix 2025-06-01 13:52:17 +07:00
DubbleClick
da7a125faf librdkafka needs "which" to be installed 2025-06-01 13:51:05 +07:00
DubbleClick
febf9b1815 full test suite for shared extensions 2025-06-01 13:27:36 +07:00
DubbleClick
55b4ba5832 fix file_exists check in printing shared extension folder 2025-06-01 13:23:44 +07:00
Marc
3bc5ac28be space 2025-05-31 22:33:30 +07:00
Marc
93eb6378ba Merge branch 'main' into fix/icurel 2025-05-31 22:32:08 +07:00
Marc
61837f0d68 more os tests 2025-05-31 22:26:56 +07:00
henderkes
c44b8b1029 test xz and brotli as well 2025-05-31 22:20:03 +07:00
henderkes
8312ce4d4c add ext-xz and ext-brotli 2025-05-31 22:17:06 +07:00
DubbleClick
3052b1cca5 change extension_dir, the env variable only has an effect during compilation 2025-05-31 21:01:22 +07:00
DubbleClick
ad3860981a -DPOSITION_INDEPENDENT_CODE=ON 2025-05-31 14:41:35 +07:00
DubbleClick
2dbcbc6963 --with-pic and --enable-pic for other libraries that support them 2025-05-31 14:35:59 +07:00
DubbleClick
8767181a80 --with-pic for ldap 2025-05-31 14:21:55 +07:00
DubbleClick
4c64707138 -ldl and --with-pic for imagemagick 2025-05-31 14:19:04 +07:00
DubbleClick
764fdd4d08 --enable-pic for gettext 2025-05-31 14:09:35 +07:00
DubbleClick
4c124770ed --with-pic for libffi 2025-05-31 14:06:00 +07:00
DubbleClick
78b2a89b0a --with-pic for libpng 2025-05-31 14:03:17 +07:00
DubbleClick
6147721314 dont disable openmp macro 2025-05-30 22:26:43 +07:00
DubbleClick
2a5915f4b6 patched this in ext-spx before, do it here instead 2025-05-30 21:21:50 +07:00
DubbleClick
5382362168 only disable openmp for rh devtoolset-10 2025-05-30 20:41:17 +07:00
DubbleClick
3867b9933d update doc for spx extension 2025-05-30 16:18:34 +07:00
crazywhalecc
4299abf68b Update vitepress version, fix selecting all options 2025-05-30 15:38:06 +08:00
DubbleClick
b68701f51b updated the static-php spx 2025-05-27 12:18:31 +07:00
David Grüner
c551efb75c Fix CraftCommand ignoring build-options during build (closes #732) (#733)
Unified option to parameter conversion
2025-05-26 20:14:23 +08:00
DubbleClick
92acb95a58 linter 2025-05-25 18:39:11 +07:00
DubbleClick
e2ea10d2eb set extension dir before 2025-05-25 18:29:34 +07:00
DubbleClick
d833d8946c fixes on arch64 2025-05-25 18:03:07 +07:00
DubbleClick
3662e079ac fix spc doctor command, gettext is installed by default, but doesn't provide all required autopoint stuff - check for gettextize instead, which is only installed with the gettext-devel package 2025-05-25 17:26:48 +07:00
DubbleClick
c972a94876 another way where static extensions would be excluded if also compiled shared 2025-05-25 15:52:11 +07:00
DubbleClick
234df8d11f update spx, works static and shared 2025-05-25 11:48:52 +07:00
DubbleClick
14ca782672 rename method 2025-05-25 11:07:44 +07:00
DubbleClick
9665473669 revert env 2025-05-25 11:02:54 +07:00
DubbleClick
a8987d48ed the what now? 2025-05-25 11:00:38 +07:00
DubbleClick
f83715c370 add function description 2025-05-25 10:52:46 +07:00
DubbleClick
a9d5dcf4a2 fixer 2025-05-25 10:47:32 +07:00
DubbleClick
e568041143 \$SPC_CMD_PREFIX_PHP_MAKE -> $SPC_CMD_PREFIX_PHP_MAKE 2025-05-25 10:44:38 +07:00
DubbleClick
4ce7374ac9 move zend extension check into config 2025-05-25 09:37:15 +07:00
DubbleClick
ed35b65390 build all static exts no matter if we're also building shared versions 2025-05-23 12:09:57 +07:00
DubbleClick
15dc672bcf remove shared-ext-depends 2025-05-23 10:01:24 +07:00
DubbleClick
51891478e4 shared ssh2 wants openssl if mysqli or mysqlnd aren't built in 2025-05-22 16:51:03 +07:00
DubbleClick
c2d5afc4e9 mysqli and mysqlnd can also be built shared 2025-05-22 16:48:22 +07:00
DubbleClick
835fc1e360 oops 2025-05-22 16:08:09 +07:00
DubbleClick
2a70b998e3 change to count of Static Extensions 2025-05-22 16:07:52 +07:00
DubbleClick
5eecd14ce0 linter 2025-05-22 16:04:29 +07:00
DubbleClick
0afe0e5f46 last problems (?) 2025-05-22 15:46:42 +07:00
DubbleClick
396d4b341f broli, hahahaha 2025-05-22 13:01:36 +07:00
DubbleClick
bc002d500e linter again 2025-05-22 12:45:06 +07:00
DubbleClick
6a86b28977 fix case of nonexistent pc 2025-05-22 12:44:48 +07:00
DubbleClick
b91c83b6cd linter 2025-05-22 12:29:19 +07:00
DubbleClick
4b8412dfdb shared for imagick 2025-05-22 12:28:00 +07:00
DubbleClick
3713ae8c93 extra dependencies for extensions 2025-05-22 12:27:41 +07:00
DubbleClick
310be957b6 new build-with-php key for extensions 2025-05-22 12:27:27 +07:00
DubbleClick
c29ca9722f add -lbrotlienc to curl 2025-05-22 12:26:25 +07:00
DubbleClick
64b6f98ce7 the flag doesn't fix it, the problem is something else 2025-05-21 20:43:10 +07:00
DubbleClick
4a44282556 shoehorn the lot in, I don't know how to fix this otherwise 2025-05-21 20:12:12 +07:00
DubbleClick
e3d7969b96 select all quick button 2025-05-21 20:03:21 +07:00
DubbleClick
b68d71b7b7 testPHP in windowsbuilder 2025-05-21 19:22:15 +07:00
DubbleClick
b376d1682f remove runSharedExtensionCheckUnix 2025-05-21 18:35:48 +07:00
DubbleClick
af51469b62 session, not sockets... 2025-05-21 18:04:38 +07:00
DubbleClick
fc7df585bd msgpack requires session 2025-05-21 18:01:41 +07:00
DubbleClick
3ff31d20cf fix undefined references to brotlicommon functions in gd.so 2025-05-21 17:59:46 +07:00
DubbleClick
11c116480f fix spx 2025-05-21 17:57:53 +07:00
Marc
fd5bc54cd0 Merge pull request #721 from crazywhalecc/feat/spx
update ext-spx (support zts builds)
2025-05-21 14:55:44 +07:00
Marc
95380168ef Merge branch 'fix/icurel' into feat/spx 2025-05-21 14:55:17 +07:00
DubbleClick
d349627fa1 linter 2025-05-21 14:29:49 +07:00
DubbleClick
3f8d297fb1 linter 2025-05-21 14:15:58 +07:00
Jerry Ma
aae6c2c98b Fix GHA token missing bug (#731)
* Update test-extensions.php

* Enable UPX test

* Add debug messages

* Test

* Revert

* Update tests.yml

* Update tests.yml

* Explict define GITHUB_TOKEN

* What's this???

* Check GITHUB_TOKEN in workflow

* Test token variable in step

* Test token variable inside php

* Test token in command

* Get env in commands

* Revert workflow env, add passthrough GITHUB_TOKEN into docker

* See build commands

* See build commands

* Typo fix

* Remove debug symbol for normal mode
2025-05-21 15:11:42 +08:00
DubbleClick
7698ceb108 fixes for more configure args 2025-05-21 14:10:56 +07:00
DubbleClick
495e868a71 rework configure args 2025-05-21 13:19:51 +07:00
DubbleClick
95a2f4600b rework building of shared extensions so that builtin extensions are built at php-src/configure -> make time 2025-05-21 12:01:00 +07:00
DubbleClick
c43423a7d0 replace root cause of the automatic enable 2025-05-21 11:19:28 +07:00
DubbleClick
fa285ecc82 more patching, xml still not working though 2025-05-20 23:16:36 +07:00
DubbleClick
f47daac3cc cs fix, xml building fails now, unsure why, doesn't seem to import expat_compat.h for some reason 2025-05-20 23:04:58 +07:00
DubbleClick
03ca3f4f59 why do we have prefix= calls instead of prefix=BUILD_ROOT_DIR? 2025-05-20 22:19:09 +07:00
DubbleClick
a9f81dd38e remove -fpic and -fpie (-fPIC and -fPIE are still there) 2025-05-20 20:03:02 +07:00
DubbleClick
93c6928624 fix readline 2025-05-20 20:00:37 +07:00
Marc
1e50dac5a6 Update BuildPHPCommand.php
fix printed path
2025-05-20 10:50:41 +07:00
henderkes
545a653c0d better phar handling 2025-05-20 09:20:20 +07:00
henderkes
20b6870f90 rewrite extension_dir 2025-05-20 09:14:13 +07:00
Jerry Ma
ca6f19f77d Add build from config support (craft command) (#713)
* Add build from config support (craft command)

* fix 60s timeout

* Fix missing optional warning

* Fix Windows missing SIGINT bug

---------

Co-authored-by: DubbleClick <m@pyc.ac>
2025-05-20 10:07:19 +08:00
henderkes
14a0e1a6cc fix macos 2025-05-20 08:24:39 +07:00
henderkes
38dfcdabd0 fix rdkafka 2025-05-20 08:06:49 +07:00
henderkes
683371adaa fix phar 2025-05-20 07:48:49 +07:00
henderkes
7ba1948101 fix pdo_sqlsrv 2025-05-20 07:48:49 +07:00
henderkes
5bd53ed714 skip php rebuild if we're only building shared libphp.so 2025-05-20 07:48:49 +07:00
henderkes
bff99fa537 fix imagick shared build 2025-05-20 07:48:48 +07:00
Marc
54ff71798c patch intl standard to c++17 2025-05-18 21:48:43 +07:00
Marc
81474336c1 Update dom.php 2025-05-18 18:29:43 +07:00
henderkes
6b50700d8c remove dom extra cake 2025-05-18 18:24:09 +07:00
henderkes
f708907d99 zstd pic 2025-05-18 17:59:12 +07:00
Marc
117923791a Update test-extensions.php 2025-05-18 17:46:55 +07:00
henderkes
ea7c145c62 libxml2 pic... 2025-05-18 15:52:15 +07:00
henderkes
bdd764218b install headers and modules from shared extensions 2025-05-18 12:53:49 +07:00
henderkes
1fbd2c1adc -fPIC for postgresql CFLAGS, but it's still erroring out 2025-05-18 12:46:55 +07:00
henderkes
2ff300970a -fPIC for unixodbc 2025-05-18 12:19:26 +07:00
henderkes
f88c10d4aa restore buildphp command 2025-05-18 08:57:07 +07:00
henderkes
eab8c27e4a shared dom ext requires xml 2025-05-17 22:43:34 +07:00
henderkes
c1e91e1ccb sockets doesn't install header?! 2025-05-17 22:40:30 +07:00
henderkes
05e9129a66 refactor dom out to its own extension, fails shared build 2025-05-17 19:01:32 +07:00
henderkes
76a9be2167 fix shared bz2 build 2025-05-17 19:00:57 +07:00
Marc
872673655e oopsie in opcache 2025-05-16 00:26:23 +07:00
Marc
1ae27c7b5a oopsie 2025-05-16 00:24:18 +07:00
henderkes
b402b735d6 fix copy command with BUILD_MODULES_CONSTANT 2025-05-15 23:30:07 +07:00
henderkes
22001792cd remove static target for swoole 2025-05-15 21:51:18 +07:00
henderkes
9557c9ef21 remove static target for zip 2025-05-15 21:50:35 +07:00
henderkes
6fe8b591ce ld library path for shared extension building 2025-05-15 19:52:30 +07:00
henderkes
23ae3f60f3 remove unused option 2025-05-15 15:35:13 +07:00
henderkes
03b634b961 fix libsodium with -fPIC too 2025-05-15 15:29:12 +07:00
henderkes
2897fdda04 fix icu for relocatable objects (required by libphp.so building) 2025-05-15 14:47:54 +07:00
henderkes
f5fffafd43 format setEnv§ 2025-05-15 14:46:44 +07:00
Marc
e884f97621 Merge pull request #723 from crazywhalecc/fix/xslt
fix libxslt build when trying to create a PIE executable using it
2025-05-07 10:50:04 +07:00
DubbleClick
e4028da886 typo 2025-05-06 16:56:06 +07:00
DubbleClick
a65bc95091 test arm64 too 2025-05-06 16:54:20 +07:00
DubbleClick
14563417a7 don't test on windows x) 2025-05-06 16:53:52 +07:00
DubbleClick
a3ee3e5a24 add to tests 2025-05-06 16:41:35 +07:00
DubbleClick
16a36b8315 damn comma 2025-05-06 16:39:02 +07:00
DubbleClick
861c49c9bc make sure -fpic -fpie from CFLAGS bleeds through to libxslt compilation 2025-05-06 16:35:41 +07:00
DubbleClick
b3dacf9c5a lowercase 2025-05-06 16:22:37 +07:00
DubbleClick
2c13eb257b static compilation is not quite working yet 2025-04-30 21:46:27 +07:00
crazywhalecc
348decf72f Fix Windows missing SIGINT bug 2025-04-29 14:52:24 +08:00
crazywhalecc
92483cf188 Fix missing optional warning 2025-04-29 14:51:49 +08:00
DubbleClick
8143b1d768 fix 60s timeout 2025-04-29 13:11:26 +07:00
Jerry Ma
e7d6f37e98 Fix windows xlswriter duplicate md5 symbol bug (#719)
* Add missing SOURCE_PATH before making cmake toolchain

* Fix windows xlswriter duplicate md5 symbol bug

* Add detection for patchFile to prevent duplicate patches

* Add tests
2025-04-28 14:35:08 +08:00
DubbleClick
d275a44895 Merge remote-tracking branch 'origin/main' into feat/craft 2025-04-28 10:58:11 +07:00
Marc
f755d66342 fix attr and acl build without autogen.sh (if we don't download from git) (#718) 2025-04-28 11:14:46 +08:00
Jerry Ma
22a438ed5e Add xlswriter extension windows support (#712)
* Add xlswriter extension windows support

* cs fix
2025-04-24 14:21:37 +08:00
Jerry Ma
a014294d58 Fix ghrel download link, use API directly (#711)
* Fix ghrel download link, use API directly

* Add missing GH token for downloading API
2025-04-24 14:21:22 +08:00
Jerry Ma
39953b5223 Fix pack lib command with wrong compression (#710)
* Fix pack lib command with wrong compression

* Update src/SPC/command/dev/PackLibCommand.php

Co-authored-by: Marc <m@pyc.ac>

---------

Co-authored-by: Marc <m@pyc.ac>
2025-04-24 14:21:07 +08:00
crazywhalecc
bd341db54a Add build from config support (craft command) 2025-04-24 14:18:39 +08:00
Jerry Ma
455ed7d503 Add alt download for Downloader (#706)
* Add alt download for Downloader

* Test broken url

* Break another source

* Good!

* Rename alt_sources variable

* Use SPC_DOWNLOAD_RETRIES instead of SPC_RETRY_TIME

* Apply new curlExec args
2025-04-22 20:25:44 +08:00
Marc
637ae89583 Merge pull request #707 from crazywhalecc/retries
rename SPC_RETRY_TIME to SPC_DOWNLOAD_RETRIES to clear up what it's doing sleep 5 seconds between retries
2025-04-22 15:45:02 +07:00
DubbleClick
7fd858b472 Revert "unwrap cast to unify curlDown with curlExec"
This reverts commit 74d8377400.
2025-04-22 14:44:57 +07:00
DubbleClick
74d8377400 unwrap cast to unify curlDown with curlExec 2025-04-22 14:36:58 +07:00
DubbleClick
a29992b907 rename retry to retries 2025-04-22 14:34:43 +07:00
Jerry Ma
57097d1275 Fix postgresql macOS 15.4 build bug (#705) 2025-04-22 15:09:31 +08:00
tricker
b21c62c11d Allow CI build to be called by other worklows (#698)
* add workflow_call

* change type choice string

* remove options for type string

* when vendor-mode run composer install

* move vendor-mode composer install

* debug

* move out vendor-mode inputs
2025-04-22 15:09:17 +08:00
DubbleClick
0b3421e3cd rename SPC_RETRY_TIME to SPC_DOWNLOAD_RETRIES to clear up what it's doing
sleep 5 seconds between retries
2025-04-22 12:24:08 +07:00
180 changed files with 4468 additions and 2515 deletions

15
.editorconfig Normal file
View 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

View File

@@ -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"

View File

@@ -17,8 +17,7 @@ on:
- 'box.json'
- '.php-cs-fixer.php'
permissions:
contents: read
permissions: read-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -191,7 +190,7 @@ jobs:
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
- name: "Run Build Tests (download)"
run: php src/globals/test-extensions.php download_cmd ${{ matrix.os }} ${{ matrix.php }}
run: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} php src/globals/test-extensions.php download_cmd ${{ matrix.os }} ${{ matrix.php }}
- name: "Run Build Tests (build)"
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}

19
.gitignore vendored
View File

@@ -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

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env sh
# This file is using docker to run commands
SPC_DOCKER_VERSION=v3
# Detect docker can run
if ! which docker >/dev/null; then
@@ -50,9 +51,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 -t cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
FROM $ALPINE_FROM
$SPC_USE_MIRROR
RUN apk update; \
@@ -116,6 +117,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 +146,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 --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION
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 --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc $@
fi

View File

@@ -1,8 +1,5 @@
#!/usr/bin/env bash
# This file is using docker to run commands
set -e
# Detect docker can run
if ! which docker >/dev/null; then
echo "Docker is not installed, please install docker first !"
@@ -75,6 +72,7 @@ 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 && \
mkdir /cmake && \
@@ -129,6 +127,9 @@ 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
@@ -140,6 +141,13 @@ 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 +167,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 --rm -it --privileged $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH
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 --rm $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH bin/spc $@
fi

View File

@@ -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
View File

@@ -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": "*"
},

View File

@@ -68,8 +68,8 @@ CXX=${SPC_LINUX_DEFAULT_CXX}
AR=${SPC_LINUX_DEFAULT_AR}
LD=ld.gold
; 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 +81,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)
@@ -89,7 +89,7 @@ SPC_CMD_VAR_PHP_EMBED_TYPE="static"
; *** default build vars for building php ***
; CFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fpie"
; CPPFLAGS for configuring php
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
; LDFLAGS for configuring php
@@ -97,9 +97,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 +110,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 +133,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)

View File

@@ -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",
@@ -329,13 +336,28 @@
},
"type": "builtin",
"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 +390,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 +405,10 @@
"lib-depends": [
"libmemcached"
],
"lib-depends-unix": [
"libmemcached",
"fastlz"
],
"ext-depends": [
"session",
"zlib"
@@ -401,6 +427,10 @@
"openssl",
"zstd",
"zlib"
],
"frameworks": [
"CoreFoundation",
"Security"
]
},
"msgpack": {
@@ -410,7 +440,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 +482,8 @@
},
"opcache": {
"type": "builtin",
"arg-type-unix": "custom"
"arg-type-unix": "custom",
"zend-extension": true
},
"openssl": {
"notes": true,
@@ -638,6 +672,9 @@
"arg-type": "with-prefix",
"lib-depends": [
"readline"
],
"target": [
"static"
]
},
"redis": {
@@ -657,10 +694,12 @@
]
},
"session": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"shmop": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"simdjson": {
"type": "external",
@@ -678,7 +717,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"snappy": {
"support": {
@@ -771,7 +811,7 @@
"lib-depends": [
"libssh2"
],
"ext-depends-windows": [
"ext-depends": [
"openssl",
"zlib"
]
@@ -781,9 +821,6 @@
"Windows": "no",
"BSD": "wip"
},
"target": [
"static"
],
"notes": true,
"type": "external",
"source": "swoole",
@@ -901,7 +938,8 @@
]
},
"tokenizer": {
"type": "builtin"
"type": "builtin",
"build-with-php": true
},
"uuid": {
"support": {
@@ -942,7 +980,8 @@
"Darwin": "partial",
"Linux": "partial"
},
"notes": true
"notes": true,
"zend-extension": true
},
"xhprof": {
"support": {
@@ -954,11 +993,11 @@
"source": "xhprof",
"ext-depends": [
"ctype"
]
],
"build-with-php": true
},
"xlswriter": {
"support": {
"Windows": "wip",
"BSD": "wip"
},
"type": "external",
@@ -985,7 +1024,8 @@
],
"ext-depends-windows": [
"iconv"
]
],
"build-with-php": true
},
"xmlreader": {
"support": {
@@ -999,7 +1039,8 @@
"ext-depends-windows": [
"xml",
"dom"
]
],
"build-with-php": true
},
"xmlwriter": {
"support": {
@@ -1012,7 +1053,8 @@
],
"ext-depends-windows": [
"xml"
]
],
"build-with-php": true
},
"xsl": {
"support": {
@@ -1029,6 +1071,14 @@
"dom"
]
},
"xz": {
"type": "external",
"source": "ext-xz",
"arg-type": "with",
"lib-depends": [
"xz"
]
},
"yac": {
"support": {
"BSD": "wip"
@@ -1036,6 +1086,9 @@
"type": "external",
"source": "yac",
"arg-type-unix": "custom",
"lib-depends-unix": [
"fastlz"
],
"ext-depends-unix": [
"igbinary"
]
@@ -1056,9 +1109,6 @@
"support": {
"BSD": "wip"
},
"target": [
"static"
],
"type": "builtin",
"arg-type": "with-prefix",
"arg-type-windows": "enable",
@@ -1082,6 +1132,9 @@
"arg-type-windows": "enable",
"lib-depends": [
"zlib"
],
"target": [
"static"
]
},
"zstd": {

View File

@@ -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": [
@@ -232,8 +243,8 @@
"ldap": {
"source": "ldap",
"static-libs-unix": [
"liblber.a",
"libldap.a"
"libldap.a",
"liblber.a"
],
"lib-depends": [
"openssl",
@@ -387,7 +398,9 @@
"source": "libmemcached",
"static-libs-unix": [
"libmemcached.a",
"libmemcachedutil.a"
"libmemcachedprotocol.a",
"libmemcachedutil.a",
"libhashkit.a"
]
},
"libpng": {
@@ -615,7 +628,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": {

View File

@@ -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"
}

View File

@@ -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",
@@ -496,12 +537,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 +744,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 +831,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 +967,6 @@
"path": "php-src/ext/swow-src",
"rev": "ci",
"url": "https://github.com/swow/swow",
"patch": "patchSwow",
"license": {
"type": "file",
"path": "LICENSE"

View File

@@ -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;
}

View File

@@ -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/'},
],
}
],
};

View File

@@ -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/'},
],
}
],
};

67
docs/deps-craft-yml.md Normal file
View File

@@ -0,0 +1,67 @@
```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
# 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
```

View File

@@ -0,0 +1,7 @@
---
aside: false
---
# craft.yml Configuration
<!--@include: ../../deps-craft-yml.md-->

View File

@@ -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.

View File

@@ -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.

View File

@@ -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,47 @@ 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).
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 +261,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 +274,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.
@@ -283,16 +327,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.
@@ -322,6 +357,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.

View File

@@ -0,0 +1,7 @@
---
aside: false
---
# craft.yml 配置
<!--@include: ../../deps-craft-yml.md-->

View File

@@ -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 上进行了编译测试并验证其稳定性,但如果您遇到问题,我们可能不会进行修复。

View File

@@ -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

View File

@@ -1,3 +1,7 @@
---
outline: 'deep'
---
# 本地构建Linux、macOS、FreeBSD
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)。
@@ -112,7 +116,45 @@ 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-使用)。
如果中途构建出错,你可以使用 `--debug` 参数查看详细的错误信息,或者使用 `--with-clean` 参数清除旧的编译结果,重新编译。
如使用以上方式仍构建失败,请提交一个 issue附上你的 `craft.yml``craft.log`
## 分步构建命令
如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 `bin/spc` 命令分步执行。
### 命令 download - 下载依赖包
使用命令 `bin/spc download` 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。
@@ -184,7 +226,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 +238,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` 进行编译。你需要指定一个编译目标,从如下参数中选择:
@@ -244,15 +286,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
```
### 编译运行选项
#### 编译运行选项
在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:
@@ -340,6 +374,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 以及依赖的各种库的源码(需要自己指定要解包的库名)。

View File

@@ -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"
}
}

View File

@@ -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.0';
public function __construct()
{
@@ -43,6 +44,8 @@ final class ConsoleApplication extends Application
$this->addCommands(
[
// Craft command
new CraftCommand(),
// Common commands
new BuildPHPCommand(),
new BuildLibsCommand(),

View File

@@ -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;
@@ -127,7 +128,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 +234,52 @@ 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;
}
if (Config::getExt($ext->getName(), 'type') === 'builtin' || Config::getExt($ext->getName(), 'build-with-php') === true) {
if (file_exists(BUILD_MODULES_PATH . '/' . $ext->getName() . '.so')) {
logger()->info('Shared extension [' . $ext->getName() . '] was already built by php-src/configure (' . $ext->getName() . '.so)');
continue;
}
if (Config::getExt($ext->getName(), 'build-with-php') === true) {
logger()->warning('Shared extension [' . $ext->getName() . '] did not build with php-src/configure (' . $ext->getName() . '.so)');
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
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 +292,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);

View File

@@ -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,70 @@ 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 patchBeforeSharedBuild(): 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;
}
/**
* @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,7 +263,8 @@ 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] = 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);
}
@@ -222,7 +277,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 +328,20 @@ class Extension
*/
public function buildShared(): void
{
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
logger()->info('extension ' . $this->getName() . ' already built, skipping');
return;
}
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 +359,44 @@ 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();
$env = [
'CFLAGS' => $config['cflags'],
'CXXFLAGS' => $config['cflags'],
'LDFLAGS' => $config['ldflags'],
'LIBS' => $config['libs'],
'LIBS' => '-Wl,-Bstatic -Wl,--start-group ' . $staticLibString . ' -Wl,--end-group -Wl,-Bdynamic ' . $sharedLibString,
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
];
// 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('ext [ . ' . $this->getName() . '] patching 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'
);
FileSystem::replaceFileRegex(
$this->source_dir . '/Makefile',
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
'$1 ' . $staticLibString
);
shell()->cd($this->source_dir)
->setEnv($env)
->exec('make clean')
->exec('make -j' . $this->builder->concurrency)
->exec('make install');
}
/**
@@ -380,6 +467,37 @@ class Extension
}
}
/**
* Get required static and shared libraries as a pair of strings in format -l{libname} -l{libname2}
*
* @return array [staticLibString, sharedLibString]
*/
private 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)) {
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 +523,11 @@ class Extension
}
}
if (array_key_exists(0, $deps)) {
$zero = [0 => $deps[0]];
unset($deps[0]);
return $zero + $deps;
}
return $deps;
}
}

View File

@@ -11,9 +11,12 @@ use SPC\store\Config;
use SPC\store\Downloader;
use SPC\store\FileSystem;
use SPC\store\SourceManager;
use SPC\util\GlobalValueTrait;
abstract class LibraryBase
{
use GlobalValueTrait;
/** @var string */
public const NAME = 'unknown';
@@ -31,7 +34,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'));
}
/**

View File

@@ -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';
}

View File

@@ -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']
);
}
}
}

View File

@@ -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;

View 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';
}
}

View File

@@ -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';
}

View File

@@ -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' : '';

View File

@@ -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';
}

View File

@@ -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,7 @@ 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;
}
}

View File

@@ -18,9 +18,12 @@ class intl extends Extension
// 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');
}
return true;
}
public function patchBeforeSharedBuild(): bool
{
return $this->patchBeforeBuildconf();
}
}

View 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';
}
}

View File

@@ -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 !');
}

View File

@@ -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 {

View File

@@ -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;
}
/**

View File

@@ -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';
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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';
}

View File

@@ -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';
}

View File

@@ -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';

View 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']
);
}
}
}

View File

@@ -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 . '"';
}
}

View File

@@ -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();
}
}

View File

@@ -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';

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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';

View File

@@ -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.');
}
}
}

View File

@@ -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;
}
}

View File

@@ -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'),
};

View File

@@ -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';
}
}

View File

@@ -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);
@@ -145,7 +143,10 @@ class BSDBuilder extends UnixBuilderBase
}
$this->buildEmbed();
}
}
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);

View File

@@ -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');
}

View File

@@ -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=/

View File

@@ -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;
@@ -49,14 +48,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 +61,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.
*
@@ -210,7 +175,10 @@ class LinuxBuilder extends UnixBuilderBase
}
$this->buildEmbed();
}
}
public function testPHP(int $build_target = BUILD_TARGET_NONE)
{
$this->emitPatchPoint('before-sanity-check');
$this->sanityCheck($build_target);
}
@@ -224,9 +192,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 +231,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 +255,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 +281,20 @@ 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($cwd);
}
$this->patchPhpScripts();
}
@@ -319,6 +303,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'),
];
}

View File

@@ -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;

View File

@@ -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';
}

View 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';
}

View File

@@ -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 ' .

View File

@@ -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');

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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'
);
}
}

View 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';
}

View 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';
}

View File

@@ -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;
}
}

View File

@@ -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));
}
@@ -209,6 +185,12 @@ class MacOSBuilder extends UnixBuilderBase
$this->sanityCheck($build_target);
}
public function testPHP(int $build_target = BUILD_TARGET_NONE)
{
$this->emitPatchPoint('before-sanity-check');
$this->sanityCheck($build_target);
}
/**
* Build cli sapi
*
@@ -220,7 +202,8 @@ 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');
}
@@ -291,15 +274,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();
}

View 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';
}

View File

@@ -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']);
}

View File

@@ -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']);
}
}

View File

@@ -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;
}
}

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -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');
}
}

View 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';
}

View 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';
}

View File

@@ -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+

View File

@@ -17,9 +17,9 @@ trait UnixLibraryTrait
* @throws FileSystemException
* @throws WrongUsageException
*/
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 = [$this];
$libs = $include_self ? [$this] : [];
if ($recursive) {
array_unshift($libs, ...array_values($this->getDependencies(recursive: true)));
}
@@ -84,19 +84,34 @@ trait UnixLibraryTrait
}
}
/**
* remove libtool archive files
*
* @throws FileSystemException
* @throws WrongUsageException
*/
public function cleanLaFiles(): void
public function patchLaDependencyPrefix(?array $files = null): void
{
foreach ($this->getStaticLibs() as $lib) {
$filename = pathinfo($lib, PATHINFO_FILENAME) . '.la';
if (file_exists(BUILD_LIB_PATH . '/' . $filename)) {
unlink(BUILD_LIB_PATH . '/' . $filename);
logger()->info('Patching library [' . static::NAME . '] la files');
$throwOnMissing = true;
if ($files === null) {
$files = $this->getStaticLibs();
$files = array_map(fn ($name) => str_replace('.a', '.la', $name), $files);
$throwOnMissing = false;
}
foreach ($files as $name) {
$realpath = realpath(BUILD_LIB_PATH . '/' . $name);
if ($realpath === false) {
if ($throwOnMissing) {
throw new RuntimeException('Cannot find library [' . static::NAME . '] la file [' . $name . '] !');
}
logger()->warning('Cannot find library [' . static::NAME . '] la file [' . $name . '] !');
continue;
}
logger()->debug('Patching ' . $realpath);
// replace prefix
$file = FileSystem::readFile($realpath);
$file = str_replace(
' /lib/',
' ' . BUILD_LIB_PATH . '/',
$file
);
$file = preg_replace('/^libdir=.*$/m', "libdir='" . BUILD_LIB_PATH . "'", $file);
FileSystem::writeFile($realpath, $file);
}
}
@@ -118,4 +133,13 @@ trait UnixLibraryTrait
{
return getenv($this->getSnakeCaseName() . '_LIBS') ?: '';
}
public function getLibExtraCXXFlags(): string
{
$env = getenv($this->getSnakeCaseName() . '_CXXFLAGS') ?: '';
if (!str_contains($env, $this->builder->arch_cxx_flags)) {
$env .= $this->builder->arch_cxx_flags;
}
return $env;
}
}

View File

@@ -4,66 +4,11 @@ declare(strict_types=1);
namespace SPC\builder\traits;
use SPC\exception\FileSystemException;
use SPC\store\FileSystem;
/**
* Unix 系统的工具函数 Trait适用于 Linux、macOS
*/
trait UnixSystemUtilTrait
{
/**
* 生成 toolchain.cmake用于 cmake 构建
*
* @param string $os 操作系统代号
* @param string $target_arch 目标架构
* @param string $cflags CFLAGS 参数
* @param null|string $cc CC 参数(默认空)
* @param null|string $cxx CXX 参数(默认空)
* @throws FileSystemException
*/
public static function makeCmakeToolchainFile(
string $os,
string $target_arch,
string $cflags,
?string $cc = null,
?string $cxx = null
): string {
logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'");
$root = BUILD_ROOT_PATH;
$ccLine = '';
if ($cc) {
$ccLine = 'SET(CMAKE_C_COMPILER ' . $cc . ')';
}
$cxxLine = '';
if ($cxx) {
$cxxLine = 'SET(CMAKE_CXX_COMPILER ' . $cxx . ')';
}
$toolchain = <<<CMAKE
{$ccLine}
{$cxxLine}
SET(CMAKE_C_FLAGS "{$cflags}")
SET(CMAKE_CXX_FLAGS "{$cflags}")
SET(CMAKE_FIND_ROOT_PATH "{$root}")
SET(CMAKE_PREFIX_PATH "{$root}")
SET(CMAKE_INSTALL_PREFIX "{$root}")
SET(CMAKE_INSTALL_LIBDIR "lib")
set(PKG_CONFIG_EXECUTABLE "{$root}/bin/pkg-config")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil")
CMAKE;
// 有时候系统的 cmake 找不到 ar 命令,真奇怪
if (PHP_OS_FAMILY === 'Linux') {
$toolchain .= "\nSET(CMAKE_AR \"ar\")";
}
FileSystem::writeFile(SOURCE_PATH . '/toolchain.cmake', $toolchain);
return realpath(SOURCE_PATH . '/toolchain.cmake');
}
/**
* @param string $name 命令名称
* @param array $paths 寻找的目标路径(如果不传入,则使用环境变量 PATH

View File

@@ -5,7 +5,9 @@ declare(strict_types=1);
namespace SPC\builder\unix;
use SPC\builder\BuilderBase;
use SPC\builder\linux\LinuxBuilder;
use SPC\builder\freebsd\library\BSDLibraryBase;
use SPC\builder\linux\library\LinuxLibraryBase;
use SPC\builder\macos\library\MacOSLibraryBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
@@ -22,9 +24,6 @@ abstract class UnixBuilderBase extends BuilderBase
/** @var string C++ flags */
public string $arch_cxx_flags;
/** @var string cmake toolchain file */
public string $cmake_toolchain_file;
/**
* @throws WrongUsageException
* @throws FileSystemException
@@ -53,21 +52,6 @@ abstract class UnixBuilderBase extends BuilderBase
return array_map(fn ($x) => realpath(BUILD_LIB_PATH . "/{$x}"), $libFiles);
}
/**
* Return generic cmake options when configuring cmake projects
*/
public function makeCmakeArgs(): string
{
$extra = $this instanceof LinuxBuilder ? '-DCMAKE_C_COMPILER=' . getenv('CC') . ' ' : '';
return $extra .
'-DCMAKE_BUILD_TYPE=Release ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
'-DCMAKE_INSTALL_BINDIR=bin ' .
'-DCMAKE_INSTALL_LIBDIR=lib ' .
'-DCMAKE_INSTALL_INCLUDEDIR=include ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->cmake_toolchain_file}";
}
/**
* Generate configure flags
*/
@@ -90,6 +74,35 @@ abstract class UnixBuilderBase extends BuilderBase
return $extra;
}
/**
* @throws FileSystemException
* @throws RuntimeException
* @throws WrongUsageException
*/
public function makeAutoconfArgs(string $name, array $libSpecs): string
{
$ret = '';
foreach ($libSpecs as $libName => $arr) {
$lib = $this->getLib($libName);
if ($lib === null && str_starts_with($libName, 'lib')) {
$lib = $this->getLib(substr($libName, 3));
}
$arr = $arr ?? [];
$disableArgs = $arr[0] ?? null;
$prefix = $arr[1] ?? null;
if ($lib instanceof LinuxLibraryBase || $lib instanceof MacOSLibraryBase || $lib instanceof BSDLibraryBase) {
logger()->info("{$name} \033[32;1mwith\033[0;1m {$libName} support");
$ret .= "--with-{$libName}=yes " . $lib->makeAutoconfEnv($prefix) . ' ';
} else {
logger()->info("{$name} \033[31;1mwithout\033[0;1m {$libName} support");
$ret .= ($disableArgs ?? "--with-{$libName}=no") . ' ';
}
}
return rtrim($ret);
}
public function proveLibs(array $sorted_libraries): void
{
// search all supported libs
@@ -140,13 +153,13 @@ abstract class UnixBuilderBase extends BuilderBase
// sanity check for php-cli
if (($build_target & BUILD_TARGET_CLI) === BUILD_TARGET_CLI) {
logger()->info('running cli sanity check');
[$ret, $output] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "echo \"hello\";"');
[$ret, $output] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -r "echo \"hello\";"');
$raw_output = implode('', $output);
if ($ret !== 0 || trim($raw_output) !== 'hello') {
throw new RuntimeException("cli failed sanity check: ret[{$ret}]. out[{$raw_output}]");
}
foreach ($this->getExts(false) as $ext) {
foreach ($this->getExts() as $ext) {
logger()->debug('testing ext: ' . $ext->getName());
$ext->runCliCheckUnix();
}
@@ -223,8 +236,8 @@ abstract class UnixBuilderBase extends BuilderBase
default => throw new RuntimeException('Deployment does not accept type ' . $type),
};
logger()->info('Deploying ' . $this->getBuildTypeName($type) . ' file');
FileSystem::createDir(BUILD_ROOT_PATH . '/bin');
shell()->exec('cp ' . escapeshellarg($src) . ' ' . escapeshellarg(BUILD_ROOT_PATH . '/bin/'));
FileSystem::createDir(BUILD_BIN_PATH);
shell()->exec('cp ' . escapeshellarg($src) . ' ' . escapeshellarg(BUILD_BIN_PATH));
return true;
}
@@ -250,6 +263,7 @@ abstract class UnixBuilderBase extends BuilderBase
logger()->debug('Patching phpize prefix');
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', "prefix=''", "prefix='" . BUILD_ROOT_PATH . "'");
FileSystem::replaceFileStr(BUILD_BIN_PATH . '/phpize', 's##', 's#/usr/local#');
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/php/build/phpize.m4', 'test "[$]$1" = "no" && $1=yes', '# test "[$]$1" = "no" && $1=yes');
}
// patch php-config
if (file_exists(BUILD_BIN_PATH . '/php-config')) {

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\RuntimeException;
use SPC\util\executor\UnixAutoconfExecutor;
trait attr
{
@@ -13,18 +14,11 @@ trait attr
*/
protected function build(): void
{
shell()->cd($this->source_dir)
->setEnv([
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags()),
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv('libtoolize --force --copy')
->execWithEnv('./autogen.sh')
->execWithEnv('./configure --prefix= --enable-static --disable-shared --with-pic --disable-nls')
->execWithEnv("make -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
UnixAutoconfExecutor::create($this)
->exec('libtoolize --force --copy')
->exec('./autogen.sh || autoreconf -if')
->configure('--disable-nls')
->make();
$this->patchPkgconfPrefix(['libattr.pc'], PKGCONF_PATCH_PREFIX);
}
}

View File

@@ -7,6 +7,7 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
trait brotli
{
@@ -16,22 +17,14 @@ trait brotli
*/
protected function build(): void
{
FileSystem::resetDir($this->source_dir . '/build-dir');
shell()->cd($this->source_dir . '/build-dir')
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
'cmake ' .
'-DCMAKE_BUILD_TYPE=Release ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
'-DCMAKE_INSTALL_LIBDIR=lib ' .
'-DSHARE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
'-DBUILD_SHARED_LIBS=OFF ' .
'..'
)
->execWithEnv("cmake --build . -j {$this->builder->concurrency}")
->execWithEnv('make install');
UnixCMakeExecutor::create($this)
->setBuildDir("{$this->getSourceDir()}/build-dir")
->addConfigureArgs("-DSHARE_INSTALL_PREFIX={$this->getBuildRootPath()}")
->build();
$this->patchPkgconfPrefix(['libbrotlicommon.pc', 'libbrotlidec.pc', 'libbrotlienc.pc']);
FileSystem::replaceFileLineContainsString(BUILD_LIB_PATH . '/pkgconfig/libbrotlidec.pc', 'Libs: -L${libdir} -lbrotlidec', 'Libs: -L${libdir} -lbrotlidec -lbrotlicommon');
FileSystem::replaceFileLineContainsString(BUILD_LIB_PATH . '/pkgconfig/libbrotlienc.pc', 'Libs: -L${libdir} -lbrotlienc', 'Libs: -L${libdir} -lbrotlienc -lbrotlicommon');
shell()->cd(BUILD_ROOT_PATH . '/lib')->exec('ln -sf libbrotlicommon.a libbrotli.a');
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
if (str_starts_with($filename, 'libbrotli') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {

View File

@@ -16,10 +16,9 @@ trait bzip2
protected function build(): void
{
shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv("make PREFIX='" . BUILD_ROOT_PATH . "' clean")
->execWithEnv("make -j{$this->builder->concurrency} {$this->builder->getEnvString()} PREFIX='" . BUILD_ROOT_PATH . "' libbz2.a")
shell()->cd($this->source_dir)->initializeEnv($this)
->exec("make PREFIX='" . BUILD_ROOT_PATH . "' clean")
->exec("make -j{$this->builder->concurrency} {$this->builder->getEnvString()} PREFIX='" . BUILD_ROOT_PATH . "' libbz2.a")
->exec('cp libbz2.a ' . BUILD_LIB_PATH)
->exec('cp bzlib.h ' . BUILD_INCLUDE_PATH);
}

View File

@@ -6,7 +6,7 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
trait curl
{
@@ -16,53 +16,25 @@ trait curl
*/
protected function build(): void
{
$extra = '';
// lib:openssl
$extra .= $this->builder->getLib('openssl') ? '-DCURL_USE_OPENSSL=ON ' : '-DCURL_USE_OPENSSL=OFF -DCURL_ENABLE_SSL=OFF ';
// lib:brotli
$extra .= $this->builder->getLib('brotli') ? '-DCURL_BROTLI=ON ' : '-DCURL_BROTLI=OFF ';
// lib:libssh2
$libssh2 = $this->builder->getLib('libssh2');
if ($this->builder->getLib('libssh2')) {
/* @phpstan-ignore-next-line */
$extra .= '-DLIBSSH2_LIBRARY="' . $libssh2->getStaticLibFiles(style: 'cmake') . '" ' .
'-DLIBSSH2_INCLUDE_DIR="' . BUILD_INCLUDE_PATH . '" ';
} else {
$extra .= '-DCURL_USE_LIBSSH2=OFF ';
}
// lib:nghttp2
if ($nghttp2 = $this->builder->getLib('nghttp2')) {
$extra .= '-DUSE_NGHTTP2=ON ' .
/* @phpstan-ignore-next-line */
'-DNGHTTP2_LIBRARY="' . $nghttp2->getStaticLibFiles(style: 'cmake') . '" ' .
'-DNGHTTP2_INCLUDE_DIR="' . BUILD_INCLUDE_PATH . '" ';
} else {
$extra .= '-DUSE_NGHTTP2=OFF ';
}
// lib:ldap
$extra .= $this->builder->getLib('ldap') ? '-DCURL_DISABLE_LDAP=OFF ' : '-DCURL_DISABLE_LDAP=ON ';
// lib:zstd
$extra .= $this->builder->getLib('zstd') ? '-DCURL_ZSTD=ON ' : '-DCURL_ZSTD=OFF ';
// lib:idn2
$extra .= $this->builder->getLib('idn2') ? '-DUSE_LIBIDN2=ON ' : '-DUSE_LIBIDN2=OFF ';
// lib:psl
$extra .= $this->builder->getLib('psl') ? '-DCURL_USE_LIBPSL=ON ' : '-DCURL_USE_LIBPSL=OFF ';
// lib:libcares
$extra .= $this->builder->getLib('libcares') ? '-DENABLE_ARES=ON ' : '';
shell()->cd($this->source_dir)->exec('sed -i.save s@\${CMAKE_C_IMPLICIT_LINK_LIBRARIES}@@ ./CMakeLists.txt');
FileSystem::resetDir($this->source_dir . '/build');
UnixCMakeExecutor::create($this)
->optionalLib('openssl', '-DCURL_USE_OPENSSL=ON -DCURL_CA_BUNDLE=OFF -DCURL_CA_PATH=OFF -DCURL_CA_FALLBACK=ON', '-DCURL_USE_OPENSSL=OFF -DCURL_ENABLE_SSL=OFF')
->optionalLib('brotli', ...cmake_boolean_args('CURL_BROTLI'))
->optionalLib('libssh2', fn ($lib) => "-DLIBSSH2_LIBRARY=\"{$lib->getStaticLibFiles(style: 'cmake')}\" -DLIBSSH2_INCLUDE_DIR={$lib->getIncludeDir()}", '-DCURL_USE_LIBSSH2=OFF')
->optionalLib('nghttp2', fn ($lib) => "-DUSE_NGHTTP2=ON -DNGHTTP2_LIBRARY=\"{$lib->getStaticLibFiles(style: 'cmake')}\" -DNGHTTP2_INCLUDE_DIR={$lib->getIncludeDir()}", '-DUSE_NGHTTP2=OFF')
->optionalLib('nghttp3', fn ($lib) => "-DUSE_NGHTTP3=ON -DNGHTTP3_LIBRARY=\"{$lib->getStaticLibFiles(style: 'cmake')}\" -DNGHTTP3_INCLUDE_DIR={$lib->getIncludeDir()}", '-DUSE_NGHTTP3=OFF')
->optionalLib('ldap', ...cmake_boolean_args('CURL_DISABLE_LDAP', true))
->optionalLib('zstd', ...cmake_boolean_args('CURL_ZSTD'))
->optionalLib('idn2', ...cmake_boolean_args('USE_LIBIDN2'))
->optionalLib('psl', ...cmake_boolean_args('CURL_USE_LIBPSL'))
->optionalLib('libcares', '-DENABLE_ARES=ON')
->addConfigureArgs(
'-DBUILD_CURL_EXE=OFF',
'-DBUILD_LIBCURL_DOCS=OFF',
)
->build();
// compile
shell()->cd($this->source_dir . '/build')
->setEnv([
'CFLAGS' => $this->getLibExtraCFlags(),
'LDFLAGS' => $this->getLibExtraLdFlags(),
'LIBS' => $this->getLibExtraLibs(),
])
->exec('sed -i.save s@\${CMAKE_C_IMPLICIT_LINK_LIBRARIES}@@ ../CMakeLists.txt')
->execWithEnv("cmake {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF -DBUILD_CURL_EXE=OFF -DBUILD_LIBCURL_DOCS=OFF {$extra} ..")
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
// patch pkgconf
$this->patchPkgconfPrefix(['libcurl.pc']);
shell()->cd(BUILD_LIB_PATH . '/cmake/CURL/')

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
trait fastlz
{
protected function build(): void
{
shell()->cd($this->source_dir)->initializeEnv($this)
->exec((getenv('CC') ?: 'cc') . ' -c -O3 -fPIC fastlz.c -o fastlz.o')
->exec((getenv('AR') ?: 'ar') . ' rcs libfastlz.a fastlz.o');
if (!copy($this->source_dir . '/fastlz.h', BUILD_INCLUDE_PATH . '/fastlz.h')) {
throw new \RuntimeException('Failed to copy fastlz.h');
}
if (!copy($this->source_dir . '/libfastlz.a', BUILD_LIB_PATH . '/libfastlz.a')) {
throw new \RuntimeException('Failed to copy libfastlz.a');
}
}
}

View File

@@ -8,6 +8,7 @@ use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
trait freetype
{
@@ -18,20 +19,18 @@ trait freetype
*/
protected function build(): void
{
$extra_libs = $this->builder->getLib('libpng') ? '-DFT_DISABLE_PNG=OFF ' : '-DFT_DISABLE_PNG=ON ';
$extra_libs .= $this->builder->getLib('bzip2') ? '-DFT_DISABLE_BZIP2=OFF ' : '-DFT_DISABLE_BZIP2=ON ';
$extra_libs .= $this->builder->getLib('brotli') ? '-DFT_DISABLE_BROTLI=OFF ' : '-DFT_DISABLE_BROTLI=ON ';
FileSystem::resetDir($this->source_dir . '/build');
shell()->cd($this->source_dir . '/build')
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
"cmake {$this->builder->makeCmakeArgs()} -DFT_DISABLE_HARFBUZZ=ON " .
'-DBUILD_SHARED_LIBS=OFF ' .
"{$extra_libs}.."
)
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
$cmake = UnixCMakeExecutor::create($this)
->optionalLib('libpng', ...cmake_boolean_args('FT_DISABLE_PNG', true))
->optionalLib('bzip2', ...cmake_boolean_args('FT_DISABLE_BZIP2', true))
->optionalLib('brotli', ...cmake_boolean_args('FT_DISABLE_BROTLI', true))
->addConfigureArgs('-DFT_DISABLE_HARFBUZZ=ON');
// fix cmake 4.0 compatibility
if (version_compare(get_cmake_version(), '4.0.0', '>=')) {
$cmake->addConfigureArgs('-DCMAKE_POLICY_VERSION_MINIMUM=3.12');
}
$cmake->build();
$this->patchPkgconfPrefix(['freetype2.pc']);
FileSystem::replaceFileStr(
@@ -39,7 +38,5 @@ trait freetype
' -L/lib ',
' -L' . BUILD_ROOT_PATH . '/lib '
);
$this->cleanLaFiles();
}
}

View File

@@ -4,38 +4,34 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
trait gettext
{
protected function build(): void
{
$extra = $this->builder->getLib('ncurses') ? ('--with-libncurses-prefix=' . BUILD_ROOT_PATH . ' ') : '';
$extra .= $this->builder->getLib('libxml2') ? ('--with-libxml2-prefix=' . BUILD_ROOT_PATH . ' ') : '';
$autoconf = UnixAutoconfExecutor::create($this)
->optionalLib('ncurses', "--with-libncurses-prefix={$this->getBuildRootPath()}")
->optionalLib('libxml2', "--with-libxml2-prefix={$this->getBuildRootPath()}")
->addConfigureArgs(
'--disable-java',
'--disable-c++',
'--with-included-gettext',
"--with-iconv-prefix={$this->getBuildRootPath()}",
);
$zts = $this->builder->getOption('enable-zts') ? '--enable-threads=isoc+posix ' : '--disable-threads ';
// zts
if ($this->builder->getOption('enable-zts')) {
$autoconf->addConfigureArgs('--enable-threads=isoc+posix')
->appendEnv([
'CFLAGS' => '-lpthread -D_REENTRANT',
'LDFLGAS' => '-lpthread',
]);
} else {
$autoconf->addConfigureArgs('--disable-threads');
}
$cflags = $this->builder->getOption('enable-zts') ? '-lpthread -D_REENTRANT' : '';
$ldflags = $this->builder->getOption('enable-zts') ? '-lpthread' : '';
shell()->cd($this->source_dir)
->setEnv([
'CFLAGS' => "{$this->getLibExtraCFlags()} {$cflags}",
'LDFLAGS' => $this->getLibExtraLdFlags() ?: $ldflags,
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv(
'./configure ' .
'--enable-static ' .
'--disable-shared ' .
'--disable-java ' .
'--disable-c++ ' .
$zts .
$extra .
'--with-included-gettext ' .
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
'--prefix=' . BUILD_ROOT_PATH
)
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
$autoconf->configure()->make(with_clean: true);
$this->patchLaDependencyPrefix();
}
}

View File

@@ -6,6 +6,7 @@ namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\util\executor\UnixAutoconfExecutor;
trait gmp
{
@@ -15,16 +16,7 @@ trait gmp
*/
protected function build(): void
{
shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => $this->getLibExtraCFlags() ?: $this->builder->arch_c_flags, 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
'./configure ' .
'--enable-static --disable-shared ' .
'--prefix='
)
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
UnixAutoconfExecutor::create($this)->configure()->make();
$this->patchPkgconfPrefix(['gmp.pc']);
}
}

View File

@@ -4,25 +4,12 @@ declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
use SPC\util\executor\UnixCMakeExecutor;
trait gmssl
{
/**
* @throws FileSystemException
* @throws RuntimeException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/build');
// Start build
shell()->cd($this->source_dir . '/build')
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv("cmake {$this->builder->makeCmakeArgs()} -DBUILD_SHARED_LIBS=OFF ..")
->execWithEnv("cmake --build . -j {$this->builder->concurrency}")
->execWithEnv('make install');
UnixCMakeExecutor::create($this)->build();
}
}

Some files were not shown because too many files have changed in this diff Show More