Skip to content

Commit f1a9a28

Browse files
committed
Use backup file function to avoid multiple build conflict
1 parent 6439268 commit f1a9a28

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/SPC/store/SourcePatcher.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public static function patchBeforeBuildconf(BuilderBase $builder): void
8787
}
8888

8989
// patch configure.ac
90-
/*
9190
$musl = SPCTarget::getLibc() === 'musl';
91+
FileSystem::backupFile(SOURCE_PATH . '/php-src/configure.ac');
9292
FileSystem::replaceFileStr(
9393
SOURCE_PATH . '/php-src/configure.ac',
9494
'if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1',
@@ -97,7 +97,6 @@ public static function patchBeforeBuildconf(BuilderBase $builder): void
9797
if (getenv('SPC_LIBC') === false && ($libc = SPCTarget::getLibc()) !== null) {
9898
putenv("SPC_LIBC={$libc}");
9999
}
100-
*/
101100

102101
// patch php-src/build/php.m4 PKG_CHECK_MODULES -> PKG_CHECK_MODULES_STATIC
103102
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/build/php.m4', 'PKG_CHECK_MODULES(', 'PKG_CHECK_MODULES_STATIC(');
@@ -132,6 +131,11 @@ public static function patchBeforeConfigure(BuilderBase $builder): void
132131
if (is_unix()) {
133132
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/have_capstone="yes"/', 'have_capstone="no"');
134133
}
134+
135+
if (file_exists(SOURCE_PATH . '/php-src/configure.ac.bak')) {
136+
// restore configure.ac
137+
FileSystem::restoreBackupFile(SOURCE_PATH . '/php-src/configure.ac');
138+
}
135139
}
136140

137141
/**

0 commit comments

Comments
 (0)