commit:     1754434f5cb77275b97952e96dee0ed3364fb563
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 19 14:02:00 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 19 14:02:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1754434f

dev-python/pygit2: Backport gcc-14 build fix

Closes: https://bugs.gentoo.org/942207
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pygit2/files/pygit2-1.16.0-gcc-14.patch | 37 ++++++++++++++++++++++
 dev-python/pygit2/pygit2-1.16.0.ebuild             |  6 ++++
 2 files changed, 43 insertions(+)

diff --git a/dev-python/pygit2/files/pygit2-1.16.0-gcc-14.patch 
b/dev-python/pygit2/files/pygit2-1.16.0-gcc-14.patch
new file mode 100644
index 000000000000..5bcd93320585
--- /dev/null
+++ b/dev-python/pygit2/files/pygit2-1.16.0-gcc-14.patch
@@ -0,0 +1,37 @@
+From eba710e45bb40e18641c6531394bb46631e7f295 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <[email protected]>
+Date: Tue, 5 Nov 2024 12:26:44 +0100
+Subject: [PATCH] fix: use correct type of the ninth parameter of
+ git_commit_create()
+
+It should be `const git_commit **`, not `git_commit **`.
+
+Breaks the build with GCC-14.
+---
+ src/repository.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/repository.c b/src/repository.c
+index d1d42ecf..3b5d57a1 100644
+--- a/src/repository.c
++++ b/src/repository.c
+@@ -1065,7 +1065,8 @@ Repository_create_commit(Repository *self, PyObject 
*args)
+ 
+     err = git_commit_create(&oid, self->repo, update_ref,
+                             py_author->signature, py_committer->signature,
+-                            encoding, message, tree, parent_count, parents);
++                            encoding, message, tree, parent_count,
++                            (const git_commit **)parents);
+     if (err < 0) {
+         Error_set(err);
+         goto out;
+@@ -1147,7 +1148,8 @@ Repository_create_commit_string(Repository *self, 
PyObject *args)
+ 
+     err = git_commit_create_buffer(&buf, self->repo,
+                                    py_author->signature, 
py_committer->signature,
+-                                   encoding, message, tree, parent_count, 
parents);
++                                   encoding, message, tree, parent_count,
++                                   (const git_commit **)parents);
+     if (err < 0) {
+         Error_set(err);
+         goto out;

diff --git a/dev-python/pygit2/pygit2-1.16.0.ebuild 
b/dev-python/pygit2/pygit2-1.16.0.ebuild
index d6fdc0982742..87c95816f425 100644
--- a/dev-python/pygit2/pygit2-1.16.0.ebuild
+++ b/dev-python/pygit2/pygit2-1.16.0.ebuild
@@ -34,6 +34,12 @@ RDEPEND="
 distutils_enable_tests pytest
 
 src_prepare() {
+       local PATCHES=(
+               # https://bugs.gentoo.org/942207
+               # 
https://github.com/libgit2/pygit2/commit/eba710e45bb40e18641c6531394bb46631e7f295
+               "${FILESDIR}/${P}-gcc-14.patch"
+       )
+
        distutils-r1_src_prepare
 
        # unconditionally prevent it from using network

Reply via email to