From e56d62469e5285dfe40e07e29d282d465338d774 Mon Sep 17 00:00:00 2001 From: Colden Cullen Date: Wed, 7 Jan 2026 02:21:02 -0800 Subject: [PATCH] [libgit2] Add SHA256 support via a feature (#49068) --- ports/libgit2/portfile.cmake | 6 ++++++ ports/libgit2/vcpkg.json | 3 +++ scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json | 7 ++++--- versions/l-/libgit2.json | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ports/libgit2/portfile.cmake b/ports/libgit2/portfile.cmake index 4755dcb3f6..5228fe511d 100644 --- a/ports/libgit2/portfile.cmake +++ b/ports/libgit2/portfile.cmake @@ -71,6 +71,7 @@ vcpkg_check_features( OUT_FEATURE_OPTIONS GIT2_FEATURES FEATURES tools BUILD_CLI + sha256 EXPERIMENTAL_SHA256 ) vcpkg_cmake_configure( @@ -96,6 +97,11 @@ vcpkg_fixup_pkgconfig() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") if("tools" IN_LIST FEATURES) + # Since SHA256 is considered an "experimental" feature, it renames the executable. This renames it back. + if("sha256" IN_LIST FEATURES) + file(RENAME "${CURRENT_PACKAGES_DIR}/bin/git2-experimental${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/bin/git2${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + endif() + vcpkg_copy_tools(TOOL_NAMES git2 AUTO_CLEAN) endif() diff --git a/ports/libgit2/vcpkg.json b/ports/libgit2/vcpkg.json index 7a1dd557ef..e2dff11da1 100644 --- a/ports/libgit2/vcpkg.json +++ b/ports/libgit2/vcpkg.json @@ -51,6 +51,9 @@ "description": "SSL support (sectransp)", "supports": "osx" }, + "sha256": { + "description": "[experimental] SHA256 OID support" + }, "ssh": { "description": "SSH support via libssh2", "dependencies": [ diff --git a/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json b/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json index f4c01aa8cc..6bb2df6881 100644 --- a/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-libgit2/vcpkg.json @@ -1,15 +1,16 @@ { "name": "vcpkg-ci-libgit2", "version-string": "ci", - "description": "Validates libgit2 with ssh and tools.", + "description": "Validates libgit2 with ssh, tools, and sha256.", "dependencies": [ { "name": "libgit2", "default-features": false, "features": [ "ssh", - "tools" + "tools", + "sha256" ] } ] -} +} \ No newline at end of file diff --git a/versions/l-/libgit2.json b/versions/l-/libgit2.json index 8f06dbc63f..5c275e1690 100644 --- a/versions/l-/libgit2.json +++ b/versions/l-/libgit2.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3132df66e48bd17fb623b7b7f052b73e4d8ad7a3", + "git-tree": "2fd041b43ab1c68f47f7a23ff487e7dfe3f92d30", "version-semver": "1.9.2", "port-version": 0 },