[49114] trunk/dports/lang

erickt at macports.org erickt at macports.org
Fri Apr 3 22:04:49 PDT 2009


Revision: 49114
          http://trac.macports.org/changeset/49114
Author:   erickt at macports.org
Date:     2009-04-03 22:04:49 -0700 (Fri, 03 Apr 2009)
Log Message:
-----------
Add a package for python 3.1a1.

Added Paths:
-----------
    trunk/dports/lang/python31/
    trunk/dports/lang/python31/Portfile
    trunk/dports/lang/python31/files/
    trunk/dports/lang/python31/files/patch-Lib-cgi.py.diff
    trunk/dports/lang/python31/files/patch-Lib-distutils-dist.py.diff
    trunk/dports/lang/python31/files/patch-setup.py.diff
    trunk/dports/lang/python31/files/pyconfig.ed
    trunk/dports/lang/python31/files/python31
    trunk/dports/lang/python31/files/version.plist

Added: trunk/dports/lang/python31/Portfile
===================================================================
--- trunk/dports/lang/python31/Portfile	                        (rev 0)
+++ trunk/dports/lang/python31/Portfile	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,147 @@
+# $Id$
+
+PortSystem 1.0
+PortGroup select 1.0
+
+name                    python31
+version                 3.1a1
+set major               [lindex [split $version .] 0]
+set branch              3.1
+categories              lang
+platforms               darwin
+maintainers             blb openmaintainer
+
+description             An interpreted, object-oriented programming language
+long_description        Python is an interpreted, interactive, object-oriented \
+                        programming language.
+
+homepage                http://www.python.org/
+master_sites            ${homepage}/ftp/python/3.1/ \
+                        ftp://ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.fastorama.com/mirrors/ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.python.jp/pub/python/${version}/
+
+distname                Python-${version}
+extract.suffix	        .tgz
+
+checksums               md5     92d45cd52516c8b531a1bb2d3d0fce9c \
+                        sha1    6aa203cca67039a627e4f414a0e2559af3c7b7c4 \
+                        rmd160  53642dff13dce13f92a64459d9a182408a800d31
+
+patchfiles              patch-setup.py.diff \
+                        patch-Lib-cgi.py.diff \
+                        patch-Lib-distutils-dist.py.diff
+
+depends_lib             port:gettext port:zlib port:openssl port:tk \
+                        port:sqlite3 port:ncurses port:gdbm \
+                        port:bzip2 port:readline
+
+configure.args          --enable-framework=${frameworks_dir} \
+                        --enable-ipv6
+
+use_parallel_build      yes
+
+post-patch {
+   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py
+
+   reinplace "s|/setup.py|/setup.py --no-user-cfg|" ${worksrcpath}/Makefile.pre.in
+
+   # replace /Applications/ with ${applications_dir}/
+   reinplace "s|\\(\[^a-zA-Z0-9\]\\)/Applications/|\\1${applications_dir}/|" \
+      ${worksrcpath}/Mac/Makefile.in \
+      ${worksrcpath}/Mac/Tools/Doc/setup.py \
+      ${worksrcpath}/Mac/PythonLauncher/Makefile.in \
+      ${worksrcpath}/Mac/BuildScript/build-installer.py
+
+   reinplace "s|#!/Library/Frameworks|#!${frameworks_dir}|" \
+      ${worksrcpath}/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
+}
+
+build.target            all
+
+# test_cmd_line fails
+# see http://bugs.python.org/issue4388 and
+#     http://bugs.python.org/issue4474
+test.run                yes
+test.target             test
+
+destroot.target         frameworkinstall maninstall
+
+# ensure that correct compiler is used
+build.args-append       MAKE="${build.cmd} CC=${configure.cc}"
+destroot.args-append    MAKE="${destroot.cmd} CC=${configure.cc}"
+
+select.group            python
+select.file             ${filespath}/python[string map {. {}} ${branch}]
+
+post-destroot {
+   set framewpath ${frameworks_dir}/Python.framework
+   set framewdir  ${framewpath}/Versions/${branch}
+
+   foreach dir { Headers Resources Python Versions/Current } {
+      file delete ${destroot}${framewpath}/${dir}
+   }
+
+   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
+
+   # Without this, LINKFORSHARED is set to
+   # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
+   # (this becomes Python.framework/Versions/3.0/Python) which doesn't
+   # quite work (see ticket #15099); instead specifically list the
+   # full path to the proper Python framework file (which becomes
+   # ${prefix}/Library/Frameworks/Python.framework/Versions/3.0/Python)
+   reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile
+
+   # The framework version.plist isn't currently being installed so
+   # we'll copy ours for now (see http://trac.macports.org/ticket/18773 and
+   # http://bugs.python.org/issue4937)
+   xinstall -m 644 ${filespath}/version.plist \
+      ${destroot}${framewdir}/Resources/version.plist
+}
+
+post-activate {
+   ui_msg "\nTo fully complete your installation and make python $branch the default, please run
+\n\tsudo port install python_select \
+\n\tsudo python_select $name\n"
+}
+
+platform darwin {
+   post-configure {
+      # See http://trac.macports.org/ticket/18376
+      system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.ed"
+   }
+}
+
+platform darwin 10 {
+   configure.compiler   gcc-4.2
+}
+
+variant universal {
+   post-patch {
+      set universal_arch_flags {}
+      set arch_run_32bit {}
+      foreach arch ${universal_archs} {
+         lappend universal_arch_flags -arch ${arch}
+         if { ${arch}=="i386" || ${arch}=="ppc" } {
+            lappend arch_run_32bit -${arch}
+         }
+      }
+      reinplace \
+         "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
+         ${worksrcpath}/configure
+      if { ${arch_run_32bit} != "" } {
+         reinplace \
+            "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
+            ${worksrcpath}/configure
+      }
+   }
+   configure.args-append   --enable-universalsdk=${universal_sysroot}
+}
+
+variant ucs4 description {Use 4-byte Unicode characters} {
+   configure.args-append   --with-wide-unicode
+}
+
+livecheck.check         regex
+livecheck.url           ${homepage}download/releases/
+livecheck.regex         Python (${branch}(?:\\.\\d+)*)

Added: trunk/dports/lang/python31/files/patch-Lib-cgi.py.diff
===================================================================
--- trunk/dports/lang/python31/files/patch-Lib-cgi.py.diff	                        (rev 0)
+++ trunk/dports/lang/python31/files/patch-Lib-cgi.py.diff	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,18 @@
+--- Lib/cgi.py.orig	2006-08-10 19:41:07.000000000 +0200
++++ Lib/cgi.py	2007-08-21 15:36:54.000000000 +0200
+@@ -1,13 +1,6 @@
+-#! /usr/local/bin/python
++#! @@PREFIX@@/bin/python3.0
+ 
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
+-# intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
+-# of installation.
++# NOTE: /usr/local/bin/python patched for MacPorts installation
+ 
+ """Support module for CGI (Common Gateway Interface) scripts.
+ 

Added: trunk/dports/lang/python31/files/patch-Lib-distutils-dist.py.diff
===================================================================
--- trunk/dports/lang/python31/files/patch-Lib-distutils-dist.py.diff	                        (rev 0)
+++ trunk/dports/lang/python31/files/patch-Lib-distutils-dist.py.diff	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,51 @@
+--- Lib/distutils/dist.py.orig	2008-07-26 16:09:45.000000000 -0400
++++ Lib/distutils/dist.py	2009-01-31 11:37:17.000000000 -0500
+@@ -54,6 +54,7 @@
+                       ('quiet', 'q', "run quietly (turns verbosity off)"),
+                       ('dry-run', 'n', "don't actually do anything"),
+                       ('help', 'h', "show detailed help message"),
++                      ('no-user-cfg', None,'ignore pydistutils.cfg in your home directory'),
+                      ]
+ 
+     # 'common_usage' is a short (2-3 line) string describing the common
+@@ -260,6 +261,12 @@
+                     else:
+                         sys.stderr.write(msg + "\n")
+ 
++        # no-user-cfg is handled before other command line args
++        # because other args override the config files, and this
++        # one is needed before we can load the config files.
++        # If attrs['script_args'] wasn't passed, assume false.
++        self.want_user_cfg = '--no-user-cfg' not in (self.script_args or [])
++
+         self.finalize_options()
+ 
+ 
+@@ -315,6 +322,9 @@
+         Distutils __inst__.py file lives), a file in the user's home
+         directory named .pydistutils.cfg on Unix and pydistutils.cfg
+         on Windows/Mac, and setup.cfg in the current directory.
++
++        The file in the user's home directory can be disabled with the
++        --no-user-cfg option.
+         """
+         files = []
+         check_environ()
+@@ -335,7 +345,7 @@
+ 
+         # And look for the user config file
+         user_file = os.path.join(os.path.expanduser('~'), user_filename)
+-        if os.path.isfile(user_file):
++        if self.want_user_cfg and os.path.isfile(user_file):
+             files.append(user_file)
+ 
+         # All platforms support local setup.cfg
+@@ -343,6 +353,8 @@
+         if os.path.isfile(local_file):
+             files.append(local_file)
+ 
++        if DEBUG:
++            print("using config files: %s" % ', '.join(files))
+         return files
+ 
+ 

Added: trunk/dports/lang/python31/files/patch-setup.py.diff
===================================================================
--- trunk/dports/lang/python31/files/patch-setup.py.diff	                        (rev 0)
+++ trunk/dports/lang/python31/files/patch-setup.py.diff	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,16 @@
+--- setup.py.orig	2008-09-29 18:15:45.000000000 -0600
++++ setup.py	2008-11-30 23:13:09.000000000 -0700
+@@ -1156,13 +1156,7 @@
+     def detect_tkinter(self, inc_dirs, lib_dirs):
+         # The _tkinter module.
+ 
+-        # Rather than complicate the code below, detecting and building
+-        # AquaTk is a separate method. Only one Tkinter will be built on
+-        # Darwin - either AquaTk, if it is found, or X11 based Tk.
+         platform = self.get_platform()
+-        if (platform == 'darwin' and
+-            self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
+-            return
+ 
+         # Assume we haven't found any of the libraries or include files
+         # The versions with dots are used on Unix, and the versions without

Added: trunk/dports/lang/python31/files/pyconfig.ed
===================================================================
--- trunk/dports/lang/python31/files/pyconfig.ed	                        (rev 0)
+++ trunk/dports/lang/python31/files/pyconfig.ed	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,2 @@
+g,.*\(HAVE_POLL[_A-Z]*\).*,s,,/* #undef \1 */,
+w

Added: trunk/dports/lang/python31/files/python31
===================================================================
--- trunk/dports/lang/python31/files/python31	                        (rev 0)
+++ trunk/dports/lang/python31/files/python31	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,12 @@
+bin/python3.1
+bin/pythonw3.1
+bin/python-config3.1
+bin/idle3.1
+bin/pydoc3.1
+bin/smtpd3.1.py
+-
+share/man/man1/python3.1a1.gz
+${frameworks_dir}/Library/Frameworks/Python.framework/Versions/3.1
+${frameworks_dir}/Library/Frameworks/Python.framework/Versions/3.1/Headers
+${frameworks_dir}/Library/Frameworks/Python.framework/Versions/3.1/Resources
+${frameworks_dir}/Library/Frameworks/Python.framework/Versions/3.1/Python

Added: trunk/dports/lang/python31/files/version.plist
===================================================================
--- trunk/dports/lang/python31/files/version.plist	                        (rev 0)
+++ trunk/dports/lang/python31/files/version.plist	2009-04-04 05:04:49 UTC (rev 49114)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildVersion</key>
+	<string>1</string>
+	<key>CFBundleShortVersionString</key>
+	<string>3.0.1</string>
+	<key>CFBundleVersion</key>
+	<string>3.0.1</string>
+	<key>ProjectName</key>
+	<string>Python</string>
+	<key>SourceVersion</key>
+	<string>3.0.1</string>
+</dict>
+</plist>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090403/85647c30/attachment-0001.html>


More information about the macports-changes mailing list