[71168] trunk/dports/lang/python32/Portfile

jwa at macports.org jwa at macports.org
Fri Sep 3 09:10:42 PDT 2010


Revision: 71168
          http://trac.macports.org/changeset/71168
Author:   jwa at macports.org
Date:     2010-09-03 09:10:41 -0700 (Fri, 03 Sep 2010)
Log Message:
-----------
for some reason python32 Portfile was left out in the previous commit

Added Paths:
-----------
    trunk/dports/lang/python32/Portfile

Added: trunk/dports/lang/python32/Portfile
===================================================================
--- trunk/dports/lang/python32/Portfile	                        (rev 0)
+++ trunk/dports/lang/python32/Portfile	2010-09-03 16:10:41 UTC (rev 71168)
@@ -0,0 +1,171 @@
+# $Id: Portfile 69520 2010-07-08 20:19:52Z jmr at macports.org $
+
+PortSystem 1.0
+PortGroup select 1.0
+
+name                    python32
+version                 3.2a1
+
+set major               [lindex [split $version .] 0]
+#set branch              [join [lrange [split ${version} .] 0 1] .]
+set branch              3.2
+categories              lang
+platforms               darwin
+maintainers             jwa 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/${version}/
+master_sites            ${homepage}ftp/python/${branch}/
+
+distname                Python-${version}
+use_bzip2               yes
+
+checksums           md5     b371e1f7a0e98e7a0d1792823fd0f58c \
+                    sha1    c577c73400fe599d67fd2fd2e152db737f3b9bdc \
+                    rmd160  02a8f40e1b13c3becf4d57042d5443ff37c0fd12
+
+patchfiles              patch-Makefile.pre.in.diff \
+                        patch-setup.py.diff \
+                        patch-Lib-cgi.py.diff \
+                        patch-Lib-distutils-dist.py.diff
+if {![variant_isset universal]} {
+    patchfiles-append   patch-configure-arch_only.diff
+     # -arch ends up getting passed to libtool which doesn't understand it, so we
+     # just clear it since this port doesn't respect build_arch anyway
+     configure.ld_archflags
+}
+
+depends_lib             port:zlib port:openssl port:tk \
+                        port:sqlite3 port:ncurses port:gdbm \
+                        port:bzip2 port:readline
+
+configure.args          --enable-framework=${frameworks_dir} \
+                        --enable-ipv6 \
+                        --with-computed-gotos
+configure.ccache        no
+
+configure.cppflags-append -I${prefix}/include/ncurses
+
+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
+
+   # See http://trac.macports.org/changeset/37861
+   reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
+      ${worksrcpath}/Mac/PythonLauncher/Makefile.in
+}
+
+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
+
+   # remove -arch flags from the config
+   reinplace -E {s|-arch [^[:space:]]+||g} \
+      ${destroot}${framewdir}/lib/python${branch}/config/Makefile
+}
+
+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"
+   }
+}
+
+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
+      }
+   }
+   if {${configure.sdkroot} != ""} {
+      configure.args-append   --enable-universalsdk=${configure.sdkroot}
+   } else {
+      configure.args-append   --enable-universalsdk=/
+   }
+}
+
+variant ucs4 description {Use 4-byte Unicode characters} {
+   configure.args-append   --with-wide-unicode
+}
+
+variant no_tkinter description {Disable Tkinter support, which will break IDLE} {
+   patchfiles-append    patch-setup_no_tkinter.py.diff
+   depends_lib-delete   port:tk 
+}
+
+livecheck.type          regex
+livecheck.url           ${homepage}download/releases/
+livecheck.regex         Python (${branch}(?:\\.\\d+)*)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100903/3446c24c/attachment.html>


More information about the macports-changes mailing list