Ticket #48849: patch-MyPaint-devel-i18n.diff

File patch-MyPaint-devel-i18n.diff, 2.6 KB (added by su-v, 9 years ago)
  • Portfile

    diff -urN /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/graphics/MyPaint/Portfile ./Portfile
    old new  
    128128}
    129129
    130130subport ${name}-devel {
     131
     132    revision                1
     133
    131134    PortGroup               github 1.0
    132135    github.setup            mypaint mypaint 33d16432b0d32ed072b3dc3c284ad3c79bc7caa3
    133136    version                 1.2.0-beta.20150915+git.[string range ${git.branch} 0 7]
     
    149152                            port:py27-cairo \
    150153                            port:py27-gobject3
    151154
     155    patchfiles-append       patch-check-for-AppKit-module-for-NSLocale.diff
     156
    152157    post-extract {
    153158        delete ${workpath}/mypaint-${git.branch}/brushlib
    154159        move {*}[glob ${workpath}/mypaint-libmypaint-*] ${workpath}/mypaint-${git.branch}/brushlib
     
    163168    post-activate {
    164169        system "${prefix}/bin/gtk-update-icon-cache-3.0 -tf ${prefix}/share/icons/hicolor"
    165170    }
     171
     172    variant nslocale description {Use AppKit NSLocale for i18n support} {
     173        depends_lib-append      py27-pyobjc-cocoa
     174    }
    166175}
  • files/patch-check-for-AppKit-module-for-NSLocale.diff

    diff -urN /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/graphics/MyPaint/files/patch-check-for-AppKit-module-for-NSLocale.diff ./files/patch-check-for-AppKit-module-for-NSLocale.diff
    old new  
     1--- lib/i18n.py.orig    2015-09-19 20:24:49.000000000 +0200
     2+++ lib/i18n.py 2015-09-19 20:25:09.000000000 +0200
     3@@ -100,7 +100,14 @@
     4         logger.info("Windows: LANG=%r", os.environ.get("LANG"))
     5         logger.info("Windows: LANGUAGE=%r", os.environ.get("LANGUAGE"))
     6     elif sys.platform == "darwin":
     7-        from AppKit import NSLocale
     8+        try:
     9+            from AppKit import NSLocale
     10+        except ImportError:
     11+            logger.info("OSX: LANGUAGE detection via NSLocale failed:")
     12+            logger.info("OSX: Falling back to POSIX.")
     13+            logger.info("POSIX: LANG=%r", os.environ.get("LANG"))
     14+            logger.info("POSIX: LANGUAGE=%r", os.environ.get("LANGUAGE"))
     15+            return
     16         locale_id = NSLocale.currentLocale().localeIdentifier()
     17         lang = osx_locale_id_to_lang(locale_id)
     18         os.environ.setdefault('LANG', lang)