[med-svn] [Git][med-team/ball][master] 3 commits: Renamed fix-missing-PyString.patch to fix-python-bindings.patch
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Wed Dec 15 22:20:12 GMT 2021
Étienne Mollier pushed to branch master at Debian Med / ball
Commits:
ea3cdfac by Étienne Mollier at 2021-12-15T22:10:07+01:00
Renamed fix-missing-PyString.patch to fix-python-bindings.patch
- - - - -
d41d2908 by Étienne Mollier at 2021-12-15T22:10:20+01:00
fix-python-bindings.patch: port PyInt_ to PyLong_
- - - - -
f14f4967 by Étienne Mollier at 2021-12-15T23:19:37+01:00
update changelog
- - - - -
3 changed files:
- debian/changelog
- debian/patches/fix-missing-PyString.patch → debian/patches/fix-python-bindings.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -11,9 +11,10 @@ ball (1.5.0+git20180813.37fc53c-10) UNRELEASED; urgency=medium
* d/rules: set SIP_LIBRARIES cmake variable; trigger sip bindings build.
* Add fix-findsip.patch: adjust cmake file to trigger build.
This also fixes a minor ftbfs in bindings, likely due to move to gcc-11.
- * Add fix-missing-PyString.patch: adjust PyString bindings to python3.
+ * Add fix-python-bindings.patch: adjust PyString_ and PyInt_ bindings to
+ match types in use in Python 3.
- -- Étienne Mollier <emollier at debian.org> Wed, 15 Dec 2021 21:17:22 +0100
+ -- Étienne Mollier <emollier at debian.org> Wed, 15 Dec 2021 23:18:33 +0100
ball (1.5.0+git20180813.37fc53c-9) unstable; urgency=medium
=====================================
debian/patches/fix-missing-PyString.patch → debian/patches/fix-python-bindings.patch
=====================================
@@ -73,6 +73,21 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
};
--- ball.orig/source/PYTHON/EXTENSIONS/BALL/atom.sip
+++ ball/source/PYTHON/EXTENSIONS/BALL/atom.sip
+@@ -7,11 +7,11 @@
+ public:
+ %ConvertToTypeCode
+ if (sipIsErr == NULL)
+- return PyInt_Check(sipPy) || BALL_CAN_CONVERT_TO_INSTANCE(sipPy, Atom);
++ return PyLong_Check(sipPy) || BALL_CAN_CONVERT_TO_INSTANCE(sipPy, Atom);
+
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+- *sipCppPtr = new AtomType(PyInt_AS_LONG(sipPy));
++ *sipCppPtr = new AtomType(PyLong_AS_LONG(sipPy));
+
+ return 1;
+ }
@@ -23,12 +23,12 @@
SIP_PYOBJECT __str__();
@@ -150,7 +165,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- ball.orig/source/PYTHON/EXTENSIONS/BALL/file.sip
+++ ball/source/PYTHON/EXTENSIONS/BALL/file.sip
-@@ -66,7 +66,7 @@
+@@ -66,16 +66,16 @@
case (int)std::ios::in: mode_string = "std::ios::in"; break;
default: mode_string = "";
}
@@ -159,6 +174,18 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
%End
%ConvertToTypeCode
+ if (sipIsErr == NULL)
+- return (PyInt_Check(sipPy) || BALL_IS_SUBCLASS_INSTANCE(sipPy, OpenMode));
++ return (PyLong_Check(sipPy) || BALL_IS_SUBCLASS_INSTANCE(sipPy, OpenMode));
+
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+- int mode = PyInt_AS_LONG(sipPy);
++ int mode = PyLong_AS_LONG(sipPy);
+ File::OpenMode result;
+ switch (mode)
+ {
--- ball.orig/source/PYTHON/EXTENSIONS/BALL/fragment.sip
+++ ball/source/PYTHON/EXTENSIONS/BALL/fragment.sip
@@ -18,7 +18,7 @@
@@ -460,3 +487,159 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+ " { "
+ " Grid: " + String((long int)sipCpp->getGrid())
+ " Texture: " + String(sipCpp->getTexture())
+--- ball.orig/source/PYTHON/EXTENSIONS/BALL/global.sip
++++ ball/source/PYTHON/EXTENSIONS/BALL/global.sip
+@@ -7,12 +7,12 @@
+ %ConvertToTypeCode
+ if (sipIsErr == NULL)
+ {
+- return PyInt_Check(sipPy);
++ return PyLong_Check(sipPy);
+ }
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+ *sipCppPtr = new Index;
+- **sipCppPtr = PyInt_AsLong(sipPy);
++ **sipCppPtr = PyLong_AsLong(sipPy);
+
+ return 1;
+ }
+@@ -22,9 +22,9 @@
+ %ConvertFromTypeCode
+ if (sipCpp == NULL)
+ {
+- return PyInt_FromLong(0);
++ return PyLong_FromLong(0);
+ }
+- return PyInt_FromLong(*sipCpp);
++ return PyLong_FromLong(*sipCpp);
+ %End
+ };
+
+@@ -36,12 +36,12 @@
+ %ConvertToTypeCode
+ if (sipIsErr == NULL)
+ {
+- return PyInt_Check(sipPy);
++ return PyLong_Check(sipPy);
+ }
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+ *sipCppPtr = new Position;
+- **sipCppPtr = PyInt_AsLong(sipPy);
++ **sipCppPtr = PyLong_AsLong(sipPy);
+
+ return 1;
+ }
+@@ -51,9 +51,9 @@
+ %ConvertFromTypeCode
+ if (sipCpp == NULL)
+ {
+- return PyInt_FromLong(0);
++ return PyLong_FromLong(0);
+ }
+- return PyInt_FromLong(*sipCpp);
++ return PyLong_FromLong(*sipCpp);
+ %End
+ };
+
+@@ -66,12 +66,12 @@
+ %ConvertToTypeCode
+ if (sipIsErr == NULL)
+ {
+- return PyInt_Check(sipPy);
++ return PyLong_Check(sipPy);
+ }
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+ *sipCppPtr = new LongIndex;
+- **sipCppPtr = PyInt_AsLong(sipPy);
++ **sipCppPtr = PyLong_AsLong(sipPy);
+
+ return 1;
+ }
+@@ -81,9 +81,9 @@
+ %ConvertFromTypeCode
+ if (sipCpp == NULL)
+ {
+- return PyInt_FromLong(0);
++ return PyLong_FromLong(0);
+ }
+- return PyInt_FromLong(*sipCpp);
++ return PyLong_FromLong(*sipCpp);
+ %End
+ };
+
+@@ -96,12 +96,12 @@
+ %ConvertToTypeCode
+ if (sipIsErr == NULL)
+ {
+- return PyInt_Check(sipPy);
++ return PyLong_Check(sipPy);
+ }
+- if (PyInt_Check(sipPy))
++ if (PyLong_Check(sipPy))
+ {
+ *sipCppPtr = new Time;
+- **sipCppPtr = PyInt_AsLong(sipPy);
++ **sipCppPtr = PyLong_AsLong(sipPy);
+
+ return 1;
+ }
+@@ -111,9 +111,9 @@
+ %ConvertFromTypeCode
+ if (sipCpp == NULL)
+ {
+- return PyInt_FromLong(0);
++ return PyLong_FromLong(0);
+ }
+- return PyInt_FromLong(*sipCpp);
++ return PyLong_FromLong(*sipCpp);
+ %End
+ };
+
+--- ball.orig/source/PYTHON/EXTENSIONS/BALL/pair.sip
++++ ball/source/PYTHON/EXTENSIONS/BALL/pair.sip
+@@ -165,8 +165,8 @@
+ if ((t = PyTuple_New(2)) == NULL)
+ return NULL;
+
+- PyTuple_SET_ITEM(t, 0, PyInt_FromLong(sipCpp->first));
+- PyTuple_SET_ITEM(t, 1, PyInt_FromLong(sipCpp->second));
++ PyTuple_SET_ITEM(t, 0, PyLong_FromLong(sipCpp->first));
++ PyTuple_SET_ITEM(t, 1, PyLong_FromLong(sipCpp->second));
+
+ return t;
+ %End
+@@ -184,7 +184,7 @@
+ std::pair<Position,Position>* result = 0;
+
+ if(!*sipIsErr) {
+- result = new std::pair<Position, Position>(PyInt_AsLong(PyNumber_Int(PyTuple_GET_ITEM(sipPy, 0))), PyInt_AsLong(PyNumber_Int(PyTuple_GET_ITEM(sipPy, 1))));
++ result = new std::pair<Position, Position>(PyLong_AsLong(PyNumber_Int(PyTuple_GET_ITEM(sipPy, 0))), PyLong_AsLong(PyNumber_Int(PyTuple_GET_ITEM(sipPy, 1))));
+ }
+
+
+--- ball.orig/source/PYTHON/EXTENSIONS/BALL/pyIndexList.sip
++++ ball/source/PYTHON/EXTENSIONS/BALL/pyIndexList.sip
+@@ -15,7 +15,7 @@
+ // Convert the list.
+ for (PyIndexList::ConstIterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
+ {
+- if (PyList_Append(pl, PyInt_FromLong(*it)) < 0)
++ if (PyList_Append(pl, PyLong_FromLong(*it)) < 0)
+ {
+ Py_DECREF(pl);
+ return NULL;
+@@ -38,7 +38,7 @@
+
+ for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
+ {
+- Index index = PyInt_AsLong(PyList_GET_ITEM(sipPy,i));
++ Index index = PyLong_AsLong(PyList_GET_ITEM(sipPy,i));
+ index_list -> push_back(index);
+ }
+
=====================================
debian/patches/series
=====================================
@@ -3,4 +3,4 @@ fix-ftbfs-char.patch
missing_GLEW
2to3.patch
fix-findsip.patch
-fix-missing-PyString.patch
+fix-python-bindings.patch
View it on GitLab: https://salsa.debian.org/med-team/ball/-/compare/a0bea5452d17dcd890af0077df2feceb8901ade3...f14f4967f82544d27d216e1f15ffad2146aba1fe
--
View it on GitLab: https://salsa.debian.org/med-team/ball/-/compare/a0bea5452d17dcd890af0077df2feceb8901ade3...f14f4967f82544d27d216e1f15ffad2146aba1fe
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20211215/3eb09fc6/attachment-0001.htm>
More information about the debian-med-commit
mailing list