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": [
|
"static-libs-unix": [
|
||||||
"libiconv.a",
|
"libiconv.a",
|
||||||
"libcharset.a"
|
"libcharset.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"iconv.h",
|
||||||
|
"libcharset.h",
|
||||||
|
"localcharset.h"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libiconv-win": {
|
"libiconv-win": {
|
||||||
@ -860,10 +865,17 @@
|
|||||||
"pkg-configs": [
|
"pkg-configs": [
|
||||||
"openssl"
|
"openssl"
|
||||||
],
|
],
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libssl.a",
|
||||||
|
"libcrypto.a"
|
||||||
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"libssl.lib",
|
"libssl.lib",
|
||||||
"libcrypto.lib"
|
"libcrypto.lib"
|
||||||
],
|
],
|
||||||
|
"headers": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
@ -970,6 +982,11 @@
|
|||||||
"odbccr",
|
"odbccr",
|
||||||
"odbcinst"
|
"odbcinst"
|
||||||
],
|
],
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libodbc.a",
|
||||||
|
"libodbccr.a",
|
||||||
|
"libodbcinst.a"
|
||||||
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libiconv"
|
"libiconv"
|
||||||
]
|
]
|
||||||
@ -1014,6 +1031,10 @@
|
|||||||
],
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"zlib_a.lib"
|
"zlib_a.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"zlib.h",
|
||||||
|
"zconf.h"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"zstd": {
|
"zstd": {
|
||||||
@ -1021,10 +1042,18 @@
|
|||||||
"pkg-configs": [
|
"pkg-configs": [
|
||||||
"libzstd"
|
"libzstd"
|
||||||
],
|
],
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libzstd.a"
|
||||||
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"zstd.lib",
|
"zstd.lib",
|
||||||
"zstd_static.lib"
|
"zstd_static.lib"
|
||||||
],
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"zdict.h",
|
||||||
|
"zstd.h",
|
||||||
|
"zstd_errors.h"
|
||||||
|
],
|
||||||
"headers-windows": [
|
"headers-windows": [
|
||||||
"zstd.h",
|
"zstd.h",
|
||||||
"zstd_errors.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);
|
FileSystem::extractPackage($install_file, $lock['source_type'], DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
||||||
$this->install();
|
$this->install();
|
||||||
return LIB_STATUS_OK;
|
return LIB_STATUS_OK;
|
||||||
} catch (SPCException $e) {
|
}
|
||||||
|
catch (SPCException $e) {
|
||||||
logger()->error('Failed to extract pre-built library [' . static::NAME . ']: ' . $e->getMessage());
|
logger()->error('Failed to extract pre-built library [' . static::NAME . ']: ' . $e->getMessage());
|
||||||
return LIB_STATUS_INSTALL_FAILED;
|
return LIB_STATUS_INSTALL_FAILED;
|
||||||
}
|
}
|
||||||
@ -365,6 +366,25 @@ abstract class LibraryBase
|
|||||||
|
|
||||||
protected function isLibraryInstalled(): bool
|
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) {
|
foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) {
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
||||||
return false;
|
return false;
|
||||||
@ -375,20 +395,6 @@ abstract class LibraryBase
|
|||||||
return false;
|
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) {
|
foreach (Config::getLib(static::NAME, 'bin', []) as $name) {
|
||||||
if (!file_exists(BUILD_BIN_PATH . "/{$name}")) {
|
if (!file_exists(BUILD_BIN_PATH . "/{$name}")) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user