From: Changqing Li <[email protected]>

This commit is for breaking circular dependency in following condition:
After enabling PACKAGECONFIG nghttp2 for curl, the dependency chain is:
curl-native -> nghttp2-native -> cmake-native -> curl-native.
So change to use internal cmcurl library to fix this. And as using
system curl library before, disable nghttp2 and use system openssl
library for cmcurl.

Signed-off-by: Changqing Li <[email protected]>
---
 .../cmake/cmake-native_3.25.1.bb              |  8 +++--
 ...1-CMakeLists.txt-disable-USE_NGHTTP2.patch | 31 +++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 
meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch

diff --git a/meta/recipes-devtools/cmake/cmake-native_3.25.1.bb 
b/meta/recipes-devtools/cmake/cmake-native_3.25.1.bb
index bcc87eb8f2..c150aef5ef 100644
--- a/meta/recipes-devtools/cmake/cmake-native_3.25.1.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.25.1.bb
@@ -1,21 +1,23 @@
 require cmake.inc
 inherit native
 
-DEPENDS += "bzip2-replacement-native xz-native zlib-native curl-native 
ncurses-native zstd-native"
+DEPENDS += "bzip2-replacement-native xz-native zlib-native ncurses-native 
zstd-native openssl-native"
 
 SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \
             
file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \
             
file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \
+            file://0001-CMakeLists.txt-disable-USE_NGHTTP2.patch \
             "
 
-LICENSE:append = " & BSD-1-Clause & MIT & BSD-2-Clause"
+LICENSE:append = " & BSD-1-Clause & MIT & BSD-2-Clause & curl"
 LIC_FILES_CHKSUM:append = " \
     file://Utilities/cmjsoncpp/LICENSE;md5=5d73c165a0f9e86a1342f32d19ec5926 \
     file://Utilities/cmlibarchive/COPYING;md5=d499814247adaee08d88080841cb5665 
\
     file://Utilities/cmexpat/COPYING;md5=9e2ce3b3c4c0f2670883a23bbd7c37a9 \
     file://Utilities/cmlibrhash/COPYING;md5=a8c2a557a5c53b1c12cddbee98c099af \
     file://Utilities/cmlibuv/LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d \
+    file://Utilities/cmcurl/COPYING;md5=190c514872597083303371684954f238 \
 "
 
 B = "${WORKDIR}/build"
@@ -30,9 +32,9 @@ CMAKE_EXTRACONF = "\
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
     -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_CURL=0 \
     -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
     -DHAVE_SYS_ACL_H=0 \
-    -DCURL_LIBRARIES=-lcurl \
 "
 
 do_configure () {
diff --git 
a/meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch
 
b/meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch
new file mode 100644
index 0000000000..d6486cb45f
--- /dev/null
+++ 
b/meta/recipes-devtools/cmake/cmake/0001-CMakeLists.txt-disable-USE_NGHTTP2.patch
@@ -0,0 +1,31 @@
+From 3fd6082c52a8140db5995afb59fb391f7d5c19d7 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Wed, 28 Dec 2022 17:51:27 +0800
+Subject: [PATCH] CMakeLists.txt: disable USE_NGHTTP2
+
+nghttp2 depends on cmake-native to build, to break circular
+dependency, disable nghttp2.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Utilities/cmcurl/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
+index f842270b..17b1ce19 100644
+--- a/Utilities/cmcurl/CMakeLists.txt
++++ b/Utilities/cmcurl/CMakeLists.txt
+@@ -68,7 +68,7 @@ set(ENABLE_UNIX_SOCKETS OFF CACHE INTERNAL "No curl Unix 
domain sockets support"
+ set(HTTP_ONLY OFF CACHE INTERNAL "Curl is not http-only")
+ set(PICKY_COMPILER OFF CACHE INTERNAL "Enable picky compiler options")
+ set(USE_LIBIDN2 ON)
+-set(USE_NGHTTP2 ON)
++set(USE_NGHTTP2 OFF)
+ set(USE_NGTCP2 OFF)
+ set(USE_QUICHE OFF)
+ set(USE_WIN32_IDN OFF)
+-- 
+2.25.1
+
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#175089): 
https://lists.openembedded.org/g/openembedded-core/message/175089
Mute This Topic: https://lists.openembedded.org/mt/95931601/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to