[46197] trunk/dports/lang/python30

mcalhoun at macports.org mcalhoun at macports.org
Sat Jan 31 10:21:03 PST 2009


Revision: 46197
          http://trac.macports.org/changeset/46197
Author:   mcalhoun at macports.org
Date:     2009-01-31 10:21:02 -0800 (Sat, 31 Jan 2009)
Log Message:
-----------
python30: Maintainer timeout fixes.
  * Don't disable modules. See r42841 for the reasons. Fixes #17796.
  * Do not try a hybridized install into ${prefix} and ${frameworks_dir}. Fixes #17795.
  * Fix location of Python in IDLE.app script. Fixes #18263.
  * Add variant to allow the use of 4-byte Unicode character. Partial fix of #11774.
  * Use MacPorts 1.7 variables. Fixes #18295.
  * Add no-user-cfg option to setup.py. Partial fix of #9831.
  * Allow 64-bit universal builds. Partial fix of #16349.
  * Remove patch to build libpython$(VERSION).dylib.
  * Fix livecheck.

Modified Paths:
--------------
    trunk/dports/lang/python30/Portfile
    trunk/dports/lang/python30/files/patch-Lib-cgi.py.diff
    trunk/dports/lang/python30/files/patch-setup.py.diff

Added Paths:
-----------
    trunk/dports/lang/python30/files/patch-Lib-distutils-dist.py.diff

Removed Paths:
-------------
    trunk/dports/lang/python30/files/patch-Makefile.pre.in.diff

Modified: trunk/dports/lang/python30/Portfile
===================================================================
--- trunk/dports/lang/python30/Portfile	2009-01-31 18:12:37 UTC (rev 46196)
+++ trunk/dports/lang/python30/Portfile	2009-01-31 18:21:02 UTC (rev 46197)
@@ -4,7 +4,7 @@
 
 name                    python30
 version                 3.0
-set branch              3.0
+set branch              [join [lrange [split ${version} .] 0 1] .]
 categories              lang
 platforms               darwin
 maintainers             mww
@@ -27,55 +27,62 @@
                         rmd160  ae3da661bd387330e93cc5fbcd3f2040bfeff6b6
 
 patchfiles              patch-setup.py.diff \
-                        patch-Makefile.pre.in.diff \
-                        patch-Lib-cgi.py.diff
+                        patch-Lib-cgi.py.diff \
+                        patch-Lib-distutils-dist.py.diff
 
-depends_lib             port:gettext
+depends_lib             port:gettext port:zlib port:openssl port:tk \
+                        port:sqlite3 port:ncurses port:gdbm \
+                        port:bzip2 port:readline
 
 configure.args          --enable-shared \
-                        --enable-framework=${prefix}/Library/Frameworks \
-                        --mandir=${prefix}/share/man \
-                        --without-readline \
-                        --disable-tk \
+                        --enable-framework=${frameworks_dir} \
                         --enable-ipv6
 
 use_parallel_build      no
 
-build.target            all libpython${branch}.dylib
+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}"
+
 post-destroot {
-        set framewpath ${prefix}/Library/Frameworks/Python.framework
-        set framewdir  ${framewpath}/Versions/${branch}
+   set framewpath ${frameworks_dir}/Python.framework
+   set framewdir  ${framewpath}/Versions/${branch}
 
-        foreach dir { lib include } {
-            file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
-            ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
-        }
+   foreach dir { Headers Resources Python Versions/Current } {
+      file delete ${destroot}${framewpath}/${dir}
+   }
 
-        file rename ${destroot}${framewdir}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib
-        ln -s ${prefix}/lib/libpython${branch}.dylib ${destroot}${framewdir}/lib/libpython${branch}.dylib
+   ln -s ${framewdir}/share/man/man1/python${branch}.1 ${destroot}${prefix}/share/man/man1/
 
-        # delete symlinks without version suffix, use python_select instead to choose version
-        foreach bin { python pythonw idle pydoc smtpd.py python-config } {
-            file delete ${destroot}${prefix}/bin/${bin}
-        }
-        foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py python${branch}-config] {
-            file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
-            ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
-        }
-
-        foreach dir { Headers Resources Python Versions/Current } {
-            file delete ${destroot}${framewpath}/${dir}
-        }
-
-        # install select file for python_select
-        xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
-        xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
+   # install select file for python_select
+   xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
+   xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
 }
 
 post-activate {
@@ -84,14 +91,40 @@
 \n\tsudo python_select $name\n"
 }
 
+platform darwin 9 {
+   configure.cppflags-append   -D__DARWIN_UNIX03
+}
+
 platform darwin 10 {
-        configure.compiler              gcc-4.2
+   configure.compiler   gcc-4.2
 }
 
 variant universal {
-        configure.args-append           --enable-universalsdk
+   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}b\[0-9\]+)
+livecheck.regex         Python (${branch}(?:\\.\\d+)*)

Modified: trunk/dports/lang/python30/files/patch-Lib-cgi.py.diff
===================================================================
--- trunk/dports/lang/python30/files/patch-Lib-cgi.py.diff	2009-01-31 18:12:37 UTC (rev 46196)
+++ trunk/dports/lang/python30/files/patch-Lib-cgi.py.diff	2009-01-31 18:21:02 UTC (rev 46197)
@@ -2,7 +2,7 @@
 +++ Lib/cgi.py	2007-08-21 15:36:54.000000000 +0200
 @@ -1,13 +1,6 @@
 -#! /usr/local/bin/python
-+#! __PREFIX__/bin/python2.5
++#! @@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

Added: trunk/dports/lang/python30/files/patch-Lib-distutils-dist.py.diff
===================================================================
--- trunk/dports/lang/python30/files/patch-Lib-distutils-dist.py.diff	                        (rev 0)
+++ trunk/dports/lang/python30/files/patch-Lib-distutils-dist.py.diff	2009-01-31 18:21:02 UTC (rev 46197)
@@ -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
+ 
+ 

Deleted: trunk/dports/lang/python30/files/patch-Makefile.pre.in.diff
===================================================================
--- trunk/dports/lang/python30/files/patch-Makefile.pre.in.diff	2009-01-31 18:12:37 UTC (rev 46196)
+++ trunk/dports/lang/python30/files/patch-Makefile.pre.in.diff	2009-01-31 18:21:02 UTC (rev 46197)
@@ -1,26 +0,0 @@
---- Makefile.pre.in.orig	2008-03-02 20:00:54.000000000 +0100
-+++ Makefile.pre.in	2008-03-02 20:03:49.000000000 +0100
-@@ -397,6 +397,13 @@
- libpython$(VERSION).sl: $(LIBRARY_OBJS)
- 	$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
- 
-+libpython$(VERSION).dylib: $(LIBRARY)
-+	/usr/bin/libtool -o $@ -dynamic $(OTHER_LIBTOOL_OPT) \
-+		-all_load $(LIBRARY) -single_module \
-+		-install_name $(LIBDIR)/$@ \
-+		-compatibility_version $(VERSION) \
-+		-current_version $(VERSION) -lSystem -lSystemStubs $(LDFLAGS)
-+
- # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
- # minimal framework (not including the Lib directory and such) in the current
- # directory.
-@@ -738,6 +745,9 @@
- 			fi \
- 		fi; \
- 	else	true; \
-+	fi; \
-+	if test -f libpython$(VERSION).dylib; then \
-+		$(INSTALL_SHARED) libpython$(VERSION).dylib $(DESTDIR)$(LIBDIR); \
- 	fi
- 
- # Install the manual page

Modified: trunk/dports/lang/python30/files/patch-setup.py.diff
===================================================================
--- trunk/dports/lang/python30/files/patch-setup.py.diff	2009-01-31 18:12:37 UTC (rev 46196)
+++ trunk/dports/lang/python30/files/patch-setup.py.diff	2009-01-31 18:21:02 UTC (rev 46197)
@@ -1,11 +1,16 @@
---- setup.py	2007-08-29 00:24:48.000000000 +0200
-+++ setup.py	2007-09-01 00:44:50.000000000 +0200
-@@ -15,7 +15,7 @@
- from distutils.command.install_lib import install_lib
+--- 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.
  
- # This global variable is used to hold the list of modules to be disabled.
--disabled_module_list = []
-+disabled_module_list = ["zlib","_hashlib","_ssl","_bsddb","_sqlite3","_tkinter","bz2","gdbm","readline","_curses","_curses_panel"]
+-        # 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
  
- def add_dir_to_list(dirlist, dir):
-     """Add the directory 'dir' to the list 'dirlist' (at the front) if
+         # Assume we haven't found any of the libraries or include files
+         # The versions with dots are used on Unix, and the versions without
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090131/4704ca4d/attachment-0001.html>


More information about the macports-changes mailing list