diff --git a/misc/py-openvdb/Makefile b/misc/py-openvdb/Makefile index 545b34619b0f..1caafc26d9be 100644 --- a/misc/py-openvdb/Makefile +++ b/misc/py-openvdb/Makefile @@ -1,45 +1,46 @@ PORTNAME= openvdb DISTVERSIONPREFIX= v -DISTVERSION= 11.0.0 -PORTREVISION= 6 +DISTVERSION= 12.0.1 CATEGORIES= misc PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= yuri@FreeBSD.org COMMENT= Tools for storage and manipulation of sparse volumetric data -WWW= https://www.openvdb.org/ +WWW= https://www.openvdb.org \ + https://github.com/AcademySoftwareFoundation/openvdb LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/../../../LICENSE -BUILD_DEPENDS= pybind11>0:devel/pybind11 \ +BUILD_DEPENDS= nanobind>0:devel/nanobind \ ${PYNUMPY} LIB_DEPENDS= libboost_iostreams.so:devel/boost-libs \ libopenvdb.so:misc/openvdb \ libtbb.so:devel/onetbb RUN_DEPENDS= ${PYNUMPY} USES= cmake compiler:c++17-lang localbase:ldflags python USE_LDCONFIG= yes USE_PYTHON= flavors pytest USE_GITHUB= yes GH_ACCOUNT= AcademySoftwareFoundation CMAKE_ON= USE_NUMPY OPENVDB_PYTHON_WRAP_ALL_GRID_TYPES CMAKE_OFF= OPENVDB_BUILD_PYTHON_UNITTESTS -CMAKE_ARGS= -DPython_EXECUTABLE=${PYTHON_CMD} +CMAKE_ARGS= -DPython_EXECUTABLE=${PYTHON_CMD} \ + -DFREEBSD_PYTHON_VER=${PYTHON_VER} WRKSRC_SUBDIR= openvdb/openvdb/python TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} -PLIST_FILES= ${PYTHON_SITELIBDIR}/pyopenvdb${PYTHON_EXT_SUFFIX}.so +PLIST_FILES= ${PYTHON_SITELIBDIR}/openvdb${PYTHON_EXT_SUFFIX}.so do-test: # run an example, since the supplied test appears to be only for Windows @cd ${WRKSRC} && \ ${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/example.py && \ [ -f ${WRKSRC}/mygrids.vdb ] && \ ${ECHO} "Test has succeeded." .include diff --git a/misc/py-openvdb/distinfo b/misc/py-openvdb/distinfo index a13ad98f22cf..54699eb6d329 100644 --- a/misc/py-openvdb/distinfo +++ b/misc/py-openvdb/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1712017184 -SHA256 (AcademySoftwareFoundation-openvdb-v11.0.0_GH0.tar.gz) = 6314ff1db057ea90050763e7b7d7ed86d8224fcd42a82cdbb9c515e001b96c74 -SIZE (AcademySoftwareFoundation-openvdb-v11.0.0_GH0.tar.gz) = 4620858 +TIMESTAMP = 1743748486 +SHA256 (AcademySoftwareFoundation-openvdb-v12.0.1_GH0.tar.gz) = a3c8724ecadabaf558b6e1bd6f1d695e93b82a7cfdf144b8551e5253340ddce0 +SIZE (AcademySoftwareFoundation-openvdb-v12.0.1_GH0.tar.gz) = 4708771 diff --git a/misc/py-openvdb/files/example.py b/misc/py-openvdb/files/example.py index 7535f81dfb90..73436ebe8f38 100644 --- a/misc/py-openvdb/files/example.py +++ b/misc/py-openvdb/files/example.py @@ -1,33 +1,33 @@ # example from https://www.openvdb.org/documentation/doxygen/python.html -import pyopenvdb as vdb +import openvdb as vdb # A grid comprises a sparse tree representation of voxel data, # user-supplied metadata and a voxel space to world space transform, # which defaults to the identity transform. # A FloatGrid stores one single-precision floating point value per voxel. # Other grid types include BoolGrid and Vec3SGrid. The module-level # attribute pyopenvdb.GridTypes gives the complete list. cube = vdb.FloatGrid() cube.fill(min=(100, 100, 100), max=(199, 199, 199), value=1.0) # Name the grid "cube". cube.name = 'cube' # Populate another FloatGrid with a sparse, narrow-band level set # representation of a sphere with radius 50 voxels, located at # (1.5, 2, 3) in index space. sphere = vdb.createLevelSetSphere(radius=50, center=(1.5, 2, 3)) # Associate some metadata with the grid. sphere['radius'] = 50.0 # Associate a scaling transform with the grid that sets the voxel size # to 0.5 units in world space. sphere.transform = vdb.createLinearTransform(voxelSize=0.5) # Name the grid "sphere". sphere.name = 'sphere' # Write both grids to a VDB file. vdb.write('mygrids.vdb', grids=[cube, sphere]) diff --git a/misc/py-openvdb/files/patch-CMakeLists.txt b/misc/py-openvdb/files/patch-CMakeLists.txt index 89826f5b5501..1ad94f363c20 100644 --- a/misc/py-openvdb/files/patch-CMakeLists.txt +++ b/misc/py-openvdb/files/patch-CMakeLists.txt @@ -1,12 +1,19 @@ ---- CMakeLists.txt.orig 2022-10-27 23:35:20 UTC +--- CMakeLists.txt.orig 2025-04-03 05:22:14 UTC +++ CMakeLists.txt -@@ -12,6 +12,9 @@ project(OpenVDBPython LANGUAGES CXX) +@@ -12,6 +12,16 @@ include(GNUInstallDirs) include(GNUInstallDirs) +set(CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake/OpenVDB" ${CMAKE_MODULE_PATH}) +find_package(OpenVDB REQUIRED) ++find_package(Python ${FREEBSD_PYTHON_VER} EXACT REQUIRED COMPONENTS Development Interpreter) ++find_package(nanobind REQUIRED) ++set(Python_PACKAGES_DIR "site-packages") ++set(VDB_PYTHON_INSTALL_DIRECTORY ++ ${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/${Python_PACKAGES_DIR} ++ CACHE STRING "The directory to install the openvdb and nanovdb Python modules." ++) + ###### OpenVDB Python Options option(USE_NUMPY "Build the python library with numpy support." OFF)