commit:     a7a1759a20dc8eb4308c83c12a0b77f882006b61
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Wed May 28 17:48:11 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 26 01:57:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7a1759a

net-libs/libssh: use net-libs/mbedtls:3

Use net-libs/mbedtls:3 slot, specify required USE=threads.

Closes: https://bugs.gentoo.org/943343
Closes: https://bugs.gentoo.org/956764
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42303
Closes: https://github.com/gentoo/gentoo/pull/42303
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libssh/files/libssh-0.11.1-mbedtls-3.patch     | 55 ++++++++++++++++++++++
 ...{libssh-9999.ebuild => libssh-0.11.1-r2.ebuild} | 11 ++++-
 net-libs/libssh/libssh-9999.ebuild                 |  6 ++-
 3 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/net-libs/libssh/files/libssh-0.11.1-mbedtls-3.patch 
b/net-libs/libssh/files/libssh-0.11.1-mbedtls-3.patch
new file mode 100644
index 000000000000..3edf212ec33c
--- /dev/null
+++ b/net-libs/libssh/files/libssh-0.11.1-mbedtls-3.patch
@@ -0,0 +1,55 @@
+From 
https://gitlab.com/libssh/libssh-mirror/-/commit/7712c7d0f97241c68e520d600b5857ebfcfd7439
+From: Davidwed <[email protected]>
+Date: Tue, 3 Sep 2024 11:43:32 +0200
+Subject: [PATCH] cmake: Fixed compatibility issues with "CPM.cmake" in
+ combination with the libraries MBedTLS and libgcrypt.
+
+Signed-off-by: Davidwed <[email protected]>
+Reviewed-by: Jakub Jelen <[email protected]>
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ set(LIBSSH_PUBLIC_INCLUDE_DIRS ${libssh_SOURCE_DIR}/include)
+ 
+ set(LIBSSH_PRIVATE_INCLUDE_DIRS
++  ${libssh_BINARY_DIR}/include
+   ${libssh_BINARY_DIR}
+ )
+ 
+@@ -12,27 +13,13 @@ if (TARGET OpenSSL::Crypto)
+   list(APPEND LIBSSH_LINK_LIBRARIES OpenSSL::Crypto)
+ endif ()
+ 
+-if (MBEDTLS_CRYPTO_LIBRARY)
+-    set(LIBSSH_PRIVATE_INCLUDE_DIRS
+-      ${LIBSSH_PRIVATE_INCLUDE_DIRS}
+-      ${MBEDTLS_INCLUDE_DIR}
+-    )
+-  set(LIBSSH_LINK_LIBRARIES
+-    ${LIBSSH_LINK_LIBRARIES}
+-    ${MBEDTLS_CRYPTO_LIBRARY}
+-  )
+-endif (MBEDTLS_CRYPTO_LIBRARY)
+-
+-if (GCRYPT_LIBRARIES)
+-  set(LIBSSH_PRIVATE_INCLUDE_DIRS
+-    ${LIBSSH_PRIVATE_INCLUDE_DIRS}
+-    ${GCRYPT_INCLUDE_DIR}
+-  )
++if (TARGET MbedTLS::mbedcrypto)
++  list(APPEND LIBSSH_LINK_LIBRARIES MbedTLS::mbedcrypto)
++endif ()
+ 
+-  set(LIBSSH_LINK_LIBRARIES
+-    ${LIBSSH_LINK_LIBRARIES}
+-    ${GCRYPT_LIBRARIES})
+-endif()
++if (TARGET libgcrypt::libgcrypt)
++  list(APPEND LIBSSH_LINK_LIBRARIES ${GCRYPT_LIBRARIES})
++endif ()
+ 
+ if (WITH_ZLIB)
+   list(APPEND LIBSSH_LINK_LIBRARIES ZLIB::ZLIB)
+-- 
+GitLab
+

diff --git a/net-libs/libssh/libssh-9999.ebuild 
b/net-libs/libssh/libssh-0.11.1-r2.ebuild
similarity index 91%
copy from net-libs/libssh/libssh-9999.ebuild
copy to net-libs/libssh/libssh-0.11.1-r2.ebuild
index 956a471414a6..3f0e3cafd0e2 100644
--- a/net-libs/libssh/libssh-9999.ebuild
+++ b/net-libs/libssh/libssh-0.11.1-r2.ebuild
@@ -26,7 +26,7 @@ RESTRICT="!test? ( test )"
 RDEPEND="
        !mbedtls? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
        gssapi? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
-       mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
+       mbedtls? ( net-libs/mbedtls:3=[${MULTILIB_USEDEP},threads] )
        zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
 "
 DEPEND="${RDEPEND}
@@ -39,7 +39,15 @@ BDEPEND="doc? ( app-text/doxygen[dot] )"
 
 DOCS=( AUTHORS CHANGELOG README )
 
+PATCHES=(
+       "${FILESDIR}/${PN}-0.11.1-openssh-10.patch"
+       "${FILESDIR}/${PN}-0.11.1-mbedtls-3.patch"
+)
+
 src_prepare() {
+       # Remove custom find module to use system one
+       rm -fr cmake/Modules/FindMbedTLS.cmake
+
        cmake_src_prepare
 
        # just install the examples, do not compile them
@@ -88,6 +96,7 @@ multilib_src_configure() {
                -DWITH_GCRYPT=OFF
                -DWITH_GSSAPI=$(usex gssapi)
                -DWITH_MBEDTLS=$(usex mbedtls)
+               -DMBEDTLS_FOUND=$(usex mbedtls) # Enforce variable from custom 
find module
                -DWITH_PCAP=$(usex pcap)
                -DWITH_SERVER=$(usex server)
                -DWITH_SFTP=$(usex sftp)

diff --git a/net-libs/libssh/libssh-9999.ebuild 
b/net-libs/libssh/libssh-9999.ebuild
index 956a471414a6..34ef848dd1eb 100644
--- a/net-libs/libssh/libssh-9999.ebuild
+++ b/net-libs/libssh/libssh-9999.ebuild
@@ -26,7 +26,7 @@ RESTRICT="!test? ( test )"
 RDEPEND="
        !mbedtls? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
        gssapi? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
-       mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
+       mbedtls? ( net-libs/mbedtls:3=[${MULTILIB_USEDEP},threads] )
        zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
 "
 DEPEND="${RDEPEND}
@@ -40,6 +40,9 @@ BDEPEND="doc? ( app-text/doxygen[dot] )"
 DOCS=( AUTHORS CHANGELOG README )
 
 src_prepare() {
+       # Remove custom find module to use system one
+       rm -fr cmake/Modules/FindMbedTLS.cmake
+
        cmake_src_prepare
 
        # just install the examples, do not compile them
@@ -88,6 +91,7 @@ multilib_src_configure() {
                -DWITH_GCRYPT=OFF
                -DWITH_GSSAPI=$(usex gssapi)
                -DWITH_MBEDTLS=$(usex mbedtls)
+               -DMBEDTLS_FOUND=$(usex mbedtls) # Enforce variable from custom 
find module
                -DWITH_PCAP=$(usex pcap)
                -DWITH_SERVER=$(usex server)
                -DWITH_SFTP=$(usex sftp)

Reply via email to