mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
bring back lib info
This commit is contained in:
parent
b518237bb2
commit
bae2eae2b0
@ -470,6 +470,11 @@
|
||||
"static-libs-unix": [
|
||||
"libiconv.a",
|
||||
"libcharset.a"
|
||||
],
|
||||
"headers": [
|
||||
"iconv.h",
|
||||
"libcharset.h",
|
||||
"localcharset.h"
|
||||
]
|
||||
},
|
||||
"libiconv-win": {
|
||||
@ -860,10 +865,17 @@
|
||||
"pkg-configs": [
|
||||
"openssl"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libssl.a",
|
||||
"libcrypto.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"libssl.lib",
|
||||
"libcrypto.lib"
|
||||
],
|
||||
"headers": [
|
||||
"openssl"
|
||||
],
|
||||
"lib-depends": [
|
||||
"zlib"
|
||||
]
|
||||
@ -970,6 +982,11 @@
|
||||
"odbccr",
|
||||
"odbcinst"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libodbc.a",
|
||||
"libodbccr.a",
|
||||
"libodbcinst.a"
|
||||
],
|
||||
"lib-depends": [
|
||||
"libiconv"
|
||||
]
|
||||
@ -1014,6 +1031,10 @@
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"zlib_a.lib"
|
||||
],
|
||||
"headers": [
|
||||
"zlib.h",
|
||||
"zconf.h"
|
||||
]
|
||||
},
|
||||
"zstd": {
|
||||
@ -1021,10 +1042,18 @@
|
||||
"pkg-configs": [
|
||||
"libzstd"
|
||||
],
|
||||
"static-libs-unix": [
|
||||
"libzstd.a"
|
||||
],
|
||||
"static-libs-windows": [
|
||||
"zstd.lib",
|
||||
"zstd_static.lib"
|
||||
],
|
||||
"headers-unix": [
|
||||
"zdict.h",
|
||||
"zstd.h",
|
||||
"zstd_errors.h"
|
||||
],
|
||||
"headers-windows": [
|
||||
"zstd.h",
|
||||
"zstd_errors.h"
|
||||
|
||||
@ -154,7 +154,8 @@ abstract class LibraryBase
|
||||
FileSystem::extractPackage($install_file, $lock['source_type'], DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
||||
$this->install();
|
||||
return LIB_STATUS_OK;
|
||||
} catch (SPCException $e) {
|
||||
}
|
||||
catch (SPCException $e) {
|
||||
logger()->error('Failed to extract pre-built library [' . static::NAME . ']: ' . $e->getMessage());
|
||||
return LIB_STATUS_INSTALL_FAILED;
|
||||
}
|
||||
@ -365,6 +366,25 @@ abstract class LibraryBase
|
||||
|
||||
protected function isLibraryInstalled(): bool
|
||||
{
|
||||
$pkg_configs = Config::getLib(static::NAME, 'pkg-configs', []);
|
||||
if (count($pkg_configs) !== 0) {
|
||||
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||
$search_paths = array_unique(array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path)));
|
||||
|
||||
foreach ($pkg_configs as $name) {
|
||||
$found = false;
|
||||
foreach ($search_paths as $path) {
|
||||
if (file_exists($path . "/{$name}.pc")) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true; // allow using system dependencies if pkg_config_path is explicitly defined
|
||||
}
|
||||
foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) {
|
||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
||||
return false;
|
||||
@ -375,20 +395,6 @@ abstract class LibraryBase
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$pkg_config_path = getenv('PKG_CONFIG_PATH') ?: '';
|
||||
$search_paths = array_unique(array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path)));
|
||||
foreach (Config::getLib(static::NAME, 'pkg-configs', []) as $name) {
|
||||
$found = false;
|
||||
foreach ($search_paths as $path) {
|
||||
if (file_exists($path . "/{$name}.pc")) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
foreach (Config::getLib(static::NAME, 'bin', []) as $name) {
|
||||
if (!file_exists(BUILD_BIN_PATH . "/{$name}")) {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user