From owner-svn-ports-head@freebsd.org Wed Apr 1 20:15:44 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83B412A1A38; Wed, 1 Apr 2020 20:15:44 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48syB70gh4z48MY; Wed, 1 Apr 2020 20:15:43 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15094371C; Wed, 1 Apr 2020 20:06:03 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 031K62ZS053185; Wed, 1 Apr 2020 20:06:02 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 031K62F6053183; Wed, 1 Apr 2020 20:06:02 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <202004012006.031K62F6053183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Wed, 1 Apr 2020 20:06:02 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r530238 - in head/misc/openvdb: . files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/misc/openvdb: . files X-SVN-Commit-Revision: 530238 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2020 20:15:44 -0000 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 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(storage); + ++#if PY_MAJOR_VERSION >= 3 ++ *index = static_cast(PyLong_AsLong(obj)); ++#else + *index = static_cast(PyInt_AsLong(obj)); ++#endif + } + + /// Register both the PointIndex-to-integer and the integer-to-PointIndex converters.