[73557] trunk/dports/python

macsforever2000 at macports.org macsforever2000 at macports.org
Wed Nov 17 15:45:17 PST 2010


Revision: 73557
          http://trac.macports.org/changeset/73557
Author:   macsforever2000 at macports.org
Date:     2010-11-17 15:45:12 -0800 (Wed, 17 Nov 2010)
Log Message:
-----------
py26-enable. Added new port (#27266)

Added Paths:
-----------
    trunk/dports/python/py26-enable/
    trunk/dports/python/py26-enable/Portfile
    trunk/dports/python/py26-enable/Portfile.2
    trunk/dports/python/py26-enable/files/
    trunk/dports/python/py26-enable/files/patch-enthought-enable-wx_backend-api.py.diff
    trunk/dports/python/py26-enable/files/patch-enthought-kiva-agg-setup.py.diff
    trunk/dports/python/py26-enable/files/patch-enthought-kiva-backend_wx.py.diff
    trunk/dports/python/py26-enable/files/patch-enthought-kiva-setup.py.diff

Added: trunk/dports/python/py26-enable/Portfile
===================================================================
--- trunk/dports/python/py26-enable/Portfile	                        (rev 0)
+++ trunk/dports/python/py26-enable/Portfile	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,41 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem	        1.0
+PortGroup	        python26 1.0
+
+name                py26-enable
+version             3.3.2
+categories-append   devel
+maintainers         nomaintainer 
+
+description         The Enthought enable package
+long_description    An object drawing library that supports containment and event notification. Currently uses the wx backend. 
+
+platforms           darwin
+homepage            http://code.enthought.com/projects/enable/
+master_sites        http://www.enthought.com/repo/ETS/
+distname            Enable-${version}
+
+checksums           md5     54e93cf67a8baa2cd36dd1741adbcf11 \
+                    sha1    c3829db0041f1f60e3b4e9cbad37e2a29a17974d \
+                    rmd160  a0c1eaa84f3b97342f197a2e46fbe5fa9548a9ef
+
+patchfiles-append patch-enthought-kiva-setup.py.diff \
+                  patch-enthought-kiva-backend_wx.py.diff \
+                  patch-enthought-enable-wx_backend-api.py.diff \
+                  patch-enthought-kiva-agg-setup.py.diff
+
+depends_build-append \
+    port:py26-distribute \
+    port:swig-python \
+    port:py26-cython
+
+depends_lib-append \
+    port:py26-scipy \
+    port:py26-enthoughtbase \
+    port:py26-wxpython \
+    port:py26-traitsgui
+
+universal_variant no
+


Property changes on: trunk/dports/python/py26-enable/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/python/py26-enable/Portfile.2
===================================================================
--- trunk/dports/python/py26-enable/Portfile.2	                        (rev 0)
+++ trunk/dports/python/py26-enable/Portfile.2	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,48 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id: $
+
+PortSystem	1.0
+PortGroup	python26 1.0
+
+name                py26-enable
+version             3.3.2
+categories-append   devel
+maintainers         nomaintainer 
+
+description         The Enthought enable package
+long_description    Enable is a 2D canvas library.
+
+platforms           darwin
+homepage            http://code.enthought.com/projects/enable/
+master_sites        http://www.enthought.com/repo/ETS/
+distname            Enable-${version}
+
+checksums           md5     54e93cf67a8baa2cd36dd1741adbcf11 \
+                    sha1    c3829db0041f1f60e3b4e9cbad37e2a29a17974d \
+                    rmd160  a0c1eaa84f3b97342f197a2e46fbe5fa9548a9ef
+
+depends_build-append \
+    port:py26-distribute \
+    port:swig-python \
+    port:py26-cython
+
+depends_lib-append port: \
+    py26-scipy \
+    port:py26-enthoughtbase \
+    port:py26-wxpython \
+    port:py26-traitsgui
+
+universal_variant no
+
+variant gtk conflicts carbon description { Enable GTK backend } {
+    patchfiles-append patch-enthought-kiva-setup.py.diff \
+                      patch-enthought-kiva-backend_wx.py.diff \
+                      patch-enthought-enable-wx_backend-api.py.diff \
+                      patch-enthought-kiva-agg-setup.py.diff
+}
+
+variant carbon conflicts gtk description { Enable carbon backend } {
+}
+
+default_variants +gtk
+

Added: trunk/dports/python/py26-enable/files/patch-enthought-enable-wx_backend-api.py.diff
===================================================================
--- trunk/dports/python/py26-enable/files/patch-enthought-enable-wx_backend-api.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-enable/files/patch-enthought-enable-wx_backend-api.py.diff	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,14 @@
+--- enthought/enable/wx_backend/api.py.orig	2010-11-10 14:25:42.000000000 +0100
++++ enthought/enable/wx_backend/api.py	2010-11-10 14:17:49.000000000 +0100
+@@ -3,10 +3,7 @@
+ 
+ from enthought.kiva import backend
+ 
+-if sys.platform == 'darwin' and backend() != "gl":
+-    from mac_window import MacWindow as Window
+-else:
+-    from window import Window
++from window import Window
+ 
+ from scrollbar import NativeScrollBar
+ 

Added: trunk/dports/python/py26-enable/files/patch-enthought-kiva-agg-setup.py.diff
===================================================================
--- trunk/dports/python/py26-enable/files/patch-enthought-kiva-agg-setup.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-enable/files/patch-enthought-kiva-agg-setup.py.diff	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,12 @@
+--- enthought/kiva/agg/setup.py.orig	2010-11-10 15:04:57.000000000 +0100
++++ enthought/kiva/agg/setup.py	2010-11-10 15:02:29.000000000 +0100
+@@ -79,7 +79,8 @@
+     if sys.platform=='win32':
+         plat = 'win32'
+     elif sys.platform == 'darwin':
+-        plat = 'gl'
++        #plat = 'gl'
++        plat = 'x11'
+     else:
+         #plat = 'gtk1'  # use with gtk1, it's fast
+         plat = 'x11'  # use with gtk2, it's slow but reliable

Added: trunk/dports/python/py26-enable/files/patch-enthought-kiva-backend_wx.py.diff
===================================================================
--- trunk/dports/python/py26-enable/files/patch-enthought-kiva-backend_wx.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-enable/files/patch-enthought-kiva-backend_wx.py.diff	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,184 @@
+--- enthought/kiva/backend_wx.py.orig	2010-11-10 09:15:18.000000000 +0100
++++ enthought/kiva/backend_wx.py	2010-11-10 10:48:24.000000000 +0100
+@@ -141,156 +141,35 @@
+         return
+         
+ 
+-
+-# Define a different base class depending on the platform.
+-
+-if sys.platform == 'darwin':
+-    from mac import get_macport, ABCGI
+-    from mac.ABCGI import CGBitmapContext, CGImage, CGImageFile, \
+-        CGLayerContext, CGMutablePath
+-
+-    # The Mac backend only supports numpy.
+-    import numpy as np
+-
+-    if wx.VERSION[:2] == (2, 6):
+-        def gc_for_dc(dc):
+-            """ Return the CGContext corresponding to the given wx.DC.
+-            """
+-            port = get_macport(dc)
+-            return ABCGI.CGContextForPort(port)
+-
+-    elif wx.VERSION[:2] == (2, 8):
+-        class UnflippingCGContext(ABCGI.CGContextInABox):
+-            """ Vertically flip the context to undo wx's flipping.
+-            """
+-
+-            def __init__(self, *args, **kwds):
+-                ABCGI.CGContextInABox.__init__(self, *args, **kwds)
+-                self._begun = False
+-
+-            def begin(self):
+-                if self._begun:
+-                    return
+-                self.save_state()
+-                self.translate_ctm(0, self.height())
+-                self.scale_ctm(1.0, -1.0)
+-                self._begun = True
+-
+-            def end(self):
+-                if self._begun:
+-                    self.restore_state()
+-                    self._begun = False
+-
+-        def gc_for_dc(dc):
+-            """ Return the CGContext corresponding to the given wx.DC.
+-            """
+-            pointer = get_macport(dc)
+-            gc = UnflippingCGContext(pointer, dc.GetSizeTuple())
+-            return gc
+-
+-
+-    CompiledPath = CGMutablePath
+-    Image = CGImageFile
+-
+-    class GraphicsContext(CGLayerContext):
+-        def __init__(self, size_or_array, window_gc=None, *args, **kwds):
+-            gc = window_gc 
+-            if not gc:
+-                # Create a tiny base context to spawn the CGLayerContext from.
+-                # We are better off making our Layer from the window gc since
+-                # the data formats will match and so it will be faster to draw the
+-                # layer.
+-                gc = CGBitmapContext((1,1))
+-            if isinstance(size_or_array, np.ndarray):
+-                # Initialize the layer with an image.
+-                image = CGImage(size_or_array)
+-                width = image.width
+-                height = image.height
+-            else:
+-                # No initialization.
+-                image = None
+-                width, height = size_or_array
+-            CGLayerContext.__init__(self, gc,
+-                (width, height))
+-            if image is not None:
+-                self.draw_image(image)
+-
+-        @classmethod
+-        def create_from_gc(klass, gc, size_or_array, *args, **kwds):
+-            return klass(size_or_array, gc, *args, **kwds)
+-
+-    class Canvas(BaseWxCanvas, WidgetClass):
+-        """ Mac wx Kiva canvas.
+-        """
+-        def __init__(self, parent, id = 01, size = wx.DefaultSize):
+-            # need to init self.memDC before calling BaseWxCanvas.__init__ 
+-            self.memDC = wx.MemoryDC()
+-            self._size = (size.GetWidth(), size.GetHeight())
+-            WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
+-                                 wx.SUNKEN_BORDER | wx.WANTS_CHARS | \
+-                                 wx.FULL_REPAINT_ON_RESIZE )
+-            BaseWxCanvas.__init__(self)
+-            return
+-        
+-        def _create_kiva_gc(self, size):
+-            self._size = size
+-            self.bitmap = wx.EmptyBitmap(size[0], size[1])
+-            self.memDC.SelectObject(self.bitmap)
+-            gc = gc_for_dc(self.memDC)
+-            #gc.begin()
+-            #print " **** gc is:", gc
+-            return gc
+-        
+-        def blit(self, event):
+-            t1 = now()
+-            paintdc = wx.PaintDC(self)
+-            paintdc.Blit(0, 0, self._size[0], self._size[1],
+-                         self.memDC, 0, 0)
+-            t2 = now()
+-            self.blit_time = t2 - t1
+-            self.dirty = 0
+-            return
+-            
+-        def draw(self):
+-            t1 = now()
+-            self.gc.begin()
+-            self.do_draw(self.gc)
+-            self.gc.end()
+-            t2 = now()
+-            self.draw_time = t2-t1
+-            return
+-        
+-
+-else:
+-    # the GraphicsContextSystem stuff should eventually be moved out of the
+-    # image backend.
+-    from backend_image import GraphicsContextSystem as GraphicsContext
+-    from agg import CompiledPath
+-
+-    class Canvas(BaseWxCanvas, WidgetClass):
+-        "The basic wx Kiva canvas."
+-        def __init__(self, parent, id = -1, size = wx.DefaultSize):
+-            WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
+-                                 wx.SUNKEN_BORDER | wx.WANTS_CHARS | \
+-                                 wx.FULL_REPAINT_ON_RESIZE )
+-            BaseWxCanvas.__init__(self)
+-            return
++# the GraphicsContextSystem stuff should eventually be moved out of the
++# image backend.
++from backend_image import GraphicsContextSystem as GraphicsContext
++from agg import CompiledPath
++
++class Canvas(BaseWxCanvas, WidgetClass):
++    "The basic wx Kiva canvas."
++    def __init__(self, parent, id = -1, size = wx.DefaultSize):
++        WidgetClass.__init__(self, parent, id, wx.Point(0, 0), size, 
++                             wx.SUNKEN_BORDER | wx.WANTS_CHARS |
++                             wx.FULL_REPAINT_ON_RESIZE )
++        BaseWxCanvas.__init__(self)
++        return
+     
+-        def _create_kiva_gc(self, size):
+-            return GraphicsContext(size)
++    def _create_kiva_gc(self, size):
++        return GraphicsContext(size)
+     
+-        def blit(self, event):
+-            t1 = now()
++    def blit(self, event):
++        t1 = now()
+     
+-            if self._dc is None:
+-                self._dc = wx.PaintDC(self)
+-            self.gc.pixel_map.draw_to_wxwindow(self, 0, 0)
+-            self._dc = None
++        if self._dc is None:
++            self._dc = wx.PaintDC(self)
++        self.gc.pixel_map.draw_to_wxwindow(self, 0, 0)
++        self._dc = None
+     
+-            t2 = now()
+-            self.blit_time = t2-t1
+-            self.dirty = 0
+-            return
++        t2 = now()
++        self.blit_time = t2-t1
++        self.dirty = 0
++        return
+ 
+ def font_metrics_provider():
+     gc = GraphicsContext((1, 1))

Added: trunk/dports/python/py26-enable/files/patch-enthought-kiva-setup.py.diff
===================================================================
--- trunk/dports/python/py26-enable/files/patch-enthought-kiva-setup.py.diff	                        (rev 0)
+++ trunk/dports/python/py26-enable/files/patch-enthought-kiva-setup.py.diff	2010-11-17 23:45:12 UTC (rev 73557)
@@ -0,0 +1,12 @@
+--- enthought/kiva/setup.py.orig	2010-11-10 09:14:54.000000000 +0100
++++ enthought/kiva/setup.py	2010-11-10 09:11:47.000000000 +0100
+@@ -34,9 +34,6 @@
+     config.add_subpackage('traits.ui')
+     config.add_subpackage('traits.ui.*')
+ 
+-    if sys.platform == 'darwin':
+-        config.add_subpackage('mac')
+-
+     config.get_version()
+ 
+     return config
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101117/61cfcb29/attachment-0001.html>


More information about the macports-changes mailing list