[arch-commits] Commit in openvdb/trunk (2 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Wed Mar 28 22:53:34 UTC 2018


    Date: Wednesday, March 28, 2018 @ 22:53:26
  Author: svenstaro
Revision: 313192

upgpkg: openvdb 5.0.0-1

Modified:
  openvdb/trunk/PKGBUILD
Deleted:
  openvdb/trunk/22d09714f9a6a29c62668b533495ed2afd4251ef.patch

------------------------------------------------+
 22d09714f9a6a29c62668b533495ed2afd4251ef.patch |  148 -----------------------
 PKGBUILD                                       |   21 +--
 2 files changed, 10 insertions(+), 159 deletions(-)

Deleted: 22d09714f9a6a29c62668b533495ed2afd4251ef.patch
===================================================================
--- 22d09714f9a6a29c62668b533495ed2afd4251ef.patch	2018-03-28 22:52:55 UTC (rev 313191)
+++ 22d09714f9a6a29c62668b533495ed2afd4251ef.patch	2018-03-28 22:53:26 UTC (rev 313192)
@@ -1,148 +0,0 @@
-From 22d09714f9a6a29c62668b533495ed2afd4251ef Mon Sep 17 00:00:00 2001
-From: Jonathan Scruggs <j.scruggs at gmail.com>
-Date: Wed, 20 Sep 2017 10:18:19 +0100
-Subject: [PATCH] Attempt to fix boost 1.65 ndarray
-
----
- openvdb/python/pyFloatGrid.cc |  8 +++++---
- openvdb/python/pyGrid.h       | 31 ++++++++++++++++++++-----------
- 2 files changed, 25 insertions(+), 14 deletions(-)
-
-diff --git a/openvdb/python/pyFloatGrid.cc b/openvdb/python/pyFloatGrid.cc
-index e5686b20..7eb9eda2 100644
---- a/openvdb/python/pyFloatGrid.cc
-+++ b/openvdb/python/pyFloatGrid.cc
-@@ -45,9 +45,11 @@ exportFloatGrid()
-     // Add a module-level list that gives the types of all supported Grid classes.
-     py::scope().attr("GridTypes") = py::list();
- 
--    // Specify that py::numeric::array should refer to the Python type numpy.ndarray
--    // (rather than the older Numeric.array).
--    py::numeric::array::set_module_and_type("numpy", "ndarray");
-+    #if BOOST_VERSION < 106500
-+        // Specify that py::numeric::array should refer to the Python type numpy.ndarray
-+        // (rather than the older Numeric.array).
-+        py::numeric::array::set_module_and_type("numpy", "ndarray");
-+    #endif
- 
-     pyGrid::exportGrid<FloatGrid>();
- #ifdef PY_OPENVDB_WRAP_ALL_GRID_TYPES
-diff --git a/openvdb/python/pyGrid.h b/openvdb/python/pyGrid.h
-index f1a01d92..0ae36db7 100644
---- a/openvdb/python/pyGrid.h
-+++ b/openvdb/python/pyGrid.h
-@@ -81,6 +81,15 @@ using namespace openvdb::OPENVDB_VERSION_NAME;
- #pragma clang diagnostic pop
- #endif
- 
-+#if BOOST_VERSION < 106500
-+    typedef typename py::numeric::array pyndarray;
-+    namespace arrayFunc = boost::python::numeric;
-+#else
-+    #include <boost/python/numpy.hpp>
-+    typedef typename py::numpy::ndarray pyndarray;
-+    namespace arrayFunc = boost::python::numpy;
-+#endif
-+
- 
- namespace pyopenvdb {
- 
-@@ -820,7 +829,7 @@ class CopyOpBase
- 
-         // Extract a reference to (not a copy of) the NumPy array,
-         // or throw an exception if arrObj is not a NumPy array object.
--        const py::numeric::array arrayObj = pyutil::extractArg<py::numeric::array>(
-+        const pyndarray arrayObj = pyutil::extractArg<pyndarray>(
-             arrObj, opName[toGrid], pyutil::GridTraits<GridType>::name(),
-             /*argIdx=*/1, "numpy.ndarray");
- 
-@@ -1113,7 +1122,7 @@ struct CopyVecOp<T, T> {
- // and sizes from NumPy arrays to STL vectors
- template<typename VecT>
- inline void
--copyVecArray(py::numeric::array& arrayObj, std::vector<VecT>& vec)
-+copyVecArray(pyndarray& arrayObj, std::vector<VecT>& vec)
- {
-     typedef typename VecT::ValueType ValueT;
- 
-@@ -1156,7 +1165,7 @@ meshToLevelSet(py::object pointsObj, py::object trianglesObj, py::object quadsOb
- 
-         // Raise a Python exception if the given NumPy array does not have dimensions M x N
-         // or does not have an integer or floating-point data type.
--        static void validate2DNumPyArray(py::numeric::array arrayObj,
-+        static void validate2DNumPyArray(pyndarray arrayObj,
-             const int N, const char* desiredType)
-         {
-             PyArrayObject* arrayObjPtr = reinterpret_cast<PyArrayObject*>(arrayObj.ptr());
-@@ -1222,7 +1231,7 @@ meshToLevelSet(py::object pointsObj, py::object trianglesObj, py::object quadsOb
-     if (!pointsObj.is_none()) {
-         // Extract a reference to (not a copy of) a NumPy array argument,
-         // or throw an exception if the argument is not a NumPy array object.
--        py::numeric::array arrayObj = extractValueArg<GridType, py::numeric::array>(
-+        pyndarray arrayObj = extractValueArg<GridType, pyndarray>(
-             pointsObj, Local::methodName(), /*argIdx=*/1, "numpy.ndarray");
- 
-         // Throw an exception if the array has the wrong type or dimensions.
-@@ -1235,7 +1244,7 @@ meshToLevelSet(py::object pointsObj, py::object trianglesObj, py::object quadsOb
-     // Extract the list of triangle indices from the arguments to this method.
-     std::vector<Vec3I> triangles;
-     if (!trianglesObj.is_none()) {
--        py::numeric::array arrayObj = extractValueArg<GridType, py::numeric::array>(
-+        ndarrays arrayObj = extractValueArg<GridType, pyndarray>(
-             trianglesObj, Local::methodName(), /*argIdx=*/2, "numpy.ndarray");
-         Local::validate2DNumPyArray(arrayObj, /*N=*/3, /*desiredType=*/"int");
-         copyVecArray(arrayObj, triangles);
-@@ -1244,7 +1253,7 @@ meshToLevelSet(py::object pointsObj, py::object trianglesObj, py::object quadsOb
-     // Extract the list of quad indices from the arguments to this method.
-     std::vector<Vec4I> quads;
-     if (!quadsObj.is_none()) {
--        py::numeric::array arrayObj = extractValueArg<GridType, py::numeric::array>(
-+        pyndarray arrayObj = extractValueArg<GridType, pyndarray>(
-             quadsObj, Local::methodName(), /*argIdx=*/3, "numpy.ndarray");
-         Local::validate2DNumPyArray(arrayObj, /*N=*/4, /*desiredType=*/"int");
-         copyVecArray(arrayObj, quads);
-@@ -1268,7 +1277,7 @@ volumeToQuadMesh(const GridType& grid, py::object isovalueObj)
-     tools::volumeToMesh(grid, points, quads, isovalue);
- 
-     // Copy vertices into an N x 3 NumPy array.
--    py::object pointArrayObj = py::numeric::array(py::list(), "float32");
-+    py::object pointArrayObj = arrayFunc::array(py::list(), "float32");
-     if (!points.empty()) {
-         npy_intp dims[2] = { npy_intp(points.size()), 3 };
-         // Construct a NumPy array that wraps the point vector.
-@@ -1282,7 +1291,7 @@ volumeToQuadMesh(const GridType& grid, py::object isovalueObj)
-     }
- 
-     // Copy face indices into an N x 4 NumPy array.
--    py::object quadArrayObj = py::numeric::array(py::list(), "uint32");
-+    py::object quadArrayObj = arrayFunc::array(py::list(), "uint32");
-     if (!quads.empty()) {
-         npy_intp dims[2] = { npy_intp(quads.size()), 4 };
-         if (PyArrayObject* arrayObj = reinterpret_cast<PyArrayObject*>(
-@@ -1312,7 +1321,7 @@ volumeToMesh(const GridType& grid, py::object isovalueObj, py::object adaptivity
-     tools::volumeToMesh(grid, points, triangles, quads, isovalue, adaptivity);
- 
-     // Copy vertices into an N x 3 NumPy array.
--    py::object pointArrayObj = py::numeric::array(py::list(), "float32");
-+    py::object pointArrayObj = arrayFunc::array(py::list(), "float32");
-     if (!points.empty()) {
-         npy_intp dims[2] = { npy_intp(points.size()), 3 };
-         // Construct a NumPy array that wraps the point vector.
-@@ -1326,7 +1335,7 @@ volumeToMesh(const GridType& grid, py::object isovalueObj, py::object adaptivity
-     }
- 
-     // Copy triangular face indices into an N x 3 NumPy array.
--    py::object triangleArrayObj = py::numeric::array(py::list(), "uint32");
-+    py::object triangleArrayObj = arrayFunc::array(py::list(), "uint32");
-     if (!triangles.empty()) {
-         npy_intp dims[2] = { npy_intp(triangles.size()), 3 };
-         if (PyArrayObject* arrayObj = reinterpret_cast<PyArrayObject*>(
-@@ -1337,7 +1346,7 @@ volumeToMesh(const GridType& grid, py::object isovalueObj, py::object adaptivity
-     }
- 
-     // Copy quadrilateral face indices into an N x 4 NumPy array.
--    py::object quadArrayObj = py::numeric::array(py::list(), "uint32");
-+    py::object quadArrayObj = arrayFunc::array(py::list(), "uint32");
-     if (!quads.empty()) {
-         npy_intp dims[2] = { npy_intp(quads.size()), 4 };
-         if (PyArrayObject* arrayObj = reinterpret_cast<PyArrayObject*>(

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-03-28 22:52:55 UTC (rev 313191)
+++ PKGBUILD	2018-03-28 22:53:26 UTC (rev 313192)
@@ -2,27 +2,23 @@
 # Maintainer : Sven-Hendrik Haase <sh at lutzhaase.com>
 
 pkgname=openvdb
-pkgver=4.0.2
-pkgrel=6
+pkgver=5.0.0
+pkgrel=1
 pkgdesc='A large suite of tools for the efficient storage and manipulation of sparse volumetric data discretized on three-dimensional grids'
 url='https://github.com/dreamworksanimation/openvdb'
 arch=('x86_64')
 license=('MPL')
 depends=('openexr' 'boost-libs' 'intel-tbb' 'zlib' 'jemalloc' 'blosc')
-makedepends=('doxygen' 'boost' 'cmake' 'mesa' 'cppunit' 'glfw-x11' 'glu' 'python')
+makedepends=('doxygen' 'boost' 'cmake' 'mesa' 'cppunit' 'glfw-x11' 'glu' 'python-numpy')
 optdepends=('glfw: for tools'
             'glu: for tools'
-            'python: python module')
-source=("https://github.com/dreamworksanimation/openvdb/archive/v${pkgver}.tar.gz"
-        22d09714f9a6a29c62668b533495ed2afd4251ef.patch)
-sha512sums=('8e3e12583b81f9b9303b309e839c8321c67b67ff8a0e61bb56c87276bf25c0deff22f5a73c7c5b661b8e5df345bfdabfa6b0aea9bf16fce57d9c53a76751c75d'
-            '702f42c33c6d6c9da7a85166823d6bc1e8789f328a2781639fea081f8944d29f785f2ea71419741a63f1177db94db8740dedeb7168fa7b5adb1a0a8cd387b342')
+            'python-numpy: python module')
+source=("https://github.com/dreamworksanimation/openvdb/archive/v${pkgver}.tar.gz")
+sha512sums=('8916d54683d81144114e57f8332be43b7547e6da5d194f6147bcefd4ee9e8e7ec817f27b65adb129dfd149e6b308f4bab30591ee953ee2c319636491bf051a2b')
 
 prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
 
-  patch -Np1 < "${srcdir}/22d09714f9a6a29c62668b533495ed2afd4251ef.patch"
-
   sed -i "s|DESTINATION docs|DESTINATION share/doc/$pkgname|" openvdb/CMakeLists.txt
 }
 
@@ -31,6 +27,8 @@
 
   [[ -d build ]] && rm -rf build
   mkdir build && cd build
+
+  export CXXFLAGS="${CXXFLAGS} -DPY_OPENVDB_USE_NUMPY"
   cmake .. \
     -DBLOSC_LOCATION=/usr/ \
     -DTBB_LOCATION=/usr/ \
@@ -43,7 +41,8 @@
     -DCPPUNIT_LOCATION=/usr/include/cppunit \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DOPENVDB_BUILD_PYTHON_MODULE=ON \
-    -DOPENVDB_BUILD_DOCS=ON
+    -DOPENVDB_BUILD_DOCS=ON \
+    -DOPENVDB_ENABLE_3_ABI_COMPATIBLE=ON
 
   make
 }



More information about the arch-commits mailing list