mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge branch 'main' into pgsql-18
This commit is contained in:
commit
c83e803c85
@ -169,12 +169,19 @@ class LinuxBuilder extends UnixBuilderBase
|
|||||||
*/
|
*/
|
||||||
protected function buildCli(): void
|
protected function buildCli(): void
|
||||||
{
|
{
|
||||||
|
if ($this->getExt('readline')) {
|
||||||
|
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
||||||
|
}
|
||||||
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
|
||||||
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
|
||||||
shell()->cd(SOURCE_PATH . '/php-src')
|
shell()->cd(SOURCE_PATH . '/php-src')
|
||||||
->exec('sed -i "s|//lib|/lib|g" Makefile')
|
->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->getExt('readline')) {
|
||||||
|
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src', true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip', false)) {
|
||||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/cli')->exec('strip --strip-unneeded php');
|
shell()->cd(SOURCE_PATH . '/php-src/sapi/cli')->exec('strip --strip-unneeded php');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ trait ncurses
|
|||||||
->make();
|
->make();
|
||||||
$final = FileSystem::scanDirFiles(BUILD_BIN_PATH, relative: true);
|
$final = FileSystem::scanDirFiles(BUILD_BIN_PATH, relative: true);
|
||||||
// Remove the new files
|
// Remove the new files
|
||||||
$new_files = array_diff($final, $filelist);
|
$new_files = array_diff($final, $filelist ?: []);
|
||||||
foreach ($new_files as $file) {
|
foreach ($new_files as $file) {
|
||||||
@unlink(BUILD_BIN_PATH . '/' . $file);
|
@unlink(BUILD_BIN_PATH . '/' . $file);
|
||||||
}
|
}
|
||||||
|
|||||||
26
src/globals/patch/musl_static_readline.patch
Normal file
26
src/globals/patch/musl_static_readline.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c
|
||||||
|
index 31212999..d80a21c3 100644
|
||||||
|
--- a/ext/readline/readline_cli.c
|
||||||
|
+++ b/ext/readline/readline_cli.c
|
||||||
|
@@ -739,8 +739,8 @@ typedef cli_shell_callbacks_t *(__cdecl *get_cli_shell_callbacks)(void);
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#else
|
||||||
|
-/*
|
||||||
|
#ifdef COMPILE_DL_READLINE
|
||||||
|
+/*
|
||||||
|
This dlsym() is always used as even the CGI SAPI is linked against "CLI"-only
|
||||||
|
extensions. If that is being changed dlsym() should only be used when building
|
||||||
|
this extension sharedto offer compatibility.
|
||||||
|
@@ -754,9 +754,9 @@ this extension sharedto offer compatibility.
|
||||||
|
(cb) = get_callbacks(); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
-/*#else
|
||||||
|
+#else
|
||||||
|
#define GET_SHELL_CB(cb) (cb) = php_cli_get_shell_callbacks()
|
||||||
|
-#endif*/
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PHP_MINIT_FUNCTION(cli_readline)
|
||||||
Loading…
x
Reference in New Issue
Block a user