diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2016-09-16 18:48:04 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2016-09-16 18:48:04 +0000 |
commit | 7006249e8e026aaa92d5c259e37cb5438a7978fb (patch) | |
tree | 69219ab3e31abdfb1c603833423fd71032c6ddd8 /emulators/virtualbox-ose | |
parent | 76df7a9df994ee190e11bf391aa8f4d84064dfbc (diff) |
Notes
Diffstat (limited to 'emulators/virtualbox-ose')
5 files changed, 104 insertions, 19 deletions
diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index 8f5a34f39d17..56ac1b22bebe 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -121,7 +121,7 @@ ENV= PLIST_SUB+= GUEST_VER=${PORTVERSION} \ PYTHON_VER=${PYTHON_VER} \ - PYTHON_VERU=${PYTHON_VER:S/./_/} \ + PYTHON_VERU=${PYTHON_VER:S/./_/}${PYTHON_ABIVER} \ VBOXGROUP=${VBOXGROUP} SUB_LIST+= VBOXDIR=${VBOX_DIR} \ VBOXGROUP=${VBOXGROUP} \ @@ -163,7 +163,7 @@ USE_TEX= dvipsk:build formats:build .endif .if ${PORT_OPTIONS:MPYTHON} -USES+= python:2 +USES+= python USE_PYTHON= distutils noegginfo PYDISTUTILS_PKGNAME= vboxapi PYDISTUTILS_PKGVERSION= 1.0 @@ -236,6 +236,14 @@ EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-Config.kmk \ ${PATCHDIR}/extrapatch-src-recompiler-Makefile.kmk .endif +.if ${PYTHON_MAJOR_VER} >= 3 +PLIST_SUB+= PYTHON_PYCDIR=/__pycache__/ \ + PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc +.else +PLIST_SUB+= PYTHON_PYCDIR=/ \ + PYTHON_PYCEXT=.pyc +.endif + .if ${SSL_DEFAULT} != base CONFIGURE_ARGS+= --with-openssl-dir="${OPENSSLBASE}" .endif @@ -320,6 +328,7 @@ post-patch: ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py @${REINPLACE_CMD} \ -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' \ + -e 's|SUPPYTHONLIBS=.*|SUPPYTHONLIBS="${PYTHON_VERSION}${PYTHON_ABIVER}"|' \ ${WRKSRC}/configure .if empty(ICONV_LIB) @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk \ @@ -329,6 +338,9 @@ post-patch: @${REINPLACE_CMD} -e 's|/usr/local/lib/virtualbox|${VBOX_DIR}|' \ -e 's|/usr/local|${PREFIX}|' \ ${WRKSRC}/src/VBox/Installer/freebsd/VBox.sh + @${REINPLACE_CMD} \ + -e 's|^versions =.*|versions = ["${PYTHON_VER}${PYTHON_ABIVER}"]|' \ + ${WRKSRC}/src/libs/xpcom18a4/python/gen_python_deps.py do-build: cd ${WRKSRC} && ${SH} -c '. ${WRKSRC}/env.sh && \ diff --git a/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyIID.cpp b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyIID.cpp new file mode 100644 index 000000000000..214dcf093fbd --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyIID.cpp @@ -0,0 +1,23 @@ +--- src/libs/xpcom18a4/python/src/PyIID.cpp.orig 2016-09-12 16:20:10 UTC ++++ src/libs/xpcom18a4/python/src/PyIID.cpp +@@ -318,12 +318,20 @@ Py_nsIID::PyTypeMethod_str(PyObject *sel + return ret; + } + ++#if PY_VERSION_HEX < 0x03020000 + /* static */long ++#else ++/* static */Py_hash_t ++#endif + Py_nsIID::PyTypeMethod_hash(PyObject *self) + { + const nsIID &iid = ((Py_nsIID *)self)->m_iid; + ++#if PY_VERSION_HEX < 0x03020000 + long ret = iid.m0 + iid.m1 + iid.m2; ++#else ++ Py_hash_t ret = iid.m0 + iid.m1 + iid.m2; ++#endif + for (int i=0;i<7;i++) + ret += iid.m3[i]; + if ( ret == -1 ) diff --git a/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyXPCOM.h b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyXPCOM.h new file mode 100644 index 000000000000..baaa90a52126 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_PyXPCOM.h @@ -0,0 +1,26 @@ +--- src/libs/xpcom18a4/python/src/PyXPCOM.h.orig 2016-09-12 16:20:10 UTC ++++ src/libs/xpcom18a4/python/src/PyXPCOM.h +@@ -286,7 +286,11 @@ public: + 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 long Py_hash(PyObject *self); ++#else ++ static Py_hash_t Py_hash(PyObject *self); ++#endif + }; + + ////////////////////////////////////////////////////////////////////////// +@@ -442,7 +446,11 @@ public: + #endif + static PyObject *PyTypeMethod_richcompare(PyObject *self, PyObject *ob, int op); + static PyObject *PyTypeMethod_repr(PyObject *self); ++#if PY_VERSION_HEX < 0x03020000 + static long PyTypeMethod_hash(PyObject *self); ++#else ++ static Py_hash_t PyTypeMethod_hash(PyObject *self); ++#endif + static PyObject *PyTypeMethod_str(PyObject *self); + static void PyTypeMethod_dealloc(PyObject *self); + static NS_EXPORT_STATIC_MEMBER_(PyTypeObject) type; diff --git a/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_TypeObject.cpp b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_TypeObject.cpp new file mode 100644 index 000000000000..a8fbc606a208 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_python_src_TypeObject.cpp @@ -0,0 +1,24 @@ +--- src/libs/xpcom18a4/python/src/TypeObject.cpp.orig 2016-09-12 16:20:11 UTC ++++ src/libs/xpcom18a4/python/src/TypeObject.cpp +@@ -155,13 +155,21 @@ PyXPCOM_TypeObject::Py_richcmp(PyObject + } + + // @pymethod int|Py_nsISupports|__hash__|Implement a hash-code for the XPCOM object using XPCOM identity rules. ++#if PY_VERSION_HEX < 0x03020000 + /*static*/long PyXPCOM_TypeObject::Py_hash(PyObject *self) ++#else ++/*static*/Py_hash_t 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 + long ret = _Py_HashPointer(pUnkThis); ++#else ++ Py_hash_t ret = _Py_HashPointer(pUnkThis); ++#endif + pUnkThis->Release(); + return ret; + } diff --git a/emulators/virtualbox-ose/pkg-plist b/emulators/virtualbox-ose/pkg-plist index 80869287f5e7..9f4e41d48bb6 100644 --- a/emulators/virtualbox-ose/pkg-plist +++ b/emulators/virtualbox-ose/pkg-plist @@ -335,39 +335,39 @@ include/virtualbox/xpcom/xptcstubsdef.inc include/virtualbox/xpcom/xptinfo.h %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi-1.0-py%%PYTHON_VER%%.egg-info %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/VirtualBox_constants.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/VirtualBox_constants.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/%%PYTHON_PYCDIR%%VirtualBox_constants%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/__init__.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/__init__.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/vboxapi/%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/__init__.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/__init__.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/components.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/components.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/%%PYTHON_PYCDIR%%components%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/file.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/file.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/%%PYTHON_PYCDIR%%file%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/nsError.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/nsError.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%nsError%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/primitives.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/primitives.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%primitives%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/vboxxpcom.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/vboxxpcom.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%vboxxpcom%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpcom_consts.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpcom_consts.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpcom_consts%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpt.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/xpt.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom%%PYTHON_PYCDIR%%xpt%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client/__init__.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client/__init__.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/client%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/__init__.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/__init__.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%__init__%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/enumerator.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/enumerator.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%enumerator%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/factory.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/factory.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%factory%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/loader.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/loader.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%loader%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/module.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/module.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%module%%PYTHON_PYCEXT%% %%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.py -%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server/policy.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/xpcom/server%%PYTHON_PYCDIR%%policy%%PYTHON_PYCEXT%% %%QT%%lib/virtualbox/DbgPlugInDiggers.so lib/virtualbox/VBox.sh lib/virtualbox/VBoxAuth.so |