From 335e1c9d2fe9c2ace0d38a7132f6486cc9d7b537 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Thu, 21 Mar 2024 01:06:32 +0300 Subject: [PATCH] libgit2: update to 1.8.0 --- .../0001-libgit2-1.4.2-rc-filename.patch | 14 +++-- ...002-cmake-fix-openssl-build-on-win32.patch | 59 ------------------- mingw-w64-libgit2/PKGBUILD | 18 +++--- 3 files changed, 15 insertions(+), 76 deletions(-) delete mode 100644 mingw-w64-libgit2/0002-cmake-fix-openssl-build-on-win32.patch diff --git a/mingw-w64-libgit2/0001-libgit2-1.4.2-rc-filename.patch b/mingw-w64-libgit2/0001-libgit2-1.4.2-rc-filename.patch index 0edd4352f9931..bc0757e0a37c4 100644 --- a/mingw-w64-libgit2/0001-libgit2-1.4.2-rc-filename.patch +++ b/mingw-w64-libgit2/0001-libgit2-1.4.2-rc-filename.patch @@ -1,6 +1,7 @@ ---- a/src/libgit2/CMakeLists.txt -+++ b/src/libgit2/CMakeLists.txt -@@ -101,7 +101,7 @@ if(SONAME) +diff -Naur libgit2-1.8.0.orig/src/libgit2/CMakeLists.txt libgit2-1.8.0/src/libgit2/CMakeLists.txt +--- libgit2-1.8.0.orig/src/libgit2/CMakeLists.txt 2024-03-21 00:50:41.444310600 +0300 ++++ libgit2-1.8.0/src/libgit2/CMakeLists.txt 2024-03-21 00:53:19.841827200 +0300 +@@ -77,7 +77,7 @@ set_target_properties(libgit2package PROPERTIES VERSION ${libgit2_VERSION}) set_target_properties(libgit2package PROPERTIES SOVERSION "${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}") if(LIBGIT2_FILENAME) @@ -9,8 +10,9 @@ set_target_properties(libgit2package PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME}) elseif(DEFINED LIBGIT2_PREFIX) set_target_properties(libgit2package PROPERTIES PREFIX "${LIBGIT2_PREFIX}") ---- a/src/libgit2/git2.rc -+++ b/src/libgit2/git2.rc +diff -Naur libgit2-1.8.0.orig/src/libgit2/git2.rc libgit2-1.8.0/src/libgit2/git2.rc +--- libgit2-1.8.0.orig/src/libgit2/git2.rc 2024-03-21 00:50:41.569313400 +0300 ++++ libgit2-1.8.0/src/libgit2/git2.rc 2024-03-21 00:55:37.504984900 +0300 @@ -2,23 +2,15 @@ #include "../../include/git2/version.h" @@ -24,7 +26,7 @@ #endif #ifndef LIBGIT2_COMMENTS - # define LIBGIT2_COMMENTS "For more information visit http://libgit2.github.com/" + # define LIBGIT2_COMMENTS "For more information visit https://libgit2.org/" #endif -#ifdef __GNUC__ diff --git a/mingw-w64-libgit2/0002-cmake-fix-openssl-build-on-win32.patch b/mingw-w64-libgit2/0002-cmake-fix-openssl-build-on-win32.patch deleted file mode 100644 index bce5f29bd5a70..0000000000000 --- a/mingw-w64-libgit2/0002-cmake-fix-openssl-build-on-win32.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 86872834c5fc40b78e4881255fad5b11bc866fd4 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sat, 19 Aug 2023 10:44:25 +0200 -Subject: [PATCH] cmake: fix openssl build on win32 - -since f15c8ac71a916b libgit unconditionally depends on secur32 on Windows -but only added it in cmake for the winhttp and schannel variants. -In case libgit is built against openssl it would fail to link. - -This moves secur32 out of the https backend selection code into -the global win32 condition (and while at it also adds ws2_32 to the .pc file) ---- - cmake/SelectHTTPSBackend.cmake | 8 ++++---- - src/CMakeLists.txt | 3 ++- - 2 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/cmake/SelectHTTPSBackend.cmake b/cmake/SelectHTTPSBackend.cmake -index d14941643..0b3d63a79 100644 ---- a/cmake/SelectHTTPSBackend.cmake -+++ b/cmake/SelectHTTPSBackend.cmake -@@ -109,8 +109,8 @@ if(USE_HTTPS) - elseif(USE_HTTPS STREQUAL "Schannel") - set(GIT_SCHANNEL 1) - -- list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32") -- list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32") -+ list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32") -+ list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32") - elseif(USE_HTTPS STREQUAL "WinHTTP") - set(GIT_WINHTTP 1) - -@@ -125,8 +125,8 @@ if(USE_HTTPS) - list(APPEND LIBGIT2_PC_LIBS "-lwinhttp") - endif() - -- list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32" "secur32") -- list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32" "-lsecur32") -+ list(APPEND LIBGIT2_SYSTEM_LIBS "rpcrt4" "crypt32" "ole32") -+ list(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32") - elseif(USE_HTTPS STREQUAL "OpenSSL-Dynamic") - set(GIT_OPENSSL 1) - set(GIT_OPENSSL_DYNAMIC 1) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 8525acdd8..b412452c9 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -135,7 +135,8 @@ endif() - # platform libraries - - if(WIN32) -- list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32) -+ list(APPEND LIBGIT2_SYSTEM_LIBS "ws2_32" "secur32") -+ list(APPEND LIBGIT2_PC_LIBS "-lws2_32" "-lsecur32") - endif() - - if(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") --- -2.41.0 - diff --git a/mingw-w64-libgit2/PKGBUILD b/mingw-w64-libgit2/PKGBUILD index 32548a56f639f..1d5c3aabcd3d3 100644 --- a/mingw-w64-libgit2/PKGBUILD +++ b/mingw-w64-libgit2/PKGBUILD @@ -4,12 +4,13 @@ _realname=libgit2 pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-winhttp") -pkgver=1.7.2 +pkgver=1.8.0 pkgrel=1 pkgdesc='A linkable library for Git (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') -url='https://github.com/libgit2/libgit2' +url='https://libgit2.org/' +msys2_repository_url='https://github.com/libgit2/libgit2' license=('GPL2' 'custom') depends=("${MINGW_PACKAGE_PREFIX}-http-parser" "${MINGW_PACKAGE_PREFIX}-libssh2" @@ -23,22 +24,17 @@ makedepends=( "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-python" ) -source=(${_realname}-${pkgver}.tar.gz::"https://github.com/libgit2/libgit2/archive/v${pkgver}.tar.gz" - "0001-libgit2-1.4.2-rc-filename.patch" - "0002-cmake-fix-openssl-build-on-win32.patch") +source=("${msys2_repository_url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz" + "0001-libgit2-1.4.2-rc-filename.patch") noextract=(${_realname}-${pkgver}.tar.gz) -sha256sums=('de384e29d7efc9330c6cdb126ebf88342b5025d920dcb7c645defad85195ea7f' - 'bdffd718bbf178817d5cfd80f9d5a9706b9c6ff981b1631978ae02657cbf2a55' - '4329cef22a301adf67652ac00372e08077fe4dd005f7036751be413dda6ac156') +sha256sums=('9e1d6a880d59026b675456fbb1593c724c68d73c34c0d214d6eb848e9bbd8ae4' + '1a217eddf7daa549b12ccf88e275782ac7a7fa385d5afb59aac0351ee5b97a44') prepare() { tar --exclude tests/resources/testrepo-worktree/link_to_new.txt -zxf ${_realname}-${pkgver}.tar.gz cd ${_realname}-${pkgver} patch -Np1 -i "${srcdir}/0001-libgit2-1.4.2-rc-filename.patch" - - # https://github.com/libgit2/libgit2/pull/6626 - patch -Np1 -i "${srcdir}/0002-cmake-fix-openssl-build-on-win32.patch" } do_build() {