why do we have prefix= calls instead of prefix=BUILD_ROOT_DIR?

This commit is contained in:
DubbleClick
2025-05-20 22:19:09 +07:00
parent a9f81dd38e
commit 03ca3f4f59
6 changed files with 94 additions and 12 deletions

View File

@@ -84,6 +84,23 @@ trait UnixLibraryTrait
}
}
public function patchLaDependencyPrefix(array $files): void
{
logger()->info('Patching library [' . static::NAME . '] la files');
foreach ($files as $name) {
$realpath = realpath(BUILD_LIB_PATH . '/' . $name);
if ($realpath === false) {
throw new RuntimeException('Cannot find library [' . static::NAME . '] la file [' . $name . '] !');
}
logger()->debug('Patching ' . $realpath);
// replace prefix
$file = FileSystem::readFile($realpath);
$file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file);
$file = preg_replace("/^libdir=.*$/m", "libdir='" . BUILD_LIB_PATH . "'", $file);
FileSystem::writeFile($realpath, $file);
}
}
/**
* remove libtool archive files
*