This commit is contained in:
DubbleClick 2025-05-21 14:15:58 +07:00
parent 7698ceb108
commit 3f8d297fb1
6 changed files with 8 additions and 13 deletions

View File

@ -74,7 +74,6 @@ class curl extends Extension
// Match the line containing PHP_CHECK_LIBRARY for curl // Match the line containing PHP_CHECK_LIBRARY for curl
$pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/'; $pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/';
// Restore LIBS after the check — append this just after the macro block // Restore LIBS after the check — append this just after the macro block
$restore = ' $restore = '
LIBS="$save_LIBS"'; LIBS="$save_LIBS"';
@ -87,13 +86,13 @@ class curl extends Extension
// Inject restore after the matching PHP_CHECK_LIBRARY block // Inject restore after the matching PHP_CHECK_LIBRARY block
$patched = preg_replace( $patched = preg_replace(
'/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s', '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s',
"$1$restore\n", "$1{$restore}\n",
$patched, $patched,
1 1
); );
if ($patched === null) { if ($patched === null) {
throw new \RuntimeException("Failed to patch config.m4 due to a regex error"); throw new \RuntimeException('Failed to patch config.m4 due to a regex error');
} }
FileSystem::writeFile($file, $patched); FileSystem::writeFile($file, $patched);

View File

@ -21,11 +21,6 @@ class mbregex extends Extension
return ''; return '';
} }
public function buildUnixShared(): void
{
print('mbregex is already built as part of mbstring, skipping build' . PHP_EOL);
}
/** /**
* mbregex is not an extension, we need to overwrite the default check. * mbregex is not an extension, we need to overwrite the default check.
*/ */

View File

@ -64,5 +64,6 @@ class sqlsrv extends Extension
// check shared extension with php-cli // check shared extension with php-cli
if (file_exists(BUILD_BIN_PATH . '/php')) { if (file_exists(BUILD_BIN_PATH . '/php')) {
$this->runSharedExtensionCheckUnix(); $this->runSharedExtensionCheckUnix();
} } }
}
} }

View File

@ -29,7 +29,7 @@ class xml extends Extension
'simplexml' => '--enable-simplexml', 'simplexml' => '--enable-simplexml',
default => throw new RuntimeException('Not accept non-xml extension'), default => throw new RuntimeException('Not accept non-xml extension'),
}; };
$arg .= ($shared ? '=shared' : '' ) . ' --with-libxml="' . BUILD_ROOT_PATH . '"'; $arg .= ($shared ? '=shared' : '') . ' --with-libxml="' . BUILD_ROOT_PATH . '"';
return $arg; return $arg;
} }

View File

@ -95,8 +95,8 @@ trait UnixLibraryTrait
logger()->debug('Patching ' . $realpath); logger()->debug('Patching ' . $realpath);
// replace prefix // replace prefix
$file = FileSystem::readFile($realpath); $file = FileSystem::readFile($realpath);
$file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file); $file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file);
$file = preg_replace("/^libdir=.*$/m", "libdir='" . BUILD_LIB_PATH . "'", $file); + $file = preg_replace('/^libdir=.*$/m', "libdir='" . BUILD_LIB_PATH . "'", $file);
FileSystem::writeFile($realpath, $file); FileSystem::writeFile($realpath, $file);
} }
} }