Use no optional libs for libxml2

This commit is contained in:
crazywhalecc
2026-03-05 08:11:41 +08:00
parent 174ef3dba7
commit 00c08e0c0c
3 changed files with 11 additions and 10 deletions

View File

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

View File

@@ -17,17 +17,13 @@ class libxml2
public function buildForLinux(LibraryPackage $lib): void public function buildForLinux(LibraryPackage $lib): void
{ {
UnixCMakeExecutor::create($lib) 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( ->addConfigureArgs(
'-DLIBXML2_WITH_ICONV=ON', '-DLIBXML2_WITH_ICONV=ON',
'-DIconv_IS_BUILT_IN=OFF', '-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_ICU=OFF', // optional, but discouraged: https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/README.md
'-DLIBXML2_WITH_PYTHON=OFF', '-DLIBXML2_WITH_PYTHON=OFF',
'-DLIBXML2_WITH_PROGRAMS=OFF', '-DLIBXML2_WITH_PROGRAMS=OFF',

View File

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