From eac4763d822eb3733d34b0dbb0815d21489c12f3 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Wed, 3 Jan 2024 13:40:48 +0800 Subject: [PATCH] fix libxml2 with icu finding issue (#304) * fix libxml2 with icu finding issue * add test --- config/lib.json | 4 ---- src/SPC/builder/linux/library/libxml2.php | 6 ++++-- src/SPC/builder/macos/library/libxml2.php | 6 ++++-- src/globals/test-extensions.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config/lib.json b/config/lib.json index 25c2c6df..8ccb8091 100644 --- a/config/lib.json +++ b/config/lib.json @@ -333,10 +333,6 @@ "lib-suggests": [ "xz", "icu" - ], - "lib-suggests-windows": [ - "icu", - "xz" ] }, "libxslt": { diff --git a/src/SPC/builder/linux/library/libxml2.php b/src/SPC/builder/linux/library/libxml2.php index 82327c58..e6131224 100644 --- a/src/SPC/builder/linux/library/libxml2.php +++ b/src/SPC/builder/linux/library/libxml2.php @@ -26,7 +26,9 @@ class libxml2 extends LinuxLibraryBase shell()->cd($this->source_dir . '/build') ->exec( 'cmake ' . - "{$this->builder->makeCmakeArgs()} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . '-DBUILD_SHARED_LIBS=OFF ' . '-DIconv_IS_BUILT_IN=OFF ' . '-DLIBXML2_WITH_ICONV=ON ' . @@ -39,7 +41,7 @@ class libxml2 extends LinuxLibraryBase '..' ) ->exec("cmake --build . -j {$this->builder->concurrency}") - ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + ->exec('make install'); FileSystem::replaceFileStr( BUILD_LIB_PATH . '/pkgconfig/libxml-2.0.pc', diff --git a/src/SPC/builder/macos/library/libxml2.php b/src/SPC/builder/macos/library/libxml2.php index 50cb3a5a..4b22bc4a 100644 --- a/src/SPC/builder/macos/library/libxml2.php +++ b/src/SPC/builder/macos/library/libxml2.php @@ -27,7 +27,9 @@ class libxml2 extends MacOSLibraryBase ->exec( 'cmake ' . // '--debug-find ' . - "{$this->builder->makeCmakeArgs()} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . '-DBUILD_SHARED_LIBS=OFF ' . '-DLIBXML2_WITH_ICONV=ON ' . "-DLIBXML2_WITH_ZLIB={$enable_zlib} " . @@ -39,6 +41,6 @@ class libxml2 extends MacOSLibraryBase '..' ) ->exec("cmake --build . -j {$this->builder->concurrency}") - ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + ->exec('make install'); } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 00d69c0a..512eecbd 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -10,7 +10,7 @@ declare(strict_types=1); // --------------------------------- edit area --------------------------------- // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). -$extensions = 'swoole,swoole-hook-pgsql,swoole-hook-mysql,swoole-hook-sqlite'; +$extensions = 'xml,intl'; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = '';