[arch-commits] Commit in openvdb/repos (3 files)

Antonio Rojas arojas at archlinux.org
Wed Feb 28 09:14:10 UTC 2018


    Date: Wednesday, February 28, 2018 @ 09:14:09
  Author: arojas
Revision: 299919

archrelease: copy trunk to community-staging-x86_64

Added:
  openvdb/repos/community-staging-x86_64/
  openvdb/repos/community-staging-x86_64/22d09714f9a6a29c62668b533495ed2afd4251ef.patch
    (from rev 299918, openvdb/trunk/22d09714f9a6a29c62668b533495ed2afd4251ef.patch)
  openvdb/repos/community-staging-x86_64/PKGBUILD
    (from rev 299918, openvdb/trunk/PKGBUILD)

------------------------------------------------+
 22d09714f9a6a29c62668b533495ed2afd4251ef.patch |  148 +++++++++++++++++++++++
 PKGBUILD                                       |   57 ++++++++
 2 files changed, 205 insertions(+)

Copied: openvdb/repos/community-staging-x86_64/22d09714f9a6a29c62668b533495ed2afd4251ef.patch (from rev 299918, openvdb/trunk/22d09714f9a6a29c62668b533495ed2afd4251ef.patch)
===================================================================
--- community-staging-x86_64/22d09714f9a6a29c62668b533495ed2afd4251ef.patch	                        (rev 0)
+++ community-staging-x86_64/22d09714f9a6a29c62668b533495ed2afd4251ef.patch	2018-02-28 09:14:09 UTC (rev 299919)
@@ -0,0 +1,148 @@
+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*>(

Copied: openvdb/repos/community-staging-x86_64/PKGBUILD (from rev 299918, openvdb/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2018-02-28 09:14:09 UTC (rev 299919)
@@ -0,0 +1,57 @@
+# $Id$
+# Maintainer : Sven-Hendrik Haase <sh at lutzhaase.com>
+
+pkgname=openvdb
+pkgver=4.0.2
+pkgrel=6
+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')
+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')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  patch -Np1 < "${srcdir}/22d09714f9a6a29c62668b533495ed2afd4251ef.patch"
+
+  sed -i "s|DESTINATION docs|DESTINATION share/doc/$pkgname|" openvdb/CMakeLists.txt
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  [[ -d build ]] && rm -rf build
+  mkdir build && cd build
+  cmake .. \
+    -DBLOSC_LOCATION=/usr/ \
+    -DTBB_LOCATION=/usr/ \
+    -DUSE_GLFW3=ON \
+    -DGLFW3_LOCATION=/usr/ \
+    -DILMBASE_NAMESPACE_VERSIONING=OFF \
+    -DOPENEXR_NAMESPACE_VERSIONING=OFF \
+    -DILMBASE_LOCATION=/usr/ \
+    -DOPENEXR_LOCATION=/usr/ \
+    -DCPPUNIT_LOCATION=/usr/include/cppunit \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DOPENVDB_BUILD_PYTHON_MODULE=ON \
+    -DOPENVDB_BUILD_DOCS=ON
+
+  make
+}
+
+package() {
+  cd "${srcdir}/${pkgname}-${pkgver}/build"
+
+  make DESTDIR="${pkgdir}" install
+}
+
+# vim:set sw=2 sts=2 et:



More information about the arch-commits mailing list