mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Patch only when building cli
This commit is contained in:
parent
e621e4a5a1
commit
be7c002869
@ -170,12 +170,19 @@ class LinuxBuilder extends UnixBuilderBase
|
||||
*/
|
||||
protected function buildCli(): void
|
||||
{
|
||||
if ($this->getExt('readline')) {
|
||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
||||
}
|
||||
$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");
|
||||
|
||||
if ($this->getExt('readline')) {
|
||||
SourcePatcher::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src', true);
|
||||
}
|
||||
|
||||
if (!$this->getOption('no-strip', false)) {
|
||||
shell()->cd(SOURCE_PATH . '/php-src/sapi/cli')->exec('strip --strip-unneeded php');
|
||||
}
|
||||
|
||||
@ -23,7 +23,6 @@ class SourcePatcher
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchPhpLibxml212']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchGDWin32']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchFfiCentos7FixO3strncmp']);
|
||||
FileSystem::addSourceExtractHook('php-src', [__CLASS__, 'patchStaticReadline']);
|
||||
FileSystem::addSourceExtractHook('sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||
FileSystem::addSourceExtractHook('pdo_sqlsrv', [__CLASS__, 'patchSQLSRVWin32']);
|
||||
FileSystem::addSourceExtractHook('yaml', [__CLASS__, 'patchYamlWin32']);
|
||||
@ -501,12 +500,6 @@ class SourcePatcher
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function patchStaticReadline(): bool
|
||||
{
|
||||
self::patchFile('musl_static_readline.patch', SOURCE_PATH . '/php-src');
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function patchPkgConfigForGcc15(): bool
|
||||
{
|
||||
self::patchFile('pkg-config_gcc15.patch', SOURCE_PATH . '/pkg-config');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user