fixup(cmake): Do not depend on dependencies of libcurl and libarchive

Do not pass `-DCMAKE_USE_SYSTEM_{BZIP2,LIBLZMA,NGHTTP2,ZSTD}` to cmake.

libbz2 and liblzma are dependencies of libarchive. CMake does have an option to use zstd because libarchive supports linking to zstd (as a side note, we are building libarchive without zstd).

libnghttp2 is dependency of libcurl.

CMake's CMakeLists.txt does have options for these libraries in case we are not using shared libarchive and libcurl but wish to link against shared libraries of dependencies of libcurl and libarchive. In case we tell CMake to use shared libarchive and libcurl, these options are basically ignored (i.e. they don't anyway affect the build), which we are doing right now. So there's no need of these options at all!

Lastly, `-DCMAKE_USE_SYSTEM_ZLIB` needs to be specified because CMake does directly link against zlib. Perhaps making this option depend on `"NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL"` in CMakeLists.txt:197 is a mistake. Reporting this to upstream might make sense
This commit is contained in:
Yaksh Bariya 2022-04-02 09:04:01 +05:30
parent 48875bf416
commit 6accd4396e
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
1 changed files with 2 additions and 5 deletions

View File

@ -4,21 +4,18 @@ TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
# When updating version here, please update termux_setup_cmake.sh as well.
TERMUX_PKG_VERSION=3.23.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://www.cmake.org/files/v${TERMUX_PKG_VERSION:0:4}/cmake-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=5ab0a12f702f44013be7e19534cd9094d65cc9fe7b2cd0f8c9e5318e0fe4ac82
TERMUX_PKG_DEPENDS="clang, libarchive, libc++, libcurl, libexpat, jsoncpp, liblzma, libnghttp2, libuv, make, rhash, zlib, zstd"
TERMUX_PKG_DEPENDS="clang, libarchive, libc++, libcurl, libexpat, jsoncpp, libuv, make, rhash, zlib"
TERMUX_PKG_FORCE_CMAKE=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DCMAKE_USE_SYSTEM_BZIP2=ON
-DCMAKE_USE_SYSTEM_CURL=ON
-DCMAKE_USE_SYSTEM_EXPAT=ON
-DCMAKE_USE_SYSTEM_FORM=ON
-DCMAKE_USE_SYSTEM_JSONCPP=ON
-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON
-DCMAKE_USE_SYSTEM_LIBLZMA=ON
-DCMAKE_USE_SYSTEM_LIBRHASH=ON
-DCMAKE_USE_SYSTEM_LIBUV=ON
-DCMAKE_USE_SYSTEM_NGHTTP2=ON
-DCMAKE_USE_SYSTEM_ZLIB=ON
-DCMAKE_USE_SYSTEM_ZSTD=ON
-DBUILD_CursesDialog=ON"