[109455] users/mojca/wxports/python/py-wxpython-2.8

mojca at macports.org mojca at macports.org
Thu Aug 15 13:13:39 PDT 2013


Revision: 109455
          https://trac.macports.org/changeset/109455
Author:   mojca at macports.org
Date:     2013-08-15 13:13:39 -0700 (Thu, 15 Aug 2013)
Log Message:
-----------
mojca/py-wxpython-2.8: proper configuration of arch flags and SDK, properly request 'gtk2' instead of default 'mac'

Modified Paths:
--------------
    users/mojca/wxports/python/py-wxpython-2.8/Portfile
    users/mojca/wxports/python/py-wxpython-2.8/files/patch-config.py.diff

Modified: users/mojca/wxports/python/py-wxpython-2.8/Portfile
===================================================================
--- users/mojca/wxports/python/py-wxpython-2.8/Portfile	2013-08-15 20:08:49 UTC (rev 109454)
+++ users/mojca/wxports/python/py-wxpython-2.8/Portfile	2013-08-15 20:13:39 UTC (rev 109455)
@@ -44,31 +44,36 @@
 extract.post_args   "| tar -xf - ${worksrcdir} ${distname}-src-${version}/docs"
 
 if {$subport != $name} {
-    # TODO: this patch and reinplace both need a review
-    patchfiles      patch-config.py.diff
+    patchfiles              patch-config.py.diff
 
-    post-patch {
-        if {[vercmp $xcodeversion 4.3] >= 0} {
-            reinplace "s;@developer_dir@;${developer_dir}/Platforms/MacOSX.platform/Developer;" ${worksrcpath}/config.py
-        } else {
-            reinplace "s;@developer_dir@;${developer_dir};" ${worksrcpath}/config.py
-        }
-    }
-
     variant carbon conflicts gtk description {use 32-bit carbon-based wxWidgets} {
         wxWidgets.use       wxWidgets-2.8
         depends_lib-append  port:wxWidgets-2.8
         # TODO: the following line would end up with --no-user-cfg
         #build.args         WX_CONFIG="${wxWidgets.wxconfig}"
-        build.cmd           ${python.bin} setup.py WX_CONFIG="${wxWidgets.wxconfig}"
-        destroot.cmd        ${python.bin} setup.py WX_CONFIG="${wxWidgets.wxconfig}"
+        build.cmd           ${python.bin} setup.py WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
+        destroot.cmd        ${python.bin} setup.py WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
+
+        # TODO: test if this works on 10.7
+        post-patch {
+            reinplace       "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
+            reinplace       "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
+            if {${wxWidgets.sdk} != ""} {
+                reinplace   "s|# @@FLAGS3@@|cflags.extend(\[\"-isysroot\", \"${wxWidgets.sdk}\"\])|" ${worksrcpath}/config.py
+            }
+        }
     }
 
     variant gtk conflicts carbon description {use wxGTK} {
         wxWidgets.use       wxGTK-2.8
         depends_lib-append  port:wxgtk-2.8
-        build.cmd           ${python.bin} setup.py WX_CONFIG="${wxWidgets.wxconfig}"
-        destroot.cmd        ${python.bin} setup.py WX_CONFIG="${wxWidgets.wxconfig}"
+        build.cmd           ${python.bin} setup.py WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
+        destroot.cmd        ${python.bin} setup.py WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
+
+        post-patch {
+            reinplace       "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
+            reinplace       "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
+        }
     }
 
     # TODO: think a bit more about it

Modified: users/mojca/wxports/python/py-wxpython-2.8/files/patch-config.py.diff
===================================================================
--- users/mojca/wxports/python/py-wxpython-2.8/files/patch-config.py.diff	2013-08-15 20:08:49 UTC (rev 109454)
+++ users/mojca/wxports/python/py-wxpython-2.8/files/patch-config.py.diff	2013-08-15 20:13:39 UTC (rev 109455)
@@ -1,9 +1,23 @@
---- config.py	2012-04-08 18:41:21.000000000 +0300
-+++ config.py	2012-04-08 18:44:32.000000000 +0300
-@@ -1031,19 +1031,8 @@
+--- config.py.orig
++++ config.py
+@@ -1024,27 +1024,16 @@ elif os.name == 'posix' or COMPILER == 'mingw32':
+     WXRELEASE  = os.popen(WX_CONFIG + ' --release').read()[:-1]
+     WXPREFIX   = os.popen(WX_CONFIG + ' --prefix').read()[:-1]
+ 
+-
+-    if sys.platform[:6] == "darwin" and WXPORT == 'mac':
++    if sys.platform[:6] == "darwin":
++        libs = ['stdc++']
++        NO_SCRIPTS = 1
++        # @@FLAGS1@@
++        # @@FLAGS2@@
++        # @@FLAGS3@@
++    if WXPORT == 'mac':
+         # Flags and such for a Darwin (Max OS X) build of Python
+         WXPLAT = '__WXMAC__'
          GENDIR = 'mac'
-         libs = ['stdc++']
-         NO_SCRIPTS = 1
+-        libs = ['stdc++']
+-        NO_SCRIPTS = 1
 -        if not ARCH == "":
 -            cflags.append("-arch")
 -            cflags.append(ARCH)
@@ -17,8 +31,22 @@
 -            os.environ["CXX"] = "g++-4.0"
 -            os.environ["CC"]  = "gcc-4.0"
 -            os.environ["CPP"] = "cpp-4.0"
-+        cflags.append("-isysroot")
-+        cflags.append("@developer_dir@/SDKs/MacOSX10.6.sdk")
- 
+-
      else:
          # Set flags for other Unix type platforms
+         GENDIR = WXPORT
+@@ -1070,14 +1059,6 @@ elif os.name == 'posix' or COMPILER == 'mingw32':
+ 
+         cflags += portcfg.split()
+ 
+-        # Some distros (e.g. Mandrake) put libGLU in /usr/X11R6/lib, but
+-        # wx-config doesn't output that for some reason.  For now, just
+-        # add it unconditionally but we should really check if the lib is
+-        # really found there or wx-config should be fixed.
+-        if WXPORT != 'msw':
+-            libdirs.append("/usr/X11R6/lib")
+-
+-
+     # Move the various -I, -D, etc. flags we got from the *config scripts
+     # into the distutils lists.
+     cflags = adjustCFLAGS(cflags, defines, includes)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130815/c510980d/attachment-0001.html>


More information about the macports-changes mailing list