<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/29d7b5f02e676267b20ccae5ee5d54fb3095654f">https://github.com/macports/macports-ports/commit/29d7b5f02e676267b20ccae5ee5d54fb3095654f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 29d7b5f02e676267b20ccae5ee5d54fb3095654f
</span>Author: Marcus Calhoun-Lopez <mcalhoun@macports.org>
AuthorDate: Mon Oct 22 06:10:26 2018 -0700

<span style='display:block; white-space:pre;color:#404040;'>    vigra: add Python 3.7 variant
</span>---
 graphics/vigra/Portfile                | 25 +++++++++++++++++++------
 graphics/vigra/files/patch-python.diff | 30 ++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 6 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/graphics/vigra/Portfile b/graphics/vigra/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index f0539ed..4c2fddc 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/graphics/vigra/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/graphics/vigra/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -43,6 +43,9 @@ patchfiles-append   patch-uniq_ptr.diff
</span> # see https://trac.macports.org/ticket/54548
 patchfiles-append   patch-template.diff
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# see https://github.com/ukoethe/vigra/pull/451/commits/a6fa62663c6a6b752ed0707e95f643e25867a0f9
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append   patch-python.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> post-patch {
     reinplace "s|@DOCDIR@|${prefix}/share/doc/${name}|g" ${worksrcpath}/config/vigra-config.in
 }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -87,7 +90,7 @@ if {[variant_isset valgrind]} {
</span>     configure.args-append -DWITH_VALGRIND=NO
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python27 conflicts python34 python35 python36 description "Also build vigranumpy python27 bindings" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant python27 conflicts python34 python35 python36 python37 description "Also build vigranumpy python27 bindings" {
</span>     configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \
                             -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-2.7
     depends_lib-append  port:boost \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -97,7 +100,7 @@ variant python27 conflicts python34 python35 python36 description "Also build vi
</span>     require_active_variants boost python27
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python34 conflicts python27 python35 python36 description "Also build vigranumpy python34 bindings" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant python34 conflicts python27 python35 python36 python37 description "Also build vigranumpy python34 bindings" {
</span>     configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.4 \
                             -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-3.4
     depends_lib-append  port:boost \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -107,7 +110,7 @@ variant python34 conflicts python27 python35 python36 description "Also build vi
</span>     require_active_variants boost python34
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python35 conflicts python27 python34 python36 description "Also build vigranumpy python35 bindings" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant python35 conflicts python27 python34 python36 python37 description "Also build vigranumpy python35 bindings" {
</span>     configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.5 \
                             -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-3.5
     depends_lib-append  port:boost \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -117,7 +120,7 @@ variant python35 conflicts python27 python34 python36 description "Also build vi
</span>     require_active_variants boost python35
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant python36 conflicts python27 python34 python35 description "Also build vigranumpy python36 bindings" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant python36 conflicts python27 python34 python35 python37 description "Also build vigranumpy python36 bindings" {
</span>     configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.6 \
                             -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-3.6
     depends_lib-append  port:boost \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -127,11 +130,21 @@ variant python36 conflicts python27 python34 python35 description "Also build vi
</span>     require_active_variants boost python36
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant python37 conflicts python27 python34 python35 python36 description "Also build vigranumpy python37 bindings" {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python3.7 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-3.7
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    depends_lib-append  port:boost \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        port:python37 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        port:py37-numpy \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        port:py37-sphinx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    require_active_variants boost python37
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36] && ![variant_isset python37]} {
</span>     default_variants +python27
 }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {![variant_isset python27] && ![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {![variant_isset python27] && ![variant_isset python34] && ![variant_isset python35] && ![variant_isset python36] && ![variant_isset python37]} {
</span>     configure.args-append -DWITH_VIGRANUMPY=NO
 }
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/graphics/vigra/files/patch-python.diff b/graphics/vigra/files/patch-python.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..40f45fc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/graphics/vigra/files/patch-python.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,30 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From a6fa62663c6a6b752ed0707e95f643e25867a0f9 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: John Kirkham <kirkhamj@janelia.hhmi.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 19 Oct 2018 11:32:42 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Receive `const char *` from `PyUnicode_AsUTF8`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+In Python 3.7, `PyUnicode_AsUTF8` was changed to return a `const char *`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+instead of a `char *`. This broke VIGRA as we were accepting a `char *`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+in this case instead. Fortunately we do not need it to be mutable for
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+our use case. So just type the variable storing the result from
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+`PyUnicode_AsUTF8` as a `const char *`. Should still work on older
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Python 3 versions that return `char *` as well.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ref: https://bugs.python.org/issue28769
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ vigranumpy/src/core/vigranumpycore.cxx | 2 +-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 1 insertion(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ec38d3636..c81c6ae52 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- vigranumpy/src/core/vigranumpycore.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ vigranumpy/src/core/vigranumpycore.cxx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   return checksum(data, size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   Py_ssize_t size = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-  char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++  const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+   return checksum(data, size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>

</pre>