Source0: https://github.com/libgit2/libgit2/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: 61b3421e91c7e0e2938dfb36c26f19ba
Patch0: %{name}-no-libgit2-test.patch
+Patch1: pcre2-detect.ptch
URL: http://libgit2.github.com/
BuildRequires: cmake >= 3.5.1
%{?with_kerberos5:BuildRequires: heimdal-devel}
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
# Don't test network
sed -i '/ADD_TEST(online/s/^/#/' tests/CMakeLists.txt
--- /dev/null
+From 39627c51f64dca83c9fc3b903079456f3c39a2d3 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@fastmail.com>
+Date: Mon, 27 Jun 2022 10:04:23 +0200
+Subject: [PATCH] cmake: change header used for pcre2 detection
+
+with pcre2 regex libgit2 uses pcre2.h header instead of pcre2posix.h
+(since f585b12), so reflect it in library detection logic
+---
+ cmake/FindPCRE2.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/FindPCRE2.cmake b/cmake/FindPCRE2.cmake
+index d4b8e6761..41c165b65 100644
+--- a/cmake/FindPCRE2.cmake
++++ b/cmake/FindPCRE2.cmake
+@@ -16,7 +16,7 @@
+ # PCRE2_FOUND - True if pcre found.
+
+ # Look for the header file.
+-find_path(PCRE2_INCLUDE_DIR NAMES pcre2posix.h)
++find_path(PCRE2_INCLUDE_DIR NAMES pcre2.h)
+
+ # Look for the library.
+ find_library(PCRE2_LIBRARY NAMES pcre2-8)
+--
+2.36.1
+