[Pkg-virtualbox-commits] [virtualbox] 02/02: Python3
Gianfranco Costamagna
locutusofborg at moszumanska.debian.org
Thu Oct 20 16:34:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
locutusofborg pushed a commit to branch master
in repository virtualbox.
commit 1ced9b29e84bef02ef736dce3067952ad8ce3789
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date: Thu Oct 20 17:55:30 2016 +0200
Python3
---
debian/changelog | 8 +++++
debian/patches/python3.patch | 81 ++++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 90 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 18dd65e..ecb8369 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+virtualbox (5.1.8-dfsg-4) unstable; urgency=medium
+
+ * cherry-pick upstream 64330 to bring Python3
+ - debian/patches/python3.patch
+ switch finally to Python3 (LP: #1528016, Closes: #830878)
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org> Thu, 20 Oct 2016 14:34:26 +0200
+
virtualbox (5.1.8-dfsg-3) unstable; urgency=medium
* Fix build with the correct upstream patch.
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
new file mode 100644
index 0000000..f168f3b
--- /dev/null
+++ b/debian/patches/python3.patch
@@ -0,0 +1,81 @@
+Origin: https://www.virtualbox.org/changeset/64330/vbox
+Index: virtualbox/src/libs/xpcom18a4/python/src/PyIID.cpp
+===================================================================
+--- virtualbox.orig/src/libs/xpcom18a4/python/src/PyIID.cpp
++++ virtualbox/src/libs/xpcom18a4/python/src/PyIID.cpp
+@@ -318,12 +318,21 @@
+ return ret;
+ }
+
++#if PY_VERSION_HEX >= 0x03020000
++/* static */Py_hash_t
++Py_nsIID::PyTypeMethod_hash(PyObject *self)
++#else
+ /* static */long
+ Py_nsIID::PyTypeMethod_hash(PyObject *self)
++#endif
+ {
+ const nsIID &iid = ((Py_nsIID *)self)->m_iid;
+
++#if PY_VERSION_HEX >= 0x03020000
++ Py_hash_t ret = iid.m0 + iid.m1 + iid.m2;
++#else
+ long ret = iid.m0 + iid.m1 + iid.m2;
++#endif
+ for (int i=0;i<7;i++)
+ ret += iid.m3[i];
+ if ( ret == -1 )
+Index: virtualbox/src/libs/xpcom18a4/python/src/PyXPCOM.h
+===================================================================
+--- virtualbox.orig/src/libs/xpcom18a4/python/src/PyXPCOM.h
++++ virtualbox/src/libs/xpcom18a4/python/src/PyXPCOM.h
+@@ -286,7 +286,11 @@
+ static int Py_setattr(PyObject *op, char *name, PyObject *v);
+ static int Py_cmp(PyObject *ob1, PyObject *ob2);
+ static PyObject *Py_richcmp(PyObject *ob1, PyObject *ob2, int op);
++#if PY_VERSION_HEX >= 0x03020000
++ static Py_hash_t Py_hash(PyObject *self);
++#else
+ static long Py_hash(PyObject *self);
++#endif
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+@@ -442,7 +446,11 @@
+ #endif
+ static PyObject *PyTypeMethod_richcompare(PyObject *self, PyObject *ob, int op);
+ static PyObject *PyTypeMethod_repr(PyObject *self);
++#if PY_VERSION_HEX >= 0x03020000
++ static Py_hash_t PyTypeMethod_hash(PyObject *self);
++#else
+ static long PyTypeMethod_hash(PyObject *self);
++#endif
+ static PyObject *PyTypeMethod_str(PyObject *self);
+ static void PyTypeMethod_dealloc(PyObject *self);
+ static NS_EXPORT_STATIC_MEMBER_(PyTypeObject) type;
+Index: virtualbox/src/libs/xpcom18a4/python/src/TypeObject.cpp
+===================================================================
+--- virtualbox.orig/src/libs/xpcom18a4/python/src/TypeObject.cpp
++++ virtualbox/src/libs/xpcom18a4/python/src/TypeObject.cpp
+@@ -155,13 +155,21 @@
+ }
+
+ // @pymethod int|Py_nsISupports|__hash__|Implement a hash-code for the XPCOM object using XPCOM identity rules.
++#if PY_VERSION_HEX >= 0x03020000
++/*static*/Py_hash_t PyXPCOM_TypeObject::Py_hash(PyObject *self)
++#else
+ /*static*/long PyXPCOM_TypeObject::Py_hash(PyObject *self)
++#endif
+ {
+ // We always return the value of the nsISupports *.
+ nsISupports *pUnkThis;
+ if (!Py_nsISupports::InterfaceFromPyObject(self, NS_GET_IID(nsISupports), &pUnkThis, PR_FALSE))
+ return -1;
++#if PY_VERSION_HEX >= 0x03020000
++ Py_hash_t ret = _Py_HashPointer(pUnkThis);
++#else
+ long ret = _Py_HashPointer(pUnkThis);
++#endif
+ pUnkThis->Release();
+ return ret;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 9d721a2..237597e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@
35-libvdeplug-soname.patch
36-fix-vnc-version-string.patch
fix-build.patch
+python3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git
More information about the Pkg-virtualbox-commits
mailing list