Date: Tuesday, March 21, 2023 @ 02:12:57
  Author: cbehan
Revision: 1424563

upgpkg: ming 0.4.8.r68.g04aee523-4: Add patch for new swig

Added:
  ming/trunk/ming-0.4.8-swig-4.1.patch
Modified:
  ming/trunk/PKGBUILD

---------------------------+
 PKGBUILD                  |    8 ++++--
 ming-0.4.8-swig-4.1.patch |   55 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-03-21 01:53:19 UTC (rev 1424562)
+++ PKGBUILD    2023-03-21 02:12:57 UTC (rev 1424563)
@@ -3,7 +3,7 @@
 
 pkgname=ming
 pkgver=0.4.8.r68.g04aee523
-pkgrel=3
+pkgrel=4
 pkgdesc="SWF output library"
 arch=('x86_64')
 url="http://www.libming.net/";
@@ -11,9 +11,10 @@
 depends=('freetype2' 'libpng' 'flex' 'giflib')
 makedepends=('bison' 'pkgconf' 'swig' 'python' 'git')
 options=('!emptydirs')
-source=(git+https://github.com/libming/libming.git#commit=04aee52363688426eab74f5d6180c149654a6473
 py3.patch)
+source=(git+https://github.com/libming/libming.git#commit=04aee52363688426eab74f5d6180c149654a6473
 py3.patch ming-0.4.8-swig-4.1.patch)
 sha256sums=('SKIP'
-            'c33000d71c4e7308c6c4b7a3be05087d6b088b86caa841d0e11585c26cbc1e64')
+            'c33000d71c4e7308c6c4b7a3be05087d6b088b86caa841d0e11585c26cbc1e64'
+            '33cca7f5f5b17805a0ca1b56e4ef1e2be3492169bbb8500a3d872b3ac762758e')
 
 pkgver() {
   cd "$srcdir"/libming
@@ -24,6 +25,7 @@
   cd "$srcdir"/libming
   export CFLAGS="$CFLAGS -fcommon"
   git apply ../py3.patch
+  git apply ../ming-0.4.8-swig-4.1.patch
 
   ./autogen.sh
   PYTHON=/usr/bin/python ./configure --prefix=/usr --enable-python

Added: ming-0.4.8-swig-4.1.patch
===================================================================
--- ming-0.4.8-swig-4.1.patch                           (rev 0)
+++ ming-0.4.8-swig-4.1.patch   2023-03-21 02:12:57 UTC (rev 1424563)
@@ -0,0 +1,55 @@
+diff --git a/ming.i b/ming.i
+index 1860f770..a90e7e0d 100644
+--- a/ming.i
++++ b/ming.i
+@@ -11,7 +11,10 @@
+ 
+ %}
+ 
+-%typemap(python,in) FILE * {
++typedef unsigned char byte;
++
++#ifdef SWIGPYTHON
++%typemap(in) FILE * {
+   int temp = PyObject_AsFileDescriptor($input);
+   if (temp == -1) {
+     PyErr_SetString(PyExc_TypeError, "Need a file!");
+@@ -20,7 +23,7 @@
+   $1 = fdopen(temp, "r");
+ }
+ 
+-%typemap(python,in) char * {
++%typemap(in) char * {
+   if (!PyString_Check($input)) {
+     PyErr_SetString(PyExc_TypeError, "not a string");
+     return NULL;
+@@ -28,17 +31,17 @@
+   $1 = PyString_AsString($input);
+ }
+ 
+-typedef unsigned char byte;
+-
+-%typemap(python,in) byte * {
++%typemap(in) byte * {
+   if (!PyString_Check($input)) {
+     PyErr_SetString(PyExc_TypeError, "not a string");
+     return NULL;
+   }
+   $1 = PyString_AsString($input);
+ }
++#endif
+ 
+-%typemap(ruby,in) int * {
++#ifdef SWIGRUBY
++%typemap(in) int * {
+   if (NIL_P($input)) {
+          $1 = 0;
+   } else {
+@@ -46,6 +49,7 @@ typedef unsigned char byte;
+     $1 = (int *)RARRAY($input)->ptr;
+   }
+ }
++#endif
+ 
+ %pointer_functions(int, intp);
+ %pointer_functions(float, floatp);

Reply via email to