[105101] trunk/dports/_resources/port1.0/group/python-1.0.tcl

michaelld at macports.org michaelld at macports.org
Wed Apr 10 05:28:56 PDT 2013


Revision: 105101
          https://trac.macports.org/changeset/105101
Author:   michaelld at macports.org
Date:     2013-04-10 05:28:56 -0700 (Wed, 10 Apr 2013)
Log Message:
-----------
python-1.0 PortGroup: Fix python.include to be correct for both Python2 and Python3.  In the latter the naming scheme depends on the build options, while with the former the naming scheme is fixed.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/python-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/python-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/python-1.0.tcl	2013-04-10 12:25:12 UTC (rev 105100)
+++ trunk/dports/_resources/port1.0/group/python-1.0.tcl	2013-04-10 12:28:56 UTC (rev 105101)
@@ -200,7 +200,7 @@
 default python.lib  {[python_get_defaults lib]}
 default python.pkgd {[python_get_defaults pkgd]}
 default python.libdir {${python.prefix}/lib/python${python.branch}}
-default python.include  {${python.prefix}/include/python${python.branch}}
+default python.include  {[python_get_defaults include]}
 
 default build.cmd       {"${python.bin} setup.py [python_get_defaults setup_args]"}
 default destroot.cmd    {"${python.bin} setup.py [python_get_defaults setup_args]"}
@@ -227,6 +227,24 @@
                 return "${prefix}/bin/python${python.branch}"
             }
         }
+        include {
+            set inc_dir "${python.prefix}/include/python${python.branch}"
+            if {[file exists ${inc_dir}]} {
+                return ${inc_dir}
+            } else {
+                # look for "${inc_dir}*" and pick the first one found;
+                # make assumptions if none are found
+                if {[catch {set inc_dirs [glob ${inc_dir}*]}]} {
+                    if {${python.version} < 30} {
+                        return ${inc_dir}
+                    } else {
+                        return ${inc_dir}m
+                    }
+                } else {
+                    return [lindex ${inc_dirs} 0]
+                }
+            }
+        }
         lib {
             if {${python.version} != 24 && ${python.version} != 25} {
                 return "${python.prefix}/Python"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130410/81b75c72/attachment-0001.html>


More information about the macports-changes mailing list