[154007] trunk/dports/graphics/MyPaint

ryandesign at macports.org ryandesign at macports.org
Tue Oct 18 03:19:20 CEST 2016


Revision: 154007
          https://trac.macports.org/changeset/154007
Author:   ryandesign at macports.org
Date:     2016-10-17 18:19:20 -0700 (Mon, 17 Oct 2016)
Log Message:
-----------
MyPaint: Fix incompatibility with glib 2.48+

Resolves #51234

Add missing dependency on pyobjc-cocoa

Resolves #48849

Modified Paths:
--------------
    trunk/dports/graphics/MyPaint/Portfile

Added Paths:
-----------
    trunk/dports/graphics/MyPaint/files/GLib.filename_to_utf8.patch

Modified: trunk/dports/graphics/MyPaint/Portfile
===================================================================
--- trunk/dports/graphics/MyPaint/Portfile	2016-10-17 22:24:33 UTC (rev 154006)
+++ trunk/dports/graphics/MyPaint/Portfile	2016-10-18 01:19:20 UTC (rev 154007)
@@ -10,6 +10,7 @@
 if {${name} eq ${subport}} {
     conflicts               ${name}-devel
     github.setup            mypaint mypaint 1.2.0 v
+    revision                1
 
     github.tarball_from     releases
     use_xz                  yes
@@ -22,6 +23,7 @@
     conflicts               ${name}
     github.setup            mypaint mypaint 6ba6c251207d6efa629b8a1d3a3d70dc688fac55
     version                 1.3.0-alpha.20160115+git.[string range ${git.branch} 0 7]
+    revision                1
     set libmypaint_branch   f6278c97aa5af443e30069099c6461b056cdfe63
 
     master_sites-append     https://github.com/${github.author}/libmypaint/tarball/${libmypaint_branch}:libmypaint
@@ -68,11 +70,13 @@
                             port:py27-cairo \
                             port:py27-gobject3 \
                             port:py27-numpy \
-                            port:py27-protobuf
+                            port:py27-protobuf \
+                            port:py27-pyobjc-cocoa
 
 depends_run-append          port:hicolor-icon-theme
 
 patchfiles                  library-and-include-order.patch
+patchfiles-append           GLib.filename_to_utf8.patch
 
 use_configure               no
 

Added: trunk/dports/graphics/MyPaint/files/GLib.filename_to_utf8.patch
===================================================================
--- trunk/dports/graphics/MyPaint/files/GLib.filename_to_utf8.patch	                        (rev 0)
+++ trunk/dports/graphics/MyPaint/files/GLib.filename_to_utf8.patch	2016-10-18 01:19:20 UTC (rev 154007)
@@ -0,0 +1,48 @@
+https://github.com/mypaint/mypaint/issues/634
+https://github.com/mypaint/mypaint/commit/c03602f3d5456d59fccfc8ad7d41c8c6f1a6d593
+--- lib/glib.py.orig
++++ lib/glib.py
+@@ -1,5 +1,5 @@
+ # This file is part of MyPaint.
+-# Copyright (C) 2015 by Andrew Chadwick <a.t.chadwick at gmail.com>
++# Copyright (C) 2015-2016 by the MyPaint Development Team.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -19,11 +19,12 @@
+ ## Imports
+ 
+ import sys
+-from logging import getLogger
+-logger = getLogger(__name__)
++import logging
+ 
+ from gi.repository import GLib
+ 
++logger = logging.getLogger(__name__)
++
+ 
+ ## File path getter functions
+ 
+@@ -35,7 +36,6 @@ def filename_to_unicode(opsysstring):
+     :returns: the converted filename
+     :rtype: unicode
+ 
+-    >>> from gi.repository import GLib
+     >>> filename_to_unicode('/ascii/only/path')
+     u'/ascii/only/path'
+     >>> filename_to_unicode(None) is None
+@@ -54,7 +54,12 @@ def filename_to_unicode(opsysstring):
+     # Other systems are dependent in opaque ways on the environment.
+     if not isinstance(opsysstring, str):
+         raise TypeError("Argument must be bytes")
+-    ustring = GLib.filename_to_utf8(opsysstring, -1, 0, 0)
++    # This function's annotation seems to vary quite a bit.
++    # See https://github.com/mypaint/mypaint/issues/634
++    try:
++        ustring, _, _ = GLib.filename_to_utf8(opsysstring, -1)
++    except TypeError:
++        ustring = GLib.filename_to_utf8(opsysstring, -1, 0, 0)
+     if ustring is None:
+         raise UnicodeDecodeError(
+             "GLib failed to convert %r to a UTF-8 string. "
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161017/5b270fce/attachment-0002.html>


More information about the macports-changes mailing list