From 13ee14f8f6e16c803760153ad23a5c6a27660b66 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 23 Oct 2025 15:25:55 +0800 Subject: [PATCH 1/2] libcurl: fix libssh2 deps --- packages/l/libcurl/xmake.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/l/libcurl/xmake.lua b/packages/l/libcurl/xmake.lua index 4252a2c2864..6a34ae9b918 100644 --- a/packages/l/libcurl/xmake.lua +++ b/packages/l/libcurl/xmake.lua @@ -187,6 +187,21 @@ package("libcurl") handledependency("mbedtls", "mbedtls", "MBEDTLS_INCLUDE_DIRS", {MBEDTLS_LIBRARY = "mbedtls", MBEDX509_LIBRARY = "mbedx509", MBEDCRYPTO_LIBRARY = "mbedcrypto"}) handledependency("zlib", "zlib", "ZLIB_INCLUDE_DIR", "ZLIB_LIBRARY") handledependency("zstd", "zstd", "Zstd_INCLUDE_DIR", "Zstd_LIBRARY") + + if package:dep("libssh2") then + local libssh2_deps = {"ZLIB::ZLIB", "OpenSSL::SSL", "OpenSSL::Crypto"} + if package:is_plat("windows", "mingw") then + table.join2(libssh2_deps, {"ws2_32", "user32", "crypt32", "advapi32"}) + end + io.replace("CMakeLists.txt", + "list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES})", + format("list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES} %s)", table.concat(libssh2_deps, " ")), {plain = true}) + end + + local openssl = package:dep("openssl") or package:dep("openssl3") + if openssl and not openssl:is_system() then + table.insert(configs, "-DOPENSSL_ROOT_DIR=" .. openssl:installdir()) + end import("package.tools.cmake").install(package, configs, {buildir = "build"}) end) From 9991cca5eb51834f228c7d8140d9636814da8686 Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 23 Oct 2025 15:41:16 +0800 Subject: [PATCH 2/2] apply gemini code --- packages/l/libcurl/xmake.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/l/libcurl/xmake.lua b/packages/l/libcurl/xmake.lua index 6a34ae9b918..31ef9a41843 100644 --- a/packages/l/libcurl/xmake.lua +++ b/packages/l/libcurl/xmake.lua @@ -188,8 +188,16 @@ package("libcurl") handledependency("zlib", "zlib", "ZLIB_INCLUDE_DIR", "ZLIB_LIBRARY") handledependency("zstd", "zstd", "Zstd_INCLUDE_DIR", "Zstd_LIBRARY") - if package:dep("libssh2") then - local libssh2_deps = {"ZLIB::ZLIB", "OpenSSL::SSL", "OpenSSL::Crypto"} + local libssh2 = package:dep("libssh2") + if libssh2 then + local libssh2_deps = {"ZLIB::ZLIB"} + local backend = libssh2:config("backend") + if backend == "openssl" or backend == "openssl3" then + table.join2(libssh2_deps, {"OpenSSL::SSL", "OpenSSL::Crypto"}) + elseif backend == "mbedtls" then + table.join2(libssh2_deps, {"${MBEDTLS_LIBRARIES}"}) + end + if package:is_plat("windows", "mingw") then table.join2(libssh2_deps, {"ws2_32", "user32", "crypt32", "advapi32"}) end