f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv# $Id: Portfile 49077 2009-04-03 07:13:13Z erickt@macports.org $
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvPortSystem 1.0
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvPortGroup select 1.0
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvname python26
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvversion 2.6.1
117724f21a94ff32f773af4c37be88fe0d2970e3~suvrevision 100
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvset major [lindex [split $version .] 0]
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvset branch [join [lrange [split ${version} .] 0 1] .]
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvcategories lang
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvplatforms darwin
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvmaintainers blb mcalhoun
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvdescription An interpreted, object-oriented programming language
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvlong_description Python is an interpreted, interactive, object-oriented \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv programming language.
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvhomepage http://www.python.org/
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvmaster_sites ${homepage}/ftp/python/${version}/ \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ftp://ftp.python.org/pub/python/${version}/
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvdistname Python-${version}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvuse_bzip2 yes
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvchecksums md5 e81c2f0953aa60f8062c05a4673f2be0 \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv sha1 419f0cb29e9713ea861dde8c43d107c51329e57b \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv rmd160 497dafaca9c150fca611b0175eeb13c2fc4d3e2d
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv# patch-Lib-distutils-dist.py.diff comes from
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv# <http://bugs.python.org/issue1180>
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvpatchfiles patch-Makefile.pre.in.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-setup.py.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Lib-cgi.py.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Lib-distutils-dist.py.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Mac-IDLE-Makefile.in.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Mac-Makefile.in.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Mac-PythonLauncher-Makefile.in.diff \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv patch-Mac-Tools-Doc-setup.py.diff
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvdepends_lib port:gettext port:zlib port:openssl port:tk \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv port:sqlite3 port:db46 port:ncurses port:gdbm \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv port:bzip2 port:readline
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvconfigure.args --enable-framework=${frameworks_dir} \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv --enable-ipv6
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvuse_parallel_build no
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvpost-patch {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/Mac/Makefile.in ${worksrcpath}/Mac/IDLE/Makefile.in \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/Mac/Tools/Doc/setup.py \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/Mac/PythonLauncher/Makefile.in
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # See http://trac.macports.org/changeset/37861
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace "s|xargs -0 rm -r|/usr/bin/xargs -0 /bin/rm -r|g" \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/Mac/PythonLauncher/Makefile.in
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvbuild.target all
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvtest.run yes
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvtest.target test
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvdestroot.target frameworkinstall maninstall
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv# ensure that correct compiler is used
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvbuild.args-append MAKE="${build.cmd} CC=${configure.cc}"
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvdestroot.args-append MAKE="${destroot.cmd} CC=${configure.cc}"
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvselect.group python
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvselect.file ${filespath}/python[string map {. {}} ${branch}]
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvpost-destroot {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv set framewpath ${frameworks_dir}/Python.framework
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv set framewdir ${framewpath}/Versions/${branch}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv foreach dir { Headers Resources Python Versions/Current } {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv file delete ${destroot}${framewpath}/${dir}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ln -s ${framewdir}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # Without this, LINKFORSHARED is set to
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # (this becomes Python.framework/Versions/2.6/Python) which doesn't
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # quite work (see ticket #15099); instead specifically list the
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # full path to the proper Python framework file (which becomes
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # ${prefix}/Library/Frameworks/Python.framework/Versions/2.6/Python)
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # The framework version.plist isn't currently being installed so
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # we'll copy ours for now (see http://trac.macports.org/ticket/18773 and
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # http://bugs.python.org/issue4937)
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv xinstall -m 644 ${filespath}/version.plist \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${destroot}${framewdir}/Resources/version.plist
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvpost-activate {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ui_msg "\nTo fully complete your installation and make python $branch the default, please run
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv\n\tsudo port install python_select \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv\n\tsudo python_select $name\n"
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvplatform darwin {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv post-configure {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # See http://trac.macports.org/ticket/18376
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.ed"
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvplatform darwin 7 {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # there is no SystemStubs on 10.3
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv post-patch {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace "s|-lSystemStubs||g" ${worksrcpath}/configure \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/configure.in
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv post-configure {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace "s|-lSystemStubs||g" ${worksrcpath}/Makefile.pre.in \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/Makefile.pre ${worksrcpath}/Makefile
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv # To avoid GCC incompatibility issue. See http://nxg.me.uk/note/2004/restFP/ (by ebgssth at gmail.com, ticket #13322)
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv configure.ldflags-append "-lcc_dynamic"
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvplatform darwin 10 {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv configure.compiler gcc-4.2
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvvariant universal {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv post-patch {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv set universal_arch_flags {}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv set arch_run_32bit {}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv foreach arch ${universal_archs} {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv lappend universal_arch_flags -arch ${arch}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv if { ${arch}=="i386" || ${arch}=="ppc" } {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv lappend arch_run_32bit -${arch}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv "s|UNIVERSAL_ARCH_FLAGS=\".*\"|UNIVERSAL_ARCH_FLAGS=\"${universal_arch_flags}\"|" \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/configure
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv reinplace \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv ${worksrcpath}/configure
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv }
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv configure.args-append --enable-universalsdk=${universal_sysroot}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suvvariant ucs4 description {Enable support for UCS4} {
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv configure.args-append --enable-unicode=ucs4
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv}
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv#livecheck.check regex
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv#livecheck.url ${homepage}download/releases/
f7b499d11542a2d5f93ba2d3c7c268e6d6d045bb~suv#livecheck.regex Python (${branch}(?:\\.\\d+)*)