Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2: add version 1.8.1 #23953

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/libgit2/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.8.0":
url: "https://github.com/libgit2/libgit2/archive/v1.8.0.tar.gz"
sha256: "9e1d6a880d59026b675456fbb1593c724c68d73c34c0d214d6eb848e9bbd8ae4"
"1.7.2":
url: "https://github.com/libgit2/libgit2/archive/v1.7.2.tar.gz"
sha256: "de384e29d7efc9330c6cdb126ebf88342b5025d920dcb7c645defad85195ea7f"
Expand All @@ -21,6 +24,10 @@ sources:
url: "https://github.com/libgit2/libgit2/archive/v1.0.1.tar.gz"
sha256: "1775427a6098f441ddbaa5bd4e9b8a043c7401e450ed761e69a415530fea81d2"
patches:
"1.8.0":
- patch_file: "patches/1.8.0-0001-fix-cmake.patch"
patch_description: "use cci's packages"
patch_type: "conan"
"1.7.2":
- patch_file: "patches/1.7.2-0001-fix-cmake.patch"
patch_description: "use cci's packages"
Expand Down
2 changes: 2 additions & 0 deletions recipes/libgit2/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def generate(self):
tc.variables["REGEX_BACKEND"] = self.options.with_regex
if is_msvc(self):
tc.variables["STATIC_CRT"] = is_msvc_static_runtime(self)
if Version(self.version) >= "1.8.0":
tc.variables["USE_SSH"] = "libssh2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# REGEX_BACKEND is SET(), avoid options overriding it
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
tc.generate()
Expand Down
72 changes: 72 additions & 0 deletions recipes/libgit2/all/patches/1.8.0-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git a/cmake/SelectHTTPParser.cmake b/cmake/SelectHTTPParser.cmake
index 955aea3..ff94eb8 100644
--- a/cmake/SelectHTTPParser.cmake
+++ b/cmake/SelectHTTPParser.cmake
@@ -1,10 +1,10 @@
# Optional external dependency: http-parser
if(USE_HTTP_PARSER STREQUAL "system")
- find_package(HTTPParser)
+ find_package(http_parser)

- if(HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
- list(APPEND LIBGIT2_SYSTEM_LIBS ${HTTP_PARSER_LIBRARIES})
+ if(http_parser_FOUND)
+ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${http_parser_INCLUDE_DIRS})
+ list(APPEND LIBGIT2_SYSTEM_LIBS ${http_parser_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
add_feature_info(http-parser ON "http-parser support (system)")
else()
diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake
index d293001..acffba9 100644
--- a/cmake/SelectHTTPSBackend.cmake
+++ b/cmake/SelectHTTPSBackend.cmake
@@ -9,6 +9,11 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
endif()

if(USE_HTTPS)
+ if(WIN32)
+ list(APPEND LIBGIT2_SYSTEM_LIBS "secur32")
+ list(APPEND LIBGIT2_PC_LIBS "-lsecur32")
+ endif()
+
# Auto-select TLS backend
sanitizebool(USE_HTTPS)
if(USE_HTTPS STREQUAL ON)
diff --git a/cmake/SelectSSH.cmake b/cmake/SelectSSH.cmake
index 079857f..652b310 100644
--- a/cmake/SelectSSH.cmake
+++ b/cmake/SelectSSH.cmake
@@ -4,15 +4,11 @@ if(USE_SSH STREQUAL "exec")

add_feature_info(SSH ON "using OpenSSH exec support")
elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
- find_pkglibraries(LIBSSH2 libssh2)
-
- if(NOT LIBSSH2_FOUND)
- find_package(LibSSH2)
- set(LIBSSH2_INCLUDE_DIRS ${LIBSSH2_INCLUDE_DIR})
- get_filename_component(LIBSSH2_LIBRARY_DIRS "${LIBSSH2_LIBRARY}" DIRECTORY)
- set(LIBSSH2_LIBRARIES ${LIBSSH2_LIBRARY})
- set(LIBSSH2_LDFLAGS "-lssh2")
- endif()
+ FIND_PACKAGE(Libssh2 REQUIRED)
+ SET(LIBSSH2_FOUND ON)
+ SET(LIBSSH2_INCLUDE_DIRS ${Libssh2_INCLUDE_DIRS})
+ SET(LIBSSH2_LIBRARIES ${Libssh2_LIBRARIES})
+ SET(LIBSSH2_LIBRARY_DIRS ${Libssh2_LIB_DIRS})

if(NOT LIBSSH2_FOUND)
message(FATAL_ERROR "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
@@ -22,10 +18,7 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
list(APPEND LIBGIT2_SYSTEM_LIBS ${LIBSSH2_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})

- check_library_exists("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
- if(HAVE_LIBSSH2_MEMORY_CREDENTIALS)
- set(GIT_SSH_LIBSSH2_MEMORY_CREDENTIALS 1)
- endif()
+ set(GIT_SSH_MEMORY_CREDENTIALS 1)

if(WIN32 AND EMBED_SSH_PATH)
file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c")
2 changes: 2 additions & 0 deletions recipes/libgit2/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.8.0":
folder: "all"
"1.7.2":
folder: "all"
"1.5.0":
Expand Down
Loading