diff mbox series

[meta-python,2/7] python3-pyephem: Fix build with python3 and musl

Message ID 20220829065649.808556-2-raj.khem@gmail.com
State New
Headers show
Series [meta-python,1/7] python3-netifaces: Fix build with python3 and musl | expand

Commit Message

Khem Raj Aug. 29, 2022, 6:56 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../0001-Don-t-set-tp_print-on-Python-3.patch | 44 +++++++++++++++++++
 .../python-pyephem/python3-pyephem_4.1.3.bb   |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta-python/recipes-extended/python-pyephem/python3-pyephem/0001-Don-t-set-tp_print-on-Python-3.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-extended/python-pyephem/python3-pyephem/0001-Don-t-set-tp_print-on-Python-3.patch b/meta-python/recipes-extended/python-pyephem/python3-pyephem/0001-Don-t-set-tp_print-on-Python-3.patch
new file mode 100644
index 0000000000..a84d852fb0
--- /dev/null
+++ b/meta-python/recipes-extended/python-pyephem/python3-pyephem/0001-Don-t-set-tp_print-on-Python-3.patch
@@ -0,0 +1,44 @@ 
+From 866f7560034e8b7a604432611b3cb2c92e76def9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 28 Aug 2022 11:03:39 -0700
+Subject: [PATCH] Don't set tp_print on Python 3.
+
+In 3.8 it produces a compilation warning, in earlier versions it is ignored.
+
+Upstream-Status: Submitted [https://github.com/brandon-rhodes/pyephem/pull/245]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ extensions/_libastro.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/extensions/_libastro.c b/extensions/_libastro.c
+index ce07d93..c9ef1e6 100644
+--- a/extensions/_libastro.c
++++ b/extensions/_libastro.c
+@@ -372,7 +372,11 @@ static PyTypeObject AngleType = {
+      sizeof(AngleObject),
+      0,
+      0,				/* tp_dealloc */
++#if PY_MAJOR_VERSION < 3
+      Angle_print,		/* tp_print */
++#else
++     0,				/* reserved in 3.x */
++#endif
+      0,				/* tp_getattr */
+      0,				/* tp_setattr */
+      0,				/* tp_compare */
+@@ -669,7 +673,11 @@ static PyTypeObject DateType = {
+      sizeof(PyFloatObject),
+      0,
+      0,				/* tp_dealloc */
++#if PY_MAJOR_VERSION < 3
+      Date_print,		/* tp_print */
++#else
++     0,				/* tp_print slot is reserved and unused in Python 3 */
++#endif
+      0,				/* tp_getattr */
+      0,				/* tp_setattr */
+      0,				/* tp_compare */
+-- 
+2.37.2
+
diff --git a/meta-python/recipes-extended/python-pyephem/python3-pyephem_4.1.3.bb b/meta-python/recipes-extended/python-pyephem/python3-pyephem_4.1.3.bb
index 29697bc251..8c4f0eb405 100644
--- a/meta-python/recipes-extended/python-pyephem/python3-pyephem_4.1.3.bb
+++ b/meta-python/recipes-extended/python-pyephem/python3-pyephem_4.1.3.bb
@@ -4,6 +4,7 @@  HOMEPAGE = "http://rhodesmill.org/pyephem/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=9c930b395b435b00bb13ec83b0c99f40"
 
+SRC_URI += "file://0001-Don-t-set-tp_print-on-Python-3.patch"
 SRC_URI[sha256sum] = "7fa18685981ba528edd504052a9d5212a09aa5bf15c11a734edc6a86e8a8b56a"
 
 PYPI_PACKAGE = "ephem"