early-access version 2853
This commit is contained in:
55
externals/vcpkg/ports/libgit2/fix-configcmake.patch
vendored
Executable file
55
externals/vcpkg/ports/libgit2/fix-configcmake.patch
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
diff --git a/cmake/SelectRegex.cmake b/cmake/SelectRegex.cmake
|
||||
index 2a3a91b8c..cbb409350 100644
|
||||
--- a/cmake/SelectRegex.cmake
|
||||
+++ b/cmake/SelectRegex.cmake
|
||||
@@ -1,5 +1,4 @@
|
||||
# Specify regular expression implementation
|
||||
-find_package(PCRE)
|
||||
|
||||
if(REGEX_BACKEND STREQUAL "")
|
||||
check_symbol_exists(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
|
||||
@@ -33,8 +32,8 @@ elseif(REGEX_BACKEND STREQUAL "pcre")
|
||||
add_feature_info(regex ON "using system PCRE")
|
||||
set(GIT_REGEX_PCRE 1)
|
||||
|
||||
- list(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
|
||||
- list(APPEND LIBGIT2_SYSTEM_LIBS ${PCRE_LIBRARIES})
|
||||
+ find_package(unofficial-pcre CONFIG REQUIRED)
|
||||
+ list(APPEND LIBGIT2_SYSTEM_LIBS unofficial::pcre::pcre)
|
||||
list(APPEND LIBGIT2_PC_REQUIRES "libpcre")
|
||||
elseif(REGEX_BACKEND STREQUAL "regcomp")
|
||||
add_feature_info(regex ON "using system regcomp")
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index e7b54d036..6b549deef 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -298,10 +298,28 @@ if(MSVC_IDE)
|
||||
endif()
|
||||
|
||||
# Install
|
||||
-install(TARGETS git2
|
||||
+install(TARGETS git2 EXPORT unofficial-git2Targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
+
|
||||
+install(EXPORT unofficial-git2Targets
|
||||
+ NAMESPACE unofficial::git2::
|
||||
+ DESTINATION share/unofficial-git2
|
||||
+)
|
||||
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake.in"
|
||||
+[[include(CMakeFindDependencyMacro)
|
||||
+if(@USE_BUNDLED_ZLIB@ STREQUAL "OFF")
|
||||
+ find_dependency(ZLIB)
|
||||
+endif()
|
||||
+if(@REGEX_BACKEND@ STREQUAL "pcre")
|
||||
+ find_dependency(unofficial-pcre CONFIG)
|
||||
+endif()
|
||||
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-git2Targets.cmake")
|
||||
+]])
|
||||
+configure_file("${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake" @ONLY)
|
||||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-git2-config.cmake DESTINATION share/unofficial-git2)
|
||||
+
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
84
externals/vcpkg/ports/libgit2/portfile.cmake
vendored
Executable file
84
externals/vcpkg/ports/libgit2/portfile.cmake
vendored
Executable file
@@ -0,0 +1,84 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libgit2/libgit2
|
||||
REF v1.4.2
|
||||
SHA512 144bec7f8e66d97b20335d87d1eb68d522f5e59064b0c557505c088d3c486d45704f023d701f51de572efa8e2eb111e3136eb5d23c035e29d16698206b5ec277
|
||||
HEAD_REF maint/v1.4
|
||||
PATCHES
|
||||
fix-configcmake.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/cmake/FindPCRE.cmake")
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT)
|
||||
|
||||
set(REGEX_BACKEND OFF)
|
||||
set(USE_HTTPS OFF)
|
||||
|
||||
function(set_regex_backend VALUE)
|
||||
if(REGEX_BACKEND)
|
||||
message(FATAL_ERROR "Only one regex backend (pcre,pcre2) is allowed")
|
||||
endif()
|
||||
set(REGEX_BACKEND ${VALUE} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(set_tls_backend VALUE)
|
||||
if(USE_HTTPS)
|
||||
message(FATAL_ERROR "Only one TLS backend (openssl,winhttp,sectransp,mbedtls) is allowed")
|
||||
endif()
|
||||
set(USE_HTTPS ${VALUE} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
foreach(GIT2_FEATURE ${FEATURES})
|
||||
if(GIT2_FEATURE STREQUAL "pcre")
|
||||
set_regex_backend("pcre")
|
||||
elseif(GIT2_FEATURE STREQUAL "pcre2")
|
||||
set_regex_backend("pcre2")
|
||||
elseif(GIT2_FEATURE STREQUAL "openssl")
|
||||
set_tls_backend("OpenSSL")
|
||||
elseif(GIT2_FEATURE STREQUAL "winhttp")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
message(FATAL_ERROR "winhttp is not supported on non-Windows and uwp platforms")
|
||||
endif()
|
||||
set_tls_backend("WinHTTP")
|
||||
elseif(GIT2_FEATURE STREQUAL "sectransp")
|
||||
if(NOT VCPKG_TARGET_IS_OSX)
|
||||
message(FATAL_ERROR "sectransp is not supported on non-Apple platforms")
|
||||
endif()
|
||||
set_tls_backend("SecureTransport")
|
||||
elseif(GIT2_FEATURE STREQUAL "mbedtls")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
message(FATAL_ERROR "mbedtls is not supported on Windows because a certificate file must be specified at compile time")
|
||||
endif()
|
||||
set_tls_backend("mbedTLS")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT REGEX_BACKEND)
|
||||
message(FATAL_ERROR "Must choose pcre or pcre2 regex backend")
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS GIT2_FEATURES
|
||||
FEATURES
|
||||
ssh USE_SSH
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_TESTS=OFF
|
||||
-DUSE_HTTP_PARSER=system
|
||||
-DUSE_HTTPS=${USE_HTTPS}
|
||||
-DREGEX_BACKEND=${REGEX_BACKEND}
|
||||
-DSTATIC_CRT=${STATIC_CRT}
|
||||
${GIT2_FEATURES}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-git2 CONFIG_PATH share/unofficial-git2)
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
97
externals/vcpkg/ports/libgit2/vcpkg.json
vendored
Executable file
97
externals/vcpkg/ports/libgit2/vcpkg.json
vendored
Executable file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"name": "libgit2",
|
||||
"version-semver": "1.4.2",
|
||||
"description": "Git linkable library",
|
||||
"homepage": "https://github.com/libgit2/libgit2",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"http-parser",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
],
|
||||
"default-features": [
|
||||
"pcre",
|
||||
"ssl"
|
||||
],
|
||||
"features": {
|
||||
"mbedtls": {
|
||||
"description": "SSL support (mbedTLS)",
|
||||
"dependencies": [
|
||||
"mbedtls"
|
||||
]
|
||||
},
|
||||
"openssl": {
|
||||
"description": "SSL support (OpenSSL)",
|
||||
"dependencies": [
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"pcre": {
|
||||
"description": "Build against external libpcre",
|
||||
"dependencies": [
|
||||
"pcre"
|
||||
]
|
||||
},
|
||||
"pcre2": {
|
||||
"description": "Build against external libpcre2",
|
||||
"dependencies": [
|
||||
"pcre2"
|
||||
]
|
||||
},
|
||||
"sectransp": {
|
||||
"description": "SSL support (sectransp)"
|
||||
},
|
||||
"ssh": {
|
||||
"description": "SSH support via libssh2",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "libgit2",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"libssh2"
|
||||
]
|
||||
},
|
||||
"ssl": {
|
||||
"description": "Default SSL backend",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "libgit2",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"sectransp"
|
||||
],
|
||||
"platform": "osx"
|
||||
},
|
||||
{
|
||||
"name": "libgit2",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"winhttp"
|
||||
],
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "libgit2",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"openssl"
|
||||
],
|
||||
"platform": "!windows & !osx"
|
||||
}
|
||||
]
|
||||
},
|
||||
"winhttp": {
|
||||
"description": "SSL support (WinHTTP)"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user