mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
fix undefined references to brotlicommon functions in gd.so
This commit is contained in:
parent
11c116480f
commit
3ff31d20cf
@ -268,8 +268,7 @@ abstract class BuilderBase
|
||||
logger()->info('Building extension [' . $ext->getName() . '] as shared extension (' . $ext->getName() . '.so)');
|
||||
$ext->buildShared();
|
||||
}
|
||||
}
|
||||
catch (RuntimeException $e) {
|
||||
} catch (RuntimeException $e) {
|
||||
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@ -96,7 +96,10 @@ trait UnixLibraryTrait
|
||||
// replace prefix
|
||||
$file = FileSystem::readFile($realpath);
|
||||
$file = str_replace(
|
||||
' /lib/', ' ' . BUILD_LIB_PATH . '/', $file);
|
||||
' /lib/',
|
||||
' ' . BUILD_LIB_PATH . '/',
|
||||
$file
|
||||
);
|
||||
$file = preg_replace('/^libdir=.*$/m', "libdir='" . BUILD_LIB_PATH . "'", $file);
|
||||
FileSystem::writeFile($realpath, $file);
|
||||
}
|
||||
|
||||
@ -36,6 +36,8 @@ trait brotli
|
||||
->execWithEnv("cmake --build . -j {$this->builder->concurrency}")
|
||||
->execWithEnv('make install');
|
||||
$this->patchPkgconfPrefix(['libbrotlicommon.pc', 'libbrotlidec.pc', 'libbrotlienc.pc']);
|
||||
FileSystem::replaceFileLineContainsString(BUILD_LIB_PATH . '/pkgconfig/libbrotlidec.pc', 'Libs: -L${libdir} -lbrotlidec', 'Libs: -L${libdir} -lbrotlidec -lbrotlicommon');
|
||||
FileSystem::replaceFileLineContainsString(BUILD_LIB_PATH . '/pkgconfig/libbrotlienc.pc', 'Libs: -L${libdir} -lbrotlienc', 'Libs: -L${libdir} -lbrotlidec -lbrotlicommon');
|
||||
shell()->cd(BUILD_ROOT_PATH . '/lib')->exec('ln -sf libbrotlicommon.a libbrotli.a');
|
||||
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
|
||||
if (str_starts_with($filename, 'libbrotli') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user