mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
Allow absolute paths for configs
This commit is contained in:
parent
3ff762c4c8
commit
df6c27c98d
@ -33,22 +33,28 @@ class LibraryPackage extends Package
|
|||||||
public function isInstalled(): bool
|
public function isInstalled(): bool
|
||||||
{
|
{
|
||||||
foreach (PackageConfig::get($this->getName(), 'static-libs', []) as $lib) {
|
foreach (PackageConfig::get($this->getName(), 'static-libs', []) as $lib) {
|
||||||
if (!file_exists("{$this->getLibDir()}/{$lib}")) {
|
$path = FileSystem::isRelativePath($lib) ? "{$this->getLibDir()}/{$lib}" : $lib;
|
||||||
|
if (!file_exists($path)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (PackageConfig::get($this->getName(), 'headers', []) as $header) {
|
foreach (PackageConfig::get($this->getName(), 'headers', []) as $header) {
|
||||||
if (!file_exists("{$this->getIncludeDir()}/{$header}")) {
|
$path = FileSystem::isRelativePath($header) ? "{$this->getIncludeDir()}/{$header}" : $header;
|
||||||
|
if (!file_exists($path)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $pc) {
|
foreach (PackageConfig::get($this->getName(), 'pkg-configs', []) as $pc) {
|
||||||
if (!file_exists("{$this->getLibDir()}/pkgconfig/{$pc}.pc")) {
|
if (!str_ends_with($pc, '.pc')) {
|
||||||
|
$pc .= '.pc';
|
||||||
|
}
|
||||||
|
if (!file_exists("{$this->getLibDir()}/pkgconfig/{$pc}")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (PackageConfig::get($this->getName(), 'static-bins', []) as $bin) {
|
foreach (PackageConfig::get($this->getName(), 'static-bins', []) as $bin) {
|
||||||
if (!file_exists("{$this->getBinDir()}/{$bin}")) {
|
$path = FileSystem::isRelativePath($bin) ? "{$this->getBinDir()}/{$bin}" : $bin;
|
||||||
|
if (!file_exists($path)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user