svn commit: r530238 - in head/misc/openvdb: . files
Yuri Victorovich
yuri at FreeBSD.org
Wed Apr 1 20:15:44 UTC 2020
Author: yuri
Date: Wed Apr 1 20:06:02 2020
New Revision: 530238
URL: https://svnweb.freebsd.org/changeset/ports/530238
Log:
misc/openvdb: Replace the dependency on python 2.7 with the default python (currently 3.x)
PR: 244347
Submitted by: VVD <vvd at unislabs.com>
Added:
head/misc/openvdb/files/patch-openvdb_python_pyOpenVDBModule.cc (contents, props changed)
Modified:
head/misc/openvdb/Makefile
Modified: head/misc/openvdb/Makefile
==============================================================================
--- head/misc/openvdb/Makefile Wed Apr 1 20:05:55 2020 (r530237)
+++ head/misc/openvdb/Makefile Wed Apr 1 20:06:02 2020 (r530238)
@@ -28,7 +28,7 @@ OPTIONS_DEFINE= PYTHON TOOLS DOCS # TOOLS should be a
OPTIONS_DEFAULT= PYTHON TOOLS
OPTIONS_SUB= yes
-PYTHON_USES= python:2.7 # 3.6 is broken: https://github.com/AcademySoftwareFoundation/openvdb/issues/427
+PYTHON_USES= python
PYTHON_CMAKE_BOOL= OPENVDB_BUILD_PYTHON_MODULE
PYTHON_CMAKE_ON= -DFREEBSD_PYTHON_VER:STRING=${PYTHON_VER} -DUSE_NUMPY:BOOL=ON
PYTHON_LIB_DEPENDS= ${PY_BOOST}
Added: head/misc/openvdb/files/patch-openvdb_python_pyOpenVDBModule.cc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/misc/openvdb/files/patch-openvdb_python_pyOpenVDBModule.cc Wed Apr 1 20:06:02 2020 (r530238)
@@ -0,0 +1,26 @@
+--- openvdb/python/pyOpenVDBModule.cc.orig 2019-05-07 20:58:35 UTC
++++ openvdb/python/pyOpenVDBModule.cc
+@@ -320,7 +320,11 @@ struct PointIndexConverter
+ /// @return nullptr if the given Python object is not convertible to the PointIndex.
+ static void* convertible(PyObject* obj)
+ {
++#if PY_MAJOR_VERSION >= 3
++ if (!PyLong_Check(obj)) return nullptr; // not a Python integer
++#else
+ if (!PyInt_Check(obj)) return nullptr; // not a Python integer
++#endif
+ return obj;
+ }
+
+@@ -337,7 +341,11 @@ struct PointIndexConverter
+ // Extract the PointIndex from the python integer
+ PointIndexT* index = static_cast<PointIndexT*>(storage);
+
++#if PY_MAJOR_VERSION >= 3
++ *index = static_cast<IntType>(PyLong_AsLong(obj));
++#else
+ *index = static_cast<IntType>(PyInt_AsLong(obj));
++#endif
+ }
+
+ /// Register both the PointIndex-to-integer and the integer-to-PointIndex converters.
More information about the svn-ports-all
mailing list