Fixed build for SWIG 4.0.0 (#1707367)

This commit is contained in:
Jitka Plesnikova 2019-05-21 14:25:35 +02:00
parent 230348dd1e
commit fa418a9b4f
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 78e2076be0969bddf599f805985ae7bd39298c62 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 14 May 2019 11:48:28 +0200
Subject: [PATCH] Make peace with swig-4.0.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Patch by Jitka Plesníková, thanks!
---
bindings/solv.i | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bindings/solv.i b/bindings/solv.i
index 0289adb5..107192ff 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -629,8 +629,10 @@ SWIG_AsValDepId(void *obj, int *val) {
%typemap(out) disown_helper {
#if defined(SWIGRUBY)
SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 );
-#elif defined(SWIGPYTHON)
+#elif defined(SWIGPYTHON) && SWIG_VERSION < 0x040000
SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 );
+#elif defined(SWIGPYTHON)
+ SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 );
#elif defined(SWIGPERL)
SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Pool, SWIG_POINTER_DISOWN | 0 );
#elif defined(SWIGTCL)

View File

@ -42,7 +42,7 @@
Name: lib%{libname}
Version: 0.7.4
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Package dependency solver
License: BSD
@ -53,6 +53,8 @@ Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
# https://github.com/openSUSE/libsolv/pull/313
# https://bugzilla.redhat.com/show_bug.cgi?id=1695069
Patch0001: 0001-solver-Free-favorq-when-running-solver_solve.patch
# https://github.com/openSUSE/libsolv/issues/325
Patch0002: libsolv-0.7.4-fix-for-swig-4.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@ -302,6 +304,9 @@ Python 3 version.
%endif
%changelog
* Tue May 21 2019 Jitka Plesnikova <jplesnik@redhat.com> - 0.7.4-3
- Fixed build for SWIG 4.0.0 (#1707367)
* Tue Apr 02 14:45:22 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.7.4-2
- Backport patch to fix solver_solve() running multiple times with SOLVER_FAVOR