new file mode 100644
@@ -0,0 +1,32 @@
+From 8ca35649c33d0d2fcdcd573ce6a9edd91c77e4da Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Tue, 7 Jan 2025 18:56:19 +0100
+Subject: [PATCH] src/libgit2/CMakeLists.txt: install cmake files into
+ configured libdir
+
+libdir can be something else than /usr/lib, e.g. /usr/lib64 or similar.
+
+Upstream-Status: Submitted [https://github.com/libgit2/libgit2/pull/7004]
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ src/libgit2/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libgit2/CMakeLists.txt b/src/libgit2/CMakeLists.txt
+index a7d3c7ca4..16b3a23d9 100644
+--- a/src/libgit2/CMakeLists.txt
++++ b/src/libgit2/CMakeLists.txt
+@@ -119,11 +119,11 @@ configure_file(config.cmake.in
+ install(FILES
+ "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake"
+ "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
+- DESTINATION "lib/cmake/${PROJECT_NAME}")
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+ install(
+ EXPORT ${LIBGIT2_TARGETS_EXPORT_NAME}
+ NAMESPACE "${PROJECT_NAME}::"
+- DESTINATION "lib/cmake/${PROJECT_NAME}")
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+
+ # Install
+
similarity index 60%
rename from meta/recipes-support/libgit2/libgit2_1.8.4.bb
rename to meta/recipes-support/libgit2/libgit2_1.9.0.bb
@@ -5,8 +5,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8eacfdc17c8f4d219e131a073973b97d"
DEPENDS = "curl openssl zlib libssh2 libgcrypt libpcre2"
-SRC_URI = "git://github.com/libgit2/libgit2.git;branch=maint/v1.8;protocol=https"
-SRCREV = "3f4182d15eab74a302718f2de454ffadb1995626"
+SRC_URI = "git://github.com/libgit2/libgit2.git;branch=main;protocol=https \
+ file://0001-src-libgit2-CMakeLists.txt-install-cmake-files-into-.patch \
+ "
+SRCREV = "338e6fb681369ff0537719095e22ce9dc602dbf0"
S = "${WORKDIR}/git"
@@ -19,3 +21,7 @@ EXTRA_OECMAKE = "\
"
BBCLASSEXTEND = "native"
+
+do_install:append() {
+ sed -i -e 's,${RECIPE_SYSROOT},,g' ${D}${libdir}/cmake/libgit2/libgit2Targets.cmake
+}