summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMassimiliano Torromeo2024-01-11 22:11:37 +0100
committerMassimiliano Torromeo2024-01-11 22:11:37 +0100
commitc38a59cecd08da66ee93ab75700c95cb7c6e9437 (patch)
tree7c5f04e599d4e1e9fcb612863adfbed6f956b42b
parentc6a9de2b0ac8b92c7b4545f81bbea7dea57fb4e8 (diff)
downloadaur-python-pyuv.tar.gz
Patched for python 11
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD16
-rw-r--r--py11.patch66
3 files changed, 80 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1ad07e9f38ee..e006ec45b1a8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = python-pyuv
pkgdesc = A Python module which provides an interface to libuv.
pkgver = 1.4.0
- pkgrel = 1
+ pkgrel = 2
url = https://pyuv.readthedocs.io/
arch = i686
arch = x86_64
@@ -9,7 +9,8 @@ pkgbase = python-pyuv
depends = python
depends = libuv
source = https://github.com/saghul/pyuv/archive/pyuv-1.4.0.tar.gz
+ source = py11.patch
sha256sums = 922e1dd4c05085bc6257b8f254e5e8bc232647fc757d371002abe31a1ce31b07
+ sha256sums = 8423fb663235aa6b6c14065760bc569a1193400553b8e67bd7411a5c462c97f4
pkgname = python-pyuv
-
diff --git a/PKGBUILD b/PKGBUILD
index 05cfd054a28e..bf37e9b0ad74 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,24 +2,30 @@
pkgname=python-pyuv
pkgver=1.4.0
-pkgrel=1
+pkgrel=2
_libname=${pkgname/python-/}
pkgdesc="A Python module which provides an interface to libuv."
url="https://pyuv.readthedocs.io/"
license=('MIT')
arch=('i686' 'x86_64')
depends=('python' 'libuv')
-source=("https://github.com/saghul/pyuv/archive/$_libname-$pkgver.tar.gz")
+source=("https://github.com/saghul/pyuv/archive/$_libname-$pkgver.tar.gz" "py11.patch")
+
+prepare() {
+ cd $_libname-$_libname-$pkgver
+ patch -p1 -i ../py11.patch
+}
build() {
- cd "$srcdir"/$_libname-$_libname-$pkgver
+ cd $_libname-$_libname-$pkgver
python setup.py build_ext --use-system-libuv
}
package() {
- cd "$srcdir"/$_libname-$_libname-$pkgver
+ cd $_libname-$_libname-$pkgver
python setup.py install --skip-build --root="$pkgdir"
install -m0644 -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
-sha256sums=('922e1dd4c05085bc6257b8f254e5e8bc232647fc757d371002abe31a1ce31b07')
+sha256sums=('922e1dd4c05085bc6257b8f254e5e8bc232647fc757d371002abe31a1ce31b07'
+ '8423fb663235aa6b6c14065760bc569a1193400553b8e67bd7411a5c462c97f4')
diff --git a/py11.patch b/py11.patch
new file mode 100644
index 000000000000..51ae6e67aee5
--- /dev/null
+++ b/py11.patch
@@ -0,0 +1,66 @@
+From 8bddcc27052017b5b9cb89c24dbfdf06737b0dd3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
+Date: Mon, 4 Jul 2022 09:22:32 +0200
+Subject: [PATCH 1/2] core: fix building against python-3.10
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Specifically this build error:
+
+ In file included from src/pyuv.c:8:
+ src/handle.c: In function ‘resurrect_object’:
+ src/handle.c:17:21: error: lvalue required as left operand of assignment
+ 17 | Py_REFCNT(self) = refcnt;
+ | ^
+
+Fixes https://github.com/saghul/pyuv/issues/271.
+
+Co-authored-by: @polkovnikov
+---
+ src/handle.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/handle.c b/src/handle.c
+index fa308e26..c43b602e 100644
+--- a/src/handle.c
++++ b/src/handle.c
+@@ -14,7 +14,11 @@ resurrect_object(PyObject *self)
+ Py_ssize_t refcnt = Py_REFCNT(self);
+ ASSERT(Py_REFCNT(self) != 0);
+ _Py_NewReference(self);
++#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 10
++ Py_SET_REFCNT(self, refcnt);
++#else
+ Py_REFCNT(self) = refcnt;
++#endif
+ /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
+ * we need to undo that. */
+ #ifdef _Py_DEC_REFTOTAL
+
+From 2a3d42d44c6315ebd73899a35118380d2d5979b5 Mon Sep 17 00:00:00 2001
+From: Tommaso Caiazzi <tommasocaiazzi@gmail.com>
+Date: Mon, 15 May 2023 18:48:01 +0200
+Subject: [PATCH 2/2] build: fix building for Python3.11
+
+Co-authored-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
+---
+ src/common.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/common.c b/src/common.c
+index ecac76ea..e6bf2935 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -39,7 +39,11 @@ pyuv_PyUnicode_EncodeFSDefault(PyObject *unicode)
+ return PyUnicode_AsEncodedString(unicode, Py_FileSystemDefaultEncoding, "surrogateescape");
+ else
+ #endif
++ #if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 11
++ return PyUnicode_AsUTF8String(unicode);
++ #else
+ return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), "surrogateescape");
++ #endif
+ }
+
+