<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/378dec6b0496fa94f506e4a65afa84557d0eb977">https://github.com/macports/macports-ports/commit/378dec6b0496fa94f506e4a65afa84557d0eb977</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 378dec6b0496fa94f506e4a65afa84557d0eb977
</span>Author: reneeotten <reneeotten@users.noreply.github.com>
AuthorDate: Thu Oct 4 11:22:17 2018 -0400
<span style='display:block; white-space:pre;color:#404040;'> py-matplotlib: add patch for gtk3cairo backend
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The check in setupext.py fails with the error below:
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> objc[17105]: +[__NSCFConstantString initialize] may have been in
</span><span style='display:block; white-space:pre;color:#404040;'> progress in another thread when fork() was called.
</span><span style='display:block; white-space:pre;color:#404040;'> objc[17105]: +[__NSCFConstantString initialize] may have been in
</span><span style='display:block; white-space:pre;color:#404040;'> progress in another thread when fork() was called. We cannot
</span><span style='display:block; white-space:pre;color:#404040;'> safely call it or ignore it in the fork() child process.
</span><span style='display:block; white-space:pre;color:#404040;'> Crashing instead. Set a breakpoint on objc_initializeAfterForkError
</span><span style='display:block; white-space:pre;color:#404040;'> to debug.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> However, it works just fine when executing manually in Python shell and
</span><span style='display:block; white-space:pre;color:#404040;'> by-passing (since we made sure the correct dependencies got installed)
</span><span style='display:block; white-space:pre;color:#404040;'> gives a working backend.
</span>---
python/py-matplotlib/Portfile | 3 +-
.../files/patch-setupext-gtk3cairo.py.diff | 68 ++++++++++++++++++++++
2 files changed, 70 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-matplotlib/Portfile b/python/py-matplotlib/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index e2293f1..a836758 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-matplotlib/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-matplotlib/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -58,7 +58,8 @@ if {${name} ne ${subport}} {
</span> patchfiles-append patch-setup.cfg.diff \
patch-src-macosx.m.diff \
patch-qhull.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-setupext.py.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-setupext.py.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-setupext-gtk3cairo.py.diff
</span>
build.env PKG_CONFIG_PATH="${python.prefix}/lib/pkgconfig"
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-matplotlib/files/patch-setupext-gtk3cairo.py.diff b/python/py-matplotlib/files/patch-setupext-gtk3cairo.py.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..fa1d689
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-matplotlib/files/patch-setupext-gtk3cairo.py.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,68 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- setupext.py.orig 2018-10-04 11:17:33.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ setupext.py 2018-10-04 11:20:29.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1676,35 +1676,36 @@
</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;'>+ def backend_gtk3cairo_internal_check(x):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- import cairocffi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- import cairo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (False, "Requires cairocffi or pycairo to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- import gi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (False, "Requires pygobject to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- gi.require_version("Gtk", "3.0")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ValueError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (False, "Requires gtk3 development files to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except AttributeError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (False, "pygobject version too old.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- from gi.repository import Gtk, Gdk, GObject
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except (RuntimeError, ImportError):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (False, "Requires pygobject to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return (True, "version %s.%s.%s" % (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Gtk.get_major_version(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Gtk.get_micro_version(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Gtk.get_minor_version()))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return (True, "Gtk and cairo installed by MacPorts")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## import cairocffi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## import cairo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (False, "Requires cairocffi or pycairo to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## import gi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (False, "Requires pygobject to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## gi.require_version("Gtk", "3.0")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except ValueError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (False, "Requires gtk3 development files to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except AttributeError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (False, "pygobject version too old.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## from gi.repository import Gtk, Gdk, GObject
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## except (RuntimeError, ImportError):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (False, "Requires pygobject to be installed.")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## return (True, "version %s.%s.%s" % (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## Gtk.get_major_version(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## Gtk.get_micro_version(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++## Gtk.get_minor_version()))
</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;'>+ class BackendGtk3Cairo(OptionalBackendPackage):
</span></pre><pre style='margin:0'>
</pre>