Use no optional libs for libxml2

This commit is contained in:
crazywhalecc 2026-03-05 08:11:41 +08:00
parent 174ef3dba7
commit 00c08e0c0c
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
3 changed files with 11 additions and 10 deletions

View File

@ -10,9 +10,8 @@ libxml2:
license: MIT
depends@unix:
- libiconv
suggests@unix:
- xz
- zlib
- xz
headers:
- libxml2
pkg-configs:

View File

@ -17,17 +17,13 @@ class libxml2
public function buildForLinux(LibraryPackage $lib): void
{
UnixCMakeExecutor::create($lib)
->optionalPackage(
'zlib',
'-DLIBXML2_WITH_ZLIB=ON ' .
"-DZLIB_LIBRARY={$lib->getLibDir()}/libz.a " .
"-DZLIB_INCLUDE_DIR={$lib->getIncludeDir()}",
'-DLIBXML2_WITH_ZLIB=OFF',
)
->optionalPackage('xz', ...cmake_boolean_args('LIBXML2_WITH_LZMA'))
->addConfigureArgs(
'-DLIBXML2_WITH_ICONV=ON',
'-DIconv_IS_BUILT_IN=OFF',
'-DLIBXML2_WITH_ZLIB=ON',
"-DZLIB_LIBRARY={$lib->getLibDir()}/libz.a",
"-DZLIB_INCLUDE_DIR={$lib->getIncludeDir()}",
'-DLIBXML2_WITH_LZMA=ON',
'-DLIBXML2_WITH_ICU=OFF', // optional, but discouraged: https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/README.md
'-DLIBXML2_WITH_PYTHON=OFF',
'-DLIBXML2_WITH_PROGRAMS=OFF',

View File

@ -19,6 +19,7 @@ class ArtifactCache
* dirname?: string,
* extract: null|'&custom'|string,
* hash: null|string,
* time: int,
* downloader: null|string
* },
* binary: array{
@ -29,6 +30,7 @@ class ArtifactCache
* dirname?: string,
* extract: null|'&custom'|string,
* hash: null|string,
* time: int,
* version?: null|string,
* downloader: null|string
* }
@ -108,6 +110,7 @@ class ArtifactCache
'filename' => $download_result->filename,
'extract' => $download_result->extract,
'hash' => sha1_file(DOWNLOAD_PATH . '/' . $download_result->filename),
'time' => time(),
'version' => $download_result->version,
'config' => $download_result->config,
'downloader' => $download_result->downloader,
@ -119,6 +122,7 @@ class ArtifactCache
'filename' => $download_result->filename,
'extract' => $download_result->extract,
'hash' => sha1_file(DOWNLOAD_PATH . '/' . $download_result->filename),
'time' => time(),
'version' => $download_result->version,
'config' => $download_result->config,
'downloader' => $download_result->downloader,
@ -130,6 +134,7 @@ class ArtifactCache
'dirname' => $download_result->dirname,
'extract' => $download_result->extract,
'hash' => trim(exec('cd ' . escapeshellarg(DOWNLOAD_PATH . '/' . $download_result->dirname) . ' && ' . SPC_GIT_EXEC . ' rev-parse HEAD')),
'time' => time(),
'version' => $download_result->version,
'config' => $download_result->config,
'downloader' => $download_result->downloader,
@ -141,6 +146,7 @@ class ArtifactCache
'dirname' => $download_result->dirname,
'extract' => $download_result->extract,
'hash' => null,
'time' => time(),
'version' => $download_result->version,
'config' => $download_result->config,
'downloader' => $download_result->downloader,