[83061] trunk/dports/x11

jmr at macports.org jmr at macports.org
Wed Aug 24 18:18:01 PDT 2011


Revision: 83061
          http://trac.macports.org/changeset/83061
Author:   jmr at macports.org
Date:     2011-08-24 18:18:00 -0700 (Wed, 24 Aug 2011)
Log Message:
-----------
xorg-libxcb, xorg-xcb-proto: fix python31 and python32 variants (#26418)

Modified Paths:
--------------
    trunk/dports/x11/xorg-libxcb/Portfile
    trunk/dports/x11/xorg-xcb-proto/Portfile

Added Paths:
-----------
    trunk/dports/x11/xorg-libxcb/files/
    trunk/dports/x11/xorg-libxcb/files/libxcb-python3.patch
    trunk/dports/x11/xorg-xcb-proto/files/
    trunk/dports/x11/xorg-xcb-proto/files/xcbproto-python3.patch

Modified: trunk/dports/x11/xorg-libxcb/Portfile
===================================================================
--- trunk/dports/x11/xorg-libxcb/Portfile	2011-08-25 00:37:59 UTC (rev 83060)
+++ trunk/dports/x11/xorg-libxcb/Portfile	2011-08-25 01:18:00 UTC (rev 83061)
@@ -27,6 +27,14 @@
                 port:xorg-xcb-proto \
                 port:xorg-libpthread-stubs
 
+if {[variant_isset python31] || [variant_isset python32]} {
+    patchfiles-append libxcb-python3.patch
+    post-patch {
+        system -W ${worksrcpath}/src "$2to3 -w *.py"
+    }
+}
+
+set 2to3 ""
 variant python25 conflicts python26 python27 python31 python32 description {Use python 2.5} {
     depends_run-append      port:python25
     configure.python        ${prefix}/bin/python2.5
@@ -45,11 +53,13 @@
 variant python31 conflicts python25 python26 python27 python32 description {Use python 3.1} {
     depends_run-append      port:python31
     configure.python        ${prefix}/bin/python3.1
+    set 2to3 "${prefix}/bin/2to3-3.1"
 }
 
 variant python32 conflicts python25 python26 python27 python31 description {Use python 3.2} {
     depends_run-append      port:python32
     configure.python        ${prefix}/bin/python3.2
+    set 2to3 "${prefix}/bin/2to3-3.2"
 }
 
 if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python31] && ![variant_isset python32]} {

Added: trunk/dports/x11/xorg-libxcb/files/libxcb-python3.patch
===================================================================
--- trunk/dports/x11/xorg-libxcb/files/libxcb-python3.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-libxcb/files/libxcb-python3.patch	2011-08-25 01:18:00 UTC (rev 83061)
@@ -0,0 +1,11 @@
+--- src/c_client.py
++++ src/c_client.py
+@@ -288,7 +288,7 @@ def _c_type_setup(self, name, postfix):
+             field.c_field_type = _t(field.field_type)
+             field.c_field_const_type = ('' if field.type.nmemb == 1 else 'const ') + field.c_field_type
+             field.c_field_name = _cpp(field.field_name)
+-            field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb > 1) else ''
++            field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb and field.type.nmemb > 1) else ''
+             field.c_pointer = ' ' if field.type.nmemb == 1 else '*'
+ 
+             field.c_iterator_type = _t(field.field_type + ('iterator',))      # xcb_fieldtype_iterator_t

Modified: trunk/dports/x11/xorg-xcb-proto/Portfile
===================================================================
--- trunk/dports/x11/xorg-xcb-proto/Portfile	2011-08-25 00:37:59 UTC (rev 83060)
+++ trunk/dports/x11/xorg-xcb-proto/Portfile	2011-08-25 01:18:00 UTC (rev 83061)
@@ -22,6 +22,14 @@
 
 depends_run     port:libxml2
 
+if {[variant_isset python31] || [variant_isset python32]} {
+    patchfiles-append xcbproto-python3.patch
+    post-patch {
+        system -W ${worksrcpath}/xcbgen "$2to3 -w *.py"
+    }
+}
+
+set 2to3 ""
 variant python25 conflicts python26 python27 python31 python32 description {Use python 2.5} {
     depends_run-append      port:python25
     configure.python        ${prefix}/bin/python2.5
@@ -40,11 +48,13 @@
 variant python31 conflicts python25 python26 python27 python32 description {Use python 3.1} {
     depends_run-append      port:python31
     configure.python        ${prefix}/bin/python3.1
+    set 2to3 "${prefix}/bin/2to3-3.1"
 }
 
 variant python32 conflicts python25 python26 python27 python31 description {Use python 3.2} {
     depends_run-append      port:python32
     configure.python        ${prefix}/bin/python3.2
+    set 2to3 "${prefix}/bin/2to3-3.2"
 }
 
 if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python31] && ![variant_isset python32]} {

Added: trunk/dports/x11/xorg-xcb-proto/files/xcbproto-python3.patch
===================================================================
--- trunk/dports/x11/xorg-xcb-proto/files/xcbproto-python3.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-xcb-proto/files/xcbproto-python3.patch	2011-08-25 01:18:00 UTC (rev 83061)
@@ -0,0 +1,20 @@
+--- xcbgen/matcher.py
++++ xcbgen/matcher.py
+@@ -9,14 +9,15 @@ we do not create a new type object, we just record the existing one under a new
+ from os.path import join
+ from xml.etree.cElementTree import parse
+ 
+-import state
+-from xtypes import *
++from xcbgen.xtypes import *
+ 
+ def import_(node, module, namespace):
+     '''
+     For imports, we load the file, create a new namespace object,
+     execute recursively, then record the import (for header files, etc.)
+     '''
++    # To avoid circular import error
++    from xcbgen import state
+     new_file = join(namespace.dir, '%s.xml' % node.text)
+     new_root = parse(new_file).getroot()
+     new_namespace = state.Namespace(new_file)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110824/ea5e442e/attachment.html>


More information about the macports-changes mailing list