From d6b97acd6223afe12fdde06601027dab65f0154cb883a0d7be9cbc20bdbde61b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Wed, 27 Mar 2024 19:44:35 +0000 Subject: [PATCH] Accepting request 1163138 from home:StefanBruens:branches:electronics - Fix build with libgit2 >= 1.8.0, add libgit2-1.8.0-compatibility.patch OBS-URL: https://build.opensuse.org/request/show/1163138 OBS-URL: https://build.opensuse.org/package/show/electronics/kicad?expand=0&rev=132 --- kicad.changes | 6 +++++ kicad.spec | 2 ++ libgit2-1.8.0-compatibility.patch | 39 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 libgit2-1.8.0-compatibility.patch diff --git a/kicad.changes b/kicad.changes index e04273a..1f71310 100644 --- a/kicad.changes +++ b/kicad.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 27 16:40:26 UTC 2024 - Stefan Brüns + +- Fix build with libgit2 >= 1.8.0, add + libgit2-1.8.0-compatibility.patch + ------------------------------------------------------------------- Fri Mar 15 11:10:26 UTC 2024 - Stefan Brüns diff --git a/kicad.spec b/kicad.spec index 42bd3dd..f8dc0ba 100644 --- a/kicad.spec +++ b/kicad.spec @@ -32,6 +32,8 @@ Source: https://gitlab.com/kicad/code/kicad/-/archive/%{file_version}/ki Patch1: https://gitlab.com/kicad/code/kicad/-/commit/81cb6d0c3fb92dd15f0a0e0d2d32337be1617399.patch#/fix_zone_fill_race.patch # PATCH-FIX-UPSTREAM Patch2: https://gitlab.com/kicad/code/kicad/-/commit/1c459e9a67151a6f028ac3a108b338e850126bfb.patch#/0001-Fix-triangulationValid-check-race-for-zone-fill.patch +# PATCH-FIX-UPSTREAM +Patch3: https://gitlab.com/kicad/code/kicad/-/merge_requests/1882.patch#/libgit2-1.8.0-compatibility.patch BuildRequires: cmake >= 3.16 BuildRequires: fdupes diff --git a/libgit2-1.8.0-compatibility.patch b/libgit2-1.8.0-compatibility.patch new file mode 100644 index 0000000..022a6cb --- /dev/null +++ b/libgit2-1.8.0-compatibility.patch @@ -0,0 +1,39 @@ +From 0b2de7b7072b4b7d2fc577170024cd5326396681 Mon Sep 17 00:00:00 2001 +From: Huang Rui +Date: Fri, 22 Mar 2024 18:18:40 +0800 +Subject: [PATCH] libgit2-1.8.0 compatibility: adjusted parent pointer type + +- Adjusted parent pointer type in git_commit_create call for compatibility + with libgit2 1.8.0 and above. +- Included preprocessor checks to maintain support for versions older than + 1.8.0. +- Ensures consistent function behavior across different libgit2 versions. + +Fixes https://gitlab.com/kicad/code/kicad/-/issues/17536 +Signed-off-by: Huang Rui +--- + kicad/project_tree_pane.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp +index 6ac4b04034c..99ad026bc9c 100644 +--- a/kicad/project_tree_pane.cpp ++++ b/kicad/project_tree_pane.cpp +@@ -2233,7 +2233,14 @@ void PROJECT_TREE_PANE::onGitCommit( wxCommandEvent& aEvent ) + } + + git_oid oid; ++ // Check if the libgit2 library version is 1.8.0 or higher ++#if ( LIBGIT2_VER_MAJOR > 1 ) || ( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8 ) ++ // For libgit2 version 1.8.0 and above ++ git_commit* const parents[1] = { parent }; ++#else ++ // For libgit2 versions older than 1.8.0 + const git_commit* parents[1] = { parent }; ++#endif + + if( git_commit_create( &oid, repo, "HEAD", author, author, nullptr, commit_msg.mb_str(), tree, + 1, parents ) != 0 ) +-- +GitLab +