summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conrad@kostecki.com>2019-07-13 21:06:25 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2019-07-15 07:36:15 +0200
commitdd8c4c7ef1317f981fd118b9177de1d1aa31dcae (patch)
treec8b2be31ef8af4dfa215d9e8fb58ab6ab1621b26 /sci-libs/gdal/files
parentkde-apps: Drop KDE Applications 19.04.2 (diff)
downloadgentoo-dd8c4c7ef1317f981fd118b9177de1d1aa31dcae.tar.gz
gentoo-dd8c4c7ef1317f981fd118b9177de1d1aa31dcae.tar.bz2
gentoo-dd8c4c7ef1317f981fd118b9177de1d1aa31dcae.zip
sci-libs/gdal: fix build with enabled python use flag
Closes: https://bugs.gentoo.org/689110 Package-Manager: Portage-2.3.68, Repoman-2.3.16 Signed-off-by: Conrad Kostecki <conrad@kostecki.com> Closes: https://github.com/gentoo/gentoo/pull/12441 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sci-libs/gdal/files')
-rw-r--r--sci-libs/gdal/files/gdal-2.4.1-swig-4.patch115
1 files changed, 115 insertions, 0 deletions
diff --git a/sci-libs/gdal/files/gdal-2.4.1-swig-4.patch b/sci-libs/gdal/files/gdal-2.4.1-swig-4.patch
new file mode 100644
index 00000000000..9d104e60f60
--- /dev/null
+++ b/sci-libs/gdal/files/gdal-2.4.1-swig-4.patch
@@ -0,0 +1,115 @@
+From 7a2c9f9348e1bf6bd95033d0b4da09a243fd9e6d Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Mon, 8 Jul 2019 14:34:55 +0200
+Subject: [PATCH] Python bindings: add compatibility with SWIG 4.0 (based on
+ patch by @perestoronin, fixes #1702)
+
+---
+ gdal/swig/include/gdal_array.i | 6 ++++++
+ gdal/swig/include/python/typemaps_python.i | 9 ++++++++-
+ gdal/swig/python/extensions/gdal_array_wrap.cpp | 15 ++++++++++++++-
+ gdal/swig/python/extensions/gdal_wrap.cpp | 9 ++++++++-
+ 4 files changed, 36 insertions(+), 3 deletions(-)
+
+diff --git a/swig/include/gdal_array.i b/swig/include/gdal_array.i
+index c4f6f19b610..bf053eb2476 100644
+--- a/swig/include/gdal_array.i
++++ b/swig/include/gdal_array.i
+@@ -899,12 +899,18 @@ retStringAndCPLFree* GetArrayFilename(PyArrayObject *psArray)
+ }
+
+ /* Keep a reference to the VirtualMem object */
++%#if SWIGVERSION >= 0x040000
++%#define obj0 swig_obj[0]
++%#endif
+ %#if NPY_API_VERSION >= 0x00000007
+ PyArray_SetBaseObject(ar, obj0);
+ %#else
+ PyArray_BASE(ar) = obj0;
+ %#endif
+ Py_INCREF(obj0);
++%#if SWIGVERSION >= 0x040000
++%#undef obj0
++%#endif
+ Py_DECREF($result);
+ $result = (PyObject*) ar;
+ }
+diff --git a/swig/include/python/typemaps_python.i b/swig/include/python/typemaps_python.i
+index 5c9f36ab278..9266422e9c4 100644
+--- a/swig/include/python/typemaps_python.i
++++ b/swig/include/python/typemaps_python.i
+@@ -2104,7 +2104,14 @@ DecomposeSequenceOf4DCoordinates( PyObject *seq, int nCount, double *x, double *
+ %#if PY_VERSION_HEX >= 0x02070000
+ /* %typemap(argout) (void** pptr, size_t* pnsize, GDALDataType* pdatatype, int* preadonly)*/
+ Py_buffer *buf=(Py_buffer*)malloc(sizeof(Py_buffer));
+- if (PyBuffer_FillInfo(buf, obj0, *($1), *($2), *($4), PyBUF_ND)) {
++
++ if (PyBuffer_FillInfo(buf,
++%#if SWIGVERSION >= 0x040000
++ swig_obj[0],
++%#else
++ obj0,
++%#endif
++ *($1), *($2), *($4), PyBUF_ND)) {
+ // error, handle
+ }
+ if( *($3) == GDT_Byte )
+diff --git a/swig/python/extensions/gdal_array_wrap.cpp b/swig/python/extensions/gdal_array_wrap.cpp
+index 807e12dd4a0..4435803e6d9 100644
+--- a/swig/python/extensions/gdal_array_wrap.cpp
++++ b/swig/python/extensions/gdal_array_wrap.cpp
+@@ -4598,7 +4598,14 @@ SWIGINTERN PyObject *_wrap_VirtualMem_GetAddr(PyObject *SWIGUNUSEDPARM(self), Py
+ #if PY_VERSION_HEX >= 0x02070000
+ /* %typemap(argout) (void** pptr, size_t* pnsize, GDALDataType* pdatatype, int* preadonly)*/
+ Py_buffer *buf=(Py_buffer*)malloc(sizeof(Py_buffer));
+- if (PyBuffer_FillInfo(buf, obj0, *(arg2), *(arg3), *(arg5), PyBUF_ND)) {
++
++ if (PyBuffer_FillInfo(buf,
++ #if SWIGVERSION >= 0x040000
++ swig_obj[0],
++ #else
++ obj0,
++ #endif
++ *(arg2), *(arg3), *(arg5), PyBUF_ND)) {
+ // error, handle
+ }
+ if( *(arg4) == GDT_Byte )
+@@ -5597,12 +5604,18 @@ SWIGINTERN PyObject *_wrap_VirtualMemGetArray(PyObject *SWIGUNUSEDPARM(self), Py
+ }
+
+ /* Keep a reference to the VirtualMem object */
++#if SWIGVERSION >= 0x040000
++#define obj0 swig_obj[0]
++#endif
+ #if NPY_API_VERSION >= 0x00000007
+ PyArray_SetBaseObject(ar, obj0);
+ #else
+ PyArray_BASE(ar) = obj0;
+ #endif
+ Py_INCREF(obj0);
++#if SWIGVERSION >= 0x040000
++#undef obj0
++#endif
+ Py_DECREF(resultobj);
+ resultobj = (PyObject*) ar;
+ }
+diff --git a/swig/python/extensions/gdal_wrap.cpp b/swig/python/extensions/gdal_wrap.cpp
+index 37cb635339e..f2f014fd0b5 100644
+--- a/swig/python/extensions/gdal_wrap.cpp
++++ b/swig/python/extensions/gdal_wrap.cpp
+@@ -15238,7 +15238,14 @@ SWIGINTERN PyObject *_wrap_VirtualMem_GetAddr(PyObject *SWIGUNUSEDPARM(self), Py
+ #if PY_VERSION_HEX >= 0x02070000
+ /* %typemap(argout) (void** pptr, size_t* pnsize, GDALDataType* pdatatype, int* preadonly)*/
+ Py_buffer *buf=(Py_buffer*)malloc(sizeof(Py_buffer));
+- if (PyBuffer_FillInfo(buf, obj0, *(arg2), *(arg3), *(arg5), PyBUF_ND)) {
++
++ if (PyBuffer_FillInfo(buf,
++ #if SWIGVERSION >= 0x040000
++ swig_obj[0],
++ #else
++ obj0,
++ #endif
++ *(arg2), *(arg3), *(arg5), PyBUF_ND)) {
+ // error, handle
+ }
+ if( *(arg4) == GDT_Byte )