Skip to content

Commit b9dfb5a

Browse files
committed
maybe better this way
1 parent 565ac87 commit b9dfb5a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/SPC/builder/extension/readline.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function buildUnixShared(): void
3636
parent::buildUnixShared();
3737
}
3838

39-
public static function patchCliLinux(bool $revert = false): void
39+
public static function patchCliLinux(bool $patch): void
4040
{
41-
if (SPCTarget::getTargetOS() === 'Linux' && SPCTarget::isStatic() && !$revert) {
41+
if (SPCTarget::getTargetOS() === 'Linux' && SPCTarget::isStatic() && $patch) {
4242
FileSystem::replaceFileStr(
4343
SOURCE_PATH . '/php-src/ext/readline/readline_cli.c',
4444
"/*#else\n#define GET_SHELL_CB(cb) (cb) = php_cli_get_shell_callbacks()",

src/SPC/builder/linux/LinuxBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ public function testPHP(int $build_target = BUILD_TARGET_NONE)
171171
protected function buildCli(): void
172172
{
173173
$vars = SystemUtil::makeEnvVarString($this->getMakeExtraVars());
174-
readline::patchCliLinux();
174+
readline::patchCliLinux(true);
175175
$SPC_CMD_PREFIX_PHP_MAKE = getenv('SPC_CMD_PREFIX_PHP_MAKE') ?: 'make';
176176
shell()->cd(SOURCE_PATH . '/php-src')
177177
->exec('sed -i "s|//lib|/lib|g" Makefile')
178178
->exec("{$SPC_CMD_PREFIX_PHP_MAKE} {$vars} cli");
179-
readline::patchCliLinux(true);
179+
readline::patchCliLinux(false);
180180

181181
if (!$this->getOption('no-strip', false)) {
182182
shell()->cd(SOURCE_PATH . '/php-src/sapi/cli')->exec('strip --strip-unneeded php');

0 commit comments

Comments
 (0)