- Add patch to fix the pycparser issues as per bellow:
* pycparser.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygit2?expand=0&rev=48
This commit is contained in:
parent
4493705311
commit
c1adf547c6
71
pycparser.patch
Normal file
71
pycparser.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From 01b69f31b613a99f2a5d47c96fde12b2d0c497d5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= <jdavid.ibp@gmail.com>
|
||||
Date: Sat, 6 Apr 2019 13:14:51 +0200
|
||||
Subject: [PATCH] Work with pycparser 2.18 and 2.19
|
||||
|
||||
Fixes #846
|
||||
---
|
||||
pygit2/__init__.py | 5 ++---
|
||||
pygit2/remote.py | 5 ++---
|
||||
setup.py | 2 +-
|
||||
3 files changed, 5 insertions(+), 7 deletions(-)
|
||||
|
||||
Index: pygit2-0.28.0/pygit2/__init__.py
|
||||
===================================================================
|
||||
--- pygit2-0.28.0.orig/pygit2/__init__.py
|
||||
+++ pygit2-0.28.0/pygit2/__init__.py
|
||||
@@ -153,8 +153,7 @@ def init_repository(path, bare=False,
|
||||
# Ok
|
||||
return Repository(to_str(path))
|
||||
|
||||
-@ffi.callback('int (*git_repository_create_cb)(git_repository **out,'
|
||||
- 'const char *path, int bare, void *payload)')
|
||||
+@ffi.callback('int (*cb)(git_repository **out, const char *path, int bare, void *payload)')
|
||||
def _repository_create_cb(repo_out, path, bare, data):
|
||||
d = ffi.from_handle(data)
|
||||
try:
|
||||
@@ -168,7 +167,7 @@ def _repository_create_cb(repo_out, path
|
||||
|
||||
return 0
|
||||
|
||||
-@ffi.callback('int (*git_remote_create_cb)(git_remote **out, git_repository *repo,'
|
||||
+@ffi.callback('int (*cb)(git_remote **out, git_repository *repo,'
|
||||
'const char *name, const char *url, void *payload)')
|
||||
def _remote_create_cb(remote_out, repo, name, url, data):
|
||||
d = ffi.from_handle(data)
|
||||
Index: pygit2-0.28.0/pygit2/remote.py
|
||||
===================================================================
|
||||
--- pygit2-0.28.0.orig/pygit2/remote.py
|
||||
+++ pygit2-0.28.0/pygit2/remote.py
|
||||
@@ -291,7 +291,7 @@ class RemoteCallbacks(object):
|
||||
|
||||
return 0
|
||||
|
||||
- @ffi.callback('int (*credentials)(git_cred **cred, const char *url,'
|
||||
+ @ffi.callback('int (*cb)(git_cred **cred, const char *url,'
|
||||
'const char *username_from_url, unsigned int allowed_types,'
|
||||
'void *data)')
|
||||
def _credentials_cb(cred_out, url, username, allowed, data):
|
||||
@@ -312,8 +312,7 @@ class RemoteCallbacks(object):
|
||||
|
||||
return 0
|
||||
|
||||
- @ffi.callback('int (*git_transport_certificate_check_cb)'
|
||||
- '(git_cert *cert, int valid, const char *host, void *payload)')
|
||||
+ @ffi.callback('int (*cb)(git_cert *cert, int valid, const char *host, void *payload)')
|
||||
def _certificate_cb(cert_i, valid, host, data):
|
||||
self = ffi.from_handle(data)
|
||||
|
||||
Index: pygit2-0.28.0/setup.py
|
||||
===================================================================
|
||||
--- pygit2-0.28.0.orig/setup.py
|
||||
+++ pygit2-0.28.0/setup.py
|
||||
@@ -154,7 +154,7 @@ setup(name='pygit2',
|
||||
packages=['pygit2'],
|
||||
package_data={'pygit2': ['decl.h']},
|
||||
setup_requires=['cffi'],
|
||||
- install_requires=['cffi', 'six', 'pycparser<2.18'],
|
||||
+ install_requires=['cffi', 'six', 'pycparser'],
|
||||
zip_safe=False,
|
||||
cmdclass=cmdclass,
|
||||
**extra_args)
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 8 08:15:54 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Add patch to fix the pycparser issues as per bellow:
|
||||
* pycparser.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 23 11:32:34 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
@ -26,6 +26,7 @@ License: GPL-2.0-only
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/libgit2/pygit2
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pygit2/pygit2-%{version}.tar.gz
|
||||
Patch0: pycparser.patch
|
||||
BuildRequires: %{python_module cffi}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module pycparser}
|
||||
@ -48,8 +49,7 @@ Bindings for libgit2, a linkable C library for the Git version-control system.
|
||||
|
||||
%prep
|
||||
%setup -q -n pygit2-%{version}
|
||||
# do not hardcode version
|
||||
sed -i -e 's:pycparser<2.18:pycparser:g' setup.py
|
||||
%patch0 -p1
|
||||
# do not add options to pytest
|
||||
rm pytest.ini
|
||||
|
||||
@ -62,9 +62,7 @@ export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
# disable tests for now until https://github.com/libgit2/pygit2/issues/846
|
||||
# gets fixed; upstream https://github.com/eliben/pycparser/issues/305
|
||||
#%%pytest_arch
|
||||
%pytest_arch
|
||||
|
||||
%files %{python_files}
|
||||
%license COPYING
|
||||
|
Loading…
Reference in New Issue
Block a user