File tree Expand file tree Collapse file tree 5 files changed +20
-9
lines changed
docs/.vitepress/components Expand file tree Collapse file tree 5 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -379,6 +379,11 @@ const craftCommandString = computed(() => {
379379 str += ' debug: true\n ' ;
380380 }
381381
382+ if (preBuilt .value ) {
383+ str += ' download-options:\n ' ;
384+ str += ' prefer-pre-built: true\n ' ;
385+ }
386+
382387 str += ' {{position_hold}}' ;
383388
384389 if (enableUPX .value ) {
@@ -387,9 +392,6 @@ const craftCommandString = computed(() => {
387392 if (zts .value ) {
388393 str += ' enable-zts: true\n ' ;
389394 }
390- if (preBuilt .value ) {
391- str += ' prefer-pre-built: true\n ' ;
392- }
393395
394396 if (! str .endsWith (' {{position_hold}}' )) {
395397 str = str .replace (' {{position_hold}}' , ' build-options:\n ' );
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ parameters:
99 - ' #Attribute class JetBrains\\PhpStorm\\ArrayShape does not exist #'
1010 - ' #Function Swoole\\Coroutine\\run not found. #'
1111 - ' #Static call to instance method ZM\\Logger\\ConsoleColor #'
12+ - ' #Constant GNU_ARCH not found #'
1213 dynamicConstantNames :
1314 - PHP_OS_FAMILY
1415 excludePaths :
Original file line number Diff line number Diff line change @@ -279,11 +279,8 @@ protected function buildFrankenphp(): void
279279 logger ()->warning ('caddy-cbrotli module is enabled, but brotli library is not built. Disabling caddy-cbrotli. ' );
280280 $ xcaddyModules = str_replace ('--with github.com/dunglas/caddy-cbrotli ' , '' , $ xcaddyModules );
281281 }
282- $ releaseInfo = json_decode (Downloader::curlExec (
283- 'https://api.github.com/repos/php/frankenphp/releases/latest ' ,
284- hooks: [[CurlHook::class, 'setupGithubToken ' ]],
285- ), true );
286- $ frankenPhpVersion = $ releaseInfo ['tag_name ' ];
282+ [, $ out ] = shell ()->execWithResult ('go list -m github.com/dunglas/frankenphp@latest ' );
283+ $ frankenPhpVersion = str_replace ('github.com/dunglas/frankenphp v ' , '' , $ out [0 ]);
287284 $ libphpVersion = $ this ->getPHPVersion ();
288285 $ dynamic_exports = '' ;
289286 if (getenv ('SPC_CMD_VAR_PHP_EMBED_TYPE ' ) === 'shared ' ) {
Original file line number Diff line number Diff line change 44
55namespace SPC \builder \unix \library ;
66
7+ use SPC \exception \WrongUsageException ;
78use SPC \util \executor \UnixAutoconfExecutor ;
89
910trait unixodbc
1011{
1112 protected function build (): void
1213 {
14+ $ sysconf_selector = match (PHP_OS_FAMILY ) {
15+ 'Darwin ' => match (GNU_ARCH ) {
16+ 'x86_64 ' => '/usr/local/etc ' ,
17+ 'aarch64 ' => '/opt/homebrew/etc ' ,
18+ default => throw new WrongUsageException ('Unsupported architecture: ' . GNU_ARCH ),
19+ },
20+ 'Linux ' => '/etc ' ,
21+ default => throw new WrongUsageException ('Unsupported OS: ' . PHP_OS_FAMILY ),
22+ };
1323 UnixAutoconfExecutor::create ($ this )
1424 ->configure (
1525 '--disable-debug ' ,
1626 '--disable-dependency-tracking ' ,
1727 "--with-libiconv-prefix= {$ this ->getBuildRootPath ()}" ,
1828 '--with-included-ltdl ' ,
29+ "--sysconfdir= {$ sysconf_selector }" ,
1930 '--enable-gui=no ' ,
2031 )
2132 ->make ();
Original file line number Diff line number Diff line change 4343$ upx = false ;
4444
4545// whether to test frankenphp build, only available for macos and linux
46- $ frankenphp = false ;
46+ $ frankenphp = true ;
4747
4848// prefer downloading pre-built packages to speed up the build process
4949$ prefer_pre_built = false ;
You can’t perform that action at this time.
0 commit comments