Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pygit2/, dev-python/pygit2/files/
Date: Tue, 28 Sep 2021 06:20:50
Message-Id: 1632810044.3a6516ace7f757905a3a1e14fe68d61e29faac11.mgorny@gentoo
1 commit: 3a6516ace7f757905a3a1e14fe68d61e29faac11
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 28 05:52:57 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 28 06:20:44 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a6516ac
7
8 dev-python/pygit2: Enable libgit2 1.2.0 support
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 .../pygit2/files/pygit2-1.6.1-libgit2-1.2.0.patch | 48 ++++++++++++++++++++++
13 dev-python/pygit2/pygit2-1.6.1-r2.ebuild | 45 ++++++++++++++++++++
14 2 files changed, 93 insertions(+)
15
16 diff --git a/dev-python/pygit2/files/pygit2-1.6.1-libgit2-1.2.0.patch b/dev-python/pygit2/files/pygit2-1.6.1-libgit2-1.2.0.patch
17 new file mode 100644
18 index 00000000000..d3e097ba62b
19 --- /dev/null
20 +++ b/dev-python/pygit2/files/pygit2-1.6.1-libgit2-1.2.0.patch
21 @@ -0,0 +1,48 @@
22 +From dcde9eff5950492ab0d2565a07fd18d765332a96 Mon Sep 17 00:00:00 2001
23 +From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= <jdavid.ibp@×××××.com>
24 +Date: Thu, 16 Sep 2021 11:19:04 +0200
25 +Subject: [PATCH] Upgrade to libgit2 1.2
26 +
27 +Closes #1089
28 +---
29 + Makefile | 2 +-
30 + build.sh | 14 +++++++-------
31 + pygit2/decl/remote.h | 2 ++
32 + src/types.h | 4 ++--
33 + 10 files changed, 29 insertions(+), 25 deletions(-)
34 +
35 +diff --git a/pygit2/decl/remote.h b/pygit2/decl/remote.h
36 +index ff84371c3e1ce81a7e9914d4d4592638f41376bb..4e912c065cd6eaf19ef6d0304b0fd8f646edbff4 100644
37 +--- a/pygit2/decl/remote.h
38 ++++ b/pygit2/decl/remote.h
39 +@@ -23,6 +23,7 @@ typedef struct {
40 +
41 + typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload);
42 + typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data);
43 ++typedef int (*git_remote_ready_cb)(git_remote *remote, int direction, void *payload);
44 + typedef int (*git_url_resolve_cb)(git_buf *url_resolved, const char *url, int direction, void *payload);
45 +
46 + struct git_remote_callbacks {
47 +@@ -38,6 +39,7 @@ struct git_remote_callbacks {
48 + git_push_update_reference_cb push_update_reference;
49 + git_push_negotiation push_negotiation;
50 + git_transport_cb transport;
51 ++ git_remote_ready_cb remote_ready;
52 + void *payload;
53 + git_url_resolve_cb resolve_url;
54 + };
55 +diff --git a/src/types.h b/src/types.h
56 +index ff967b81f76688f8f0958638d99a06f7bbacb99c..89ad3a00149a1326c3edfa20d2d69d629cb1d2a2 100644
57 +--- a/src/types.h
58 ++++ b/src/types.h
59 +@@ -32,8 +32,8 @@
60 + #include <Python.h>
61 + #include <git2.h>
62 +
63 +-#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 1)
64 +-#error You need a compatible libgit2 version (1.1.x)
65 ++#if !(LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 2)
66 ++#error You need a compatible libgit2 version (1.2.x)
67 + #endif
68 +
69 + /*
70
71 diff --git a/dev-python/pygit2/pygit2-1.6.1-r2.ebuild b/dev-python/pygit2/pygit2-1.6.1-r2.ebuild
72 new file mode 100644
73 index 00000000000..fa7f6c1fbf6
74 --- /dev/null
75 +++ b/dev-python/pygit2/pygit2-1.6.1-r2.ebuild
76 @@ -0,0 +1,45 @@
77 +# Copyright 1999-2021 Gentoo Authors
78 +# Distributed under the terms of the GNU General Public License v2
79 +
80 +EAPI=8
81 +
82 +PYTHON_COMPAT=( python3_{8..10} )
83 +inherit distutils-r1
84 +
85 +DESCRIPTION="Python bindings for libgit2"
86 +HOMEPAGE="https://github.com/libgit2/pygit2 https://pypi.org/project/pygit2/"
87 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
88 +
89 +LICENSE="GPL-2-with-linking-exception"
90 +SLOT="0"
91 +KEYWORDS="~amd64 ~x86"
92 +
93 +RDEPEND="
94 + =dev-libs/libgit2-1.2*:=
95 + dev-python/cached-property[${PYTHON_USEDEP}]
96 + >=dev-python/cffi-1.0:=[${PYTHON_USEDEP}]
97 +"
98 +DEPEND="${RDEPEND}"
99 +
100 +distutils_enable_tests pytest
101 +
102 +src_prepare() {
103 + local PATCHES=(
104 + "${FILESDIR}"/${P}-libgit2-1.2.0.patch
105 + )
106 +
107 + distutils-r1_src_prepare
108 +
109 + # unconditionally prevent it from using network
110 + sed -i -e '/has_network/s:True:False:' test/utils.py || die
111 +
112 + # we need to move them away to prevent pytest from forcing '..'
113 + # for imports
114 + mkdir hack || die
115 + mv test hack/ || die
116 + ln -s hack/test test || die
117 +}
118 +
119 +python_test() {
120 + epytest hack/test
121 +}