<pre style='margin:0'>
Marcus Calhoun-Lopez (MarcusCalhoun-Lopez) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/0e3e10222b1d7b1e0bcc98bceb18577b95dee213">https://github.com/macports/macports-ports/commit/0e3e10222b1d7b1e0bcc98bceb18577b95dee213</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 0e3e10222b1d7b1e0bcc98bceb18577b95dee213
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Tue Dec 17 01:09:44 2019 -0700

<span style='display:block; white-space:pre;color:#404040;'>    openvdb: refactor Python variant code
</span>---
 graphics/openvdb/Portfile | 66 +++++++++++++++++++----------------------------
 1 file changed, 27 insertions(+), 39 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/graphics/openvdb/Portfile b/graphics/openvdb/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index b0e6c88..e8de0d3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/graphics/openvdb/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/graphics/openvdb/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -58,56 +58,44 @@ configure.args-append   -DUSE_CCACHE=OFF \
</span> # do not "Build the OpenVDB unit tests" (avoid dependency on cppunit)
 configure.args-append   -DOPENVDB_BUILD_UNITTESTS=OFF
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python27 description {Build the Python 2.7 bindings} conflicts python36 python37 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    depends_lib-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:python27 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:py27-numpy \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:boost-numpy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# turn off Python support unless requested by a variant
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append   -DOPENVDB_BUILD_PYTHON_MODULE=OFF
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    configure.args-append  -DUSE_NUMPY=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set pythons_suffixes    {27 36 37}
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-patch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace s|__MACPORTS_PYTHON_VERSION__|2.7|g ${worksrcpath}/openvdb/python/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost python27
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost-numpy python27
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set pythons_ports       {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach s ${pythons_suffixes} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    lappend pythons_ports python${s}
</span> }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python36 description {Build the Python 3.6 bindings} conflicts python27 python37 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    depends_lib-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:python36 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:py36-numpy \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach s ${pythons_suffixes} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set p python${s}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set v [string index ${s} 0].[string index ${s} 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set i [lsearch -exact ${pythons_ports} ${p}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    set c [lreplace ${pythons_ports} ${i} ${i}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    variant ${p} description "Build the Python ${v} bindings" conflicts {*}${c} "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        depends_lib-append      port:${p} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                port:py${s}-numpy \
</span>         port:boost-numpy
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    configure.args-append  -DUSE_NUMPY=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        configure.args-replace  -DOPENVDB_BUILD_PYTHON_MODULE=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                -DUSE_NUMPY=ON
</span> 
     post-patch {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace s|__MACPORTS_PYTHON_VERSION__|3.6|g ${worksrcpath}/openvdb/python/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            reinplace s|__MACPORTS_PYTHON_VERSION__|${v}|g ${worksrcpath}/openvdb/python/CMakeLists.txt
</span>     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost python36
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost-numpy python36
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python37 description {Build the Python 3.7 bindings} conflicts python27 python36 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    depends_lib-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:python37 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:py37-numpy \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port:boost-numpy
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    configure.args-append  -DUSE_NUMPY=ON
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-patch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace s|__MACPORTS_PYTHON_VERSION__|3.7|g ${worksrcpath}/openvdb/python/CMakeLists.txt
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost python37
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    require_active_variants boost-numpy python37
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        require_active_variants boost       ${p}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        require_active_variants boost-numpy ${p}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    "
</span> }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {![variant_isset python36] && ![variant_isset python37]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    default_variants    +python27
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set set_python_default  yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach s ${pythons_suffixes} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {[variant_isset python${s}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set set_python_default  no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    }
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if {![variant_isset python27] && ![variant_isset python36] && ![variant_isset python37]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    configure.args-append -DOPENVDB_BUILD_PYTHON_MODULE=OFF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    patchfiles-delete     patch-python_verison.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${set_python_default}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    default_variants        +python27
</span> }
</pre><pre style='margin:0'>

</pre>