summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmytro Meleshko2022-02-22 12:46:18 +0200
committerDmytro Meleshko2022-02-22 12:46:18 +0200
commit8efc5020bf54ab0654264c4849b362bbbb76e2af (patch)
tree6e7f7e383412f42c5fbeeac9b2d1013a61210927
parent37608dd7f13a859d4e44dfeb0aeb1480d34d3a98 (diff)
downloadaur-mirage-python3.tar.gz
fix usages of Py_ssize_t on Python 3.10
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD8
-rw-r--r--mirage-python3-fix-segfault-on-python310.patch12
-rw-r--r--mirage-python3-python310-fixes.patch71
4 files changed, 78 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d058c681832b..4eaf6a66c897 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = mirage-python3
pkgdesc = A fast and simple GTK+ Image Viewer (Python3 port)
pkgver = 0.11.1
- pkgrel = 4
+ pkgrel = 5
url = https://gitlab.com/thomasross/mirage
arch = any
license = GPL3
@@ -15,10 +15,10 @@ pkgbase = mirage-python3
source = mirage-python3-0.11.1.tar.bz2::https://gitlab.com/thomasross/mirage/-/archive/0.11.1/mirage-0.11.1.tar.bz2
source = mirage-python3-0.11.1.debian.tar.xz::https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/mirage/0.11.1-1build2/mirage_0.11.1-1build2.debian.tar.xz
source = mirage-python3.patch
- source = mirage-python3-fix-segfault-on-python310.patch
+ source = mirage-python3-python310-fixes.patch
sha256sums = 2932f7e9e6a1da7785cae2664669eff6f12ca26163afb3d1a3c8e1cc3255e5ec
sha256sums = 48b5cf3ff7d50d602ea673a424ffd659ab8813ce7dd1837b574cf39eb732c50a
sha256sums = 2de9c32689e1b0d2c559ea68b5eca4f0b37a53ddd8687b7a9c36b51c11ffee6b
- sha256sums = 8f3d30ca118c939fe5d05ac90da7faa427375167585ff246e9641499f5712804
+ sha256sums = 485546cf69a018ff5580af3f8aef921fe99624034f9e1915958285f5d8524a4d
pkgname = mirage-python3
diff --git a/PKGBUILD b/PKGBUILD
index 20389d73aa9d..2d9d64d60003 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname=mirage
pkgname="${_pkgname}-python3"
pkgver=0.11.1
-pkgrel=4
+pkgrel=5
_debian_pkgrel=1build2
pkgdesc="A fast and simple GTK+ Image Viewer (Python3 port)"
arch=('any')
@@ -15,16 +15,16 @@ depends=('python' 'gtk3' 'python-gobject' 'python-cairo' 'libgexiv2')
source=("${pkgname}-${pkgver}.tar.bz2::https://gitlab.com/thomasross/${_pkgname}/-/archive/${pkgver}/${_pkgname}-${pkgver}.tar.bz2"
"${pkgname}-${pkgver}.debian.tar.xz::https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/${_pkgname}/${pkgver}-${_debian_pkgrel}/${_pkgname}_${pkgver}-${_debian_pkgrel}.debian.tar.xz"
"${pkgname}.patch"
- "${pkgname}-fix-segfault-on-python310.patch")
+ "${pkgname}-python310-fixes.patch")
sha256sums=('2932f7e9e6a1da7785cae2664669eff6f12ca26163afb3d1a3c8e1cc3255e5ec'
'48b5cf3ff7d50d602ea673a424ffd659ab8813ce7dd1837b574cf39eb732c50a'
'2de9c32689e1b0d2c559ea68b5eca4f0b37a53ddd8687b7a9c36b51c11ffee6b'
- '8f3d30ca118c939fe5d05ac90da7faa427375167585ff246e9641499f5712804')
+ '485546cf69a018ff5580af3f8aef921fe99624034f9e1915958285f5d8524a4d')
prepare() {
cd "${_pkgname}-${pkgver}"
patch --forward --strip=1 --input="${srcdir}/${pkgname}.patch"
- patch --forward --strip=1 --input="${srcdir}/${pkgname}-fix-segfault-on-python310.patch"
+ patch --forward --strip=1 --input="${srcdir}/${pkgname}-python310-fixes.patch"
}
build() {
diff --git a/mirage-python3-fix-segfault-on-python310.patch b/mirage-python3-fix-segfault-on-python310.patch
deleted file mode 100644
index 890d5754d16f..000000000000
--- a/mirage-python3-fix-segfault-on-python310.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/mirage/xmouse.c b/mirage/xmouse.c
-index 0309676..e26cb18 100644
---- a/mirage/xmouse.c
-+++ b/mirage/xmouse.c
-@@ -39,6 +39,7 @@ static PyMethodDef methods[] =
- {
- {"geometry", xmouse_geometry, METH_VARARGS,
- "Get the geometry of the window under the mouse cursor."},
-+ {NULL, NULL, 0}
- };
-
- static PyModuleDef xmouse_module = {
diff --git a/mirage-python3-python310-fixes.patch b/mirage-python3-python310-fixes.patch
new file mode 100644
index 000000000000..3ca29e7fc2bf
--- /dev/null
+++ b/mirage-python3-python310-fixes.patch
@@ -0,0 +1,71 @@
+diff --git a/mirage/imgfuncs.c b/mirage/imgfuncs.c
+index 88621c6..bd97e98 100644
+--- a/mirage/imgfuncs.c
++++ b/mirage/imgfuncs.c
+@@ -1,3 +1,4 @@
++#define PY_SSIZE_T_CLEAN
+ #include "Python.h"
+ /**
+ * copy length chars from source to dest
+@@ -14,7 +15,7 @@ PyObject *rotate_right(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -61,7 +62,7 @@ PyObject *rotate_left(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -108,7 +109,7 @@ PyObject *rotate_mirror(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -151,7 +152,7 @@ PyObject *flip_vert(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -194,7 +195,7 @@ PyObject *flip_horiz(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+diff --git a/mirage/xmouse.c b/mirage/xmouse.c
+index 0309676..c368300 100644
+--- a/mirage/xmouse.c
++++ b/mirage/xmouse.c
+@@ -1,3 +1,4 @@
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+ #include <X11/Xlib.h>
+
+@@ -39,6 +40,7 @@ static PyMethodDef methods[] =
+ {
+ {"geometry", xmouse_geometry, METH_VARARGS,
+ "Get the geometry of the window under the mouse cursor."},
++ {NULL, NULL, 0}
+ };
+
+ static PyModuleDef xmouse_module = {