[67722] trunk

blb at macports.org blb at macports.org
Sun May 16 13:46:36 PDT 2010


Revision: 67722
          http://trac.macports.org/changeset/67722
Author:   blb at macports.org
Date:     2010-05-16 13:46:31 -0700 (Sun, 16 May 2010)
Log Message:
-----------
lang/python26, its portgroup, and guide - push arch flags from the installed
python Makefile into the portgroup for better control by the py26 ports (and
document python.add_archflags in the guide)
Ticket #24802

Modified Paths:
--------------
    trunk/doc-new/guide/xml/portgroup-python.xml
    trunk/dports/_resources/port1.0/group/python26-1.0.tcl
    trunk/dports/lang/python26/Portfile

Modified: trunk/doc-new/guide/xml/portgroup-python.xml
===================================================================
--- trunk/doc-new/guide/xml/portgroup-python.xml	2010-05-16 19:47:47 UTC (rev 67721)
+++ trunk/doc-new/guide/xml/portgroup-python.xml	2010-05-16 20:46:31 UTC (rev 67722)
@@ -37,6 +37,26 @@
           </itemizedlist>
         </listitem>
       </varlistentry>
+      <varlistentry>
+        <term>python.add_archflags</term>
+        <listitem>
+          <para>When yes (the default), the PortGroup will automatically
+          try to pass the correct arch-specific flags during build time
+          (via the standard CFLAGS, LDFLAGS, etc environment variables).
+          Set this to no and setup those variables in build.env manually
+          if the default does not work.</para>
+          <itemizedlist>
+            <listitem>
+              <para>Type: optional</para>
+            </listitem>
+            <listitem>
+              <para>Example:</para>
+
+              <programlisting>python.add_archflags     no</programlisting>
+            </listitem>
+          </itemizedlist>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </section>
 

Modified: trunk/dports/_resources/port1.0/group/python26-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/python26-1.0.tcl	2010-05-16 19:47:47 UTC (rev 67721)
+++ trunk/dports/_resources/port1.0/group/python26-1.0.tcl	2010-05-16 20:46:31 UTC (rev 67722)
@@ -46,10 +46,31 @@
 
 depends_lib		port:python26
 
-use_configure	no
+# we want the default universal variant to be added, so no 'use_configure no'
+configure       {}
 
 build.cmd		${python.bin} setup.py --no-user-cfg
 build.target	build
+options python.add_archflags
+default python.add_archflags yes
+pre-build {
+    if {${python.add_archflags}} {
+        if {[variant_exists universal] && [variant_isset universal]} {
+            build.env-append CFLAGS="${configure.universal_cflags}" \
+                             OBJCFLAGS="${configure.universal_cflags}" \
+                             CXXFLAGS="${configure.universal_cxxflags}" \
+                             LDFLAGS="${configure.universal_ldflags}"
+        } else {
+            build.env-append CFLAGS="${configure.cc_archflags}" \
+                             OBJCFLAGS="${configure.objc_archflags}" \
+                             CXXFLAGS="${configure.cxx_archflags}" \
+                             LDFLAGS="${configure.ld_archflags}" \
+                             FFLAGS="${configure.f77_archflags}" \
+                             F90FLAGS="${configure.f90_archflags}" \
+                             FCFLAGS="${configure.fc_archflags}"
+        }
+    }
+}
 
 destroot.cmd	${python.bin} setup.py --no-user-cfg
 destroot.destdir	--prefix=${python.prefix} --root=${destroot}

Modified: trunk/dports/lang/python26/Portfile
===================================================================
--- trunk/dports/lang/python26/Portfile	2010-05-16 19:47:47 UTC (rev 67721)
+++ trunk/dports/lang/python26/Portfile	2010-05-16 20:46:31 UTC (rev 67722)
@@ -5,6 +5,7 @@
 
 name                    python26
 version                 2.6.5
+revision                1
 set major               [lindex [split $version .] 0]
 set branch              [join [lrange [split ${version} .] 0 1] .]
 categories              lang
@@ -115,6 +116,10 @@
    foreach unversionedFile {idle pydoc python python-config pythonw smtpd.py} {
       delete ${destroot}${prefix}/bin/${unversionedFile}
    }
+   
+   # remove -arch flags from the config
+   reinplace -E {s|-arch [^[:space:]]+||g} \
+      ${destroot}${framewdir}/lib/python${branch}/config/Makefile
 }
 
 platform darwin {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100516/00dd86ff/attachment.html>


More information about the macports-changes mailing list