117724f21a94ff32f773af4c37be88fe0d2970e3~suv# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# $Id: Portfile 104926 2013-04-05 04:43:09Z larryv@macports.org $
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvPortSystem 1.0
117724f21a94ff32f773af4c37be88fe0d2970e3~suvPortGroup select 1.0
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvname python25
117724f21a94ff32f773af4c37be88fe0d2970e3~suvversion 2.5.6
117724f21a94ff32f773af4c37be88fe0d2970e3~suvrevision 100
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvset branch [join [lrange [split ${version} .] 0 1] .]
117724f21a94ff32f773af4c37be88fe0d2970e3~suvcategories lang
117724f21a94ff32f773af4c37be88fe0d2970e3~suvlicense PSF
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatforms darwin
117724f21a94ff32f773af4c37be88fe0d2970e3~suvmaintainers nomaintainer
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdescription An interpreted, object-oriented programming language
117724f21a94ff32f773af4c37be88fe0d2970e3~suvlong_description Python is an interpreted, interactive, object-oriented \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv programming language.
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvhomepage http://www.python.org/
117724f21a94ff32f773af4c37be88fe0d2970e3~suvmaster_sites http://ftp.python.org/ftp/python/${version}/
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdistname Python-${version}
117724f21a94ff32f773af4c37be88fe0d2970e3~suvuse_bzip2 yes
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvchecksums md5 5d45979c5f30fb2dd5f067c6b06b88e4 \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv sha1 29f6dd41bf09c5e04311b367cbb7604fa016e699 \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv rmd160 92f0a955971f187a7d50c6422168202ec551bf22
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# patch-Lib-distutils-dist.py.diff comes from
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# <http://bugs.python.org/issue1180>
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpatchfiles patch-Makefile.pre.in.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-Lib-cgi.py.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-Lib-distutils-dist.py.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-setup.py.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-configure.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-64bit.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-setup.py-disabled_modules.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-mac_ver.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-libedit.diff \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patch-fwrapv.diff
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdepends_lib port:gettext port:zlib port:openssl \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv port:sqlite3 port:db46 port:bzip2 \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv port:libedit port:ncurses
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdepends_run port:python_select
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvconfigure.args --enable-shared \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv --enable-framework=${frameworks_dir} \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv --mandir=${prefix}/share/man \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv --enable-ipv6 \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv --with-cxx=${configure.cxx}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpost-patch {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/setup.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|/Applications/MacPython|${applications_dir}/MacPython|g" \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/Makefile.in \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/IDLE/Makefile.in \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/Tools/Doc/setup.py \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/PythonLauncher/Makefile.in \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/BuildScript/build-installer.py
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|xargs -0 rm -r|xargs -0 rm -rf|g" \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Mac/PythonLauncher/Makefile.in
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|__BUILD_ARCH__|${build_arch}|" ${worksrcpath}/configure
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|__UNIVERSAL_CFLAGS__|${configure.universal_cflags}|" ${worksrcpath}/configure
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace "s|__UNIVERSAL_LDFLAGS__|${configure.universal_ldflags}|" \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/configure \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${worksrcpath}/Makefile.pre.in
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # http://trac.macports.org/ticket/21517
117724f21a94ff32f773af4c37be88fe0d2970e3~suv system -W ${worksrcpath} "ed - Modules/_localemodule.c < ${filespath}/_localemodule.c.ed"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv system -W ${worksrcpath} "ed - Lib/locale.py < ${filespath}/locale.py.ed"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvbuild.target all
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# TODO: From python24, do we still need this?
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# Workaround for case-sensitive file systems
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpost-build {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if { ![file exists ${worksrcpath}/python.exe] } {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s python ${worksrcpath}/python.exe
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvtest.run yes
117724f21a94ff32f773af4c37be88fe0d2970e3~suvtest.target test
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdestroot.target frameworkinstall maninstall
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv# ensure that correct compiler is used
117724f21a94ff32f773af4c37be88fe0d2970e3~suvbuild.args-append MAKE="${build.cmd}" CC="${configure.cc}"
117724f21a94ff32f773af4c37be88fe0d2970e3~suvdestroot.args-append MAKE="${destroot.cmd}" CC="${configure.cc}"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvselect.group python
117724f21a94ff32f773af4c37be88fe0d2970e3~suvselect.file ${filespath}/python[string map {. {}} ${branch}]
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvnotes "
117724f21a94ff32f773af4c37be88fe0d2970e3~suvTo make python ${branch} the default (i.e. the version you get when you run\
117724f21a94ff32f773af4c37be88fe0d2970e3~suv'python'), please run:
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvsudo port select --set ${select.group} [file tail ${select.file}]
117724f21a94ff32f773af4c37be88fe0d2970e3~suv"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatform macosx {
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpost-destroot {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv set framewpath ${frameworks_dir}/Python.framework
117724f21a94ff32f773af4c37be88fe0d2970e3~suv set framewdir ${framewpath}/Versions/${branch}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # Without this, LINKFORSHARED is set to
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # (this becomes Python.framework/Versions/2.5/Python) which doesn't
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # quite work (see ticket #15099); instead specifically list the
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # full path to the proper Python framework file (which becomes
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Python)
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv foreach dir { lib include } {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s ${prefix}/share ${destroot}${framewdir}/share
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # delete symlinks without version suffix, use python_select instead to choose version
117724f21a94ff32f773af4c37be88fe0d2970e3~suv foreach bin { python pythonw idle pydoc smtpd.py python-config } {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file delete ${destroot}${prefix}/bin/${bin}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py python${branch}-config] {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv foreach dir { Headers Resources Python Versions/Current } {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file delete ${destroot}${framewpath}/${dir}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # Fix incorrectly-pointed libpython2.5.a symlink, see
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # http://trac.macports.org/ticket/19906
117724f21a94ff32f773af4c37be88fe0d2970e3~suv set python_staticlink ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file delete ${python_staticlink}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ln -s ${framewdir}/Python ${python_staticlink}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatform darwin {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv post-configure {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # See http://trac.macports.org/ticket/18376
117724f21a94ff32f773af4c37be88fe0d2970e3~suv system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.ed"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if {${os.major} >= 10} {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.cppflags-append -D_DARWIN_C_SOURCE
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patchfiles-append patch-pyconfig.h.in.diff
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv post-patch {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if {![file exists /usr/lib/libSystemStubs.a]} {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace s/-lSystemStubs//g ${worksrcpath}/configure
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv post-destroot {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # remove -arch flags from the config
117724f21a94ff32f773af4c37be88fe0d2970e3~suv reinplace -E {s|-arch [a-z0-9_]+||g} \
117724f21a94ff32f773af4c37be88fe0d2970e3~suv ${destroot}${prefix}/lib/python${branch}/config/Makefile
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatform darwin 8 {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patchfiles-append patch-FSIORefNum.diff
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatform darwin 9 {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.cppflags-append -D__DARWIN_UNIX03
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvplatform puredarwin {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv patchfiles-append patch-Modules-posixmodule.c.diff
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.args-delete --enable-framework=${frameworks_dir}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.args-append --disable-toolbox-glue --disable-framework
117724f21a94ff32f773af4c37be88fe0d2970e3~suv destroot.target install maninstall
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpost-build {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # thin dynamic library to have the same arch as static lib, even after -lSystemStubs
117724f21a94ff32f773af4c37be88fe0d2970e3~suv system "lipo ${worksrcpath}/libpython${branch}.dylib -output ${worksrcpath}/libpython${branch}.dylib -thin `lipo -info ${worksrcpath}/libpython${branch}.a | tail -n 1 | sed -e 's/.*architecture: \\(.*\\)/\\1/'`"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvpost-destroot {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv # delete symlinks without version suffix, use python_select instead to choose version
117724f21a94ff32f773af4c37be88fe0d2970e3~suv foreach bin { python pythonw idle pydoc smtpd.py python-config } {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file delete ${destroot}${prefix}/bin/${bin}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suv file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvvariant universal {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv if {${configure.sdkroot} == ""} {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.args-append --enable-universalsdk=/
117724f21a94ff32f773af4c37be88fe0d2970e3~suv } else {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv configure.args-append --enable-universalsdk=${configure.sdkroot}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv post-configure {
117724f21a94ff32f773af4c37be88fe0d2970e3~suv system -W ${worksrcpath} "ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
117724f21a94ff32f773af4c37be88fe0d2970e3~suv }
117724f21a94ff32f773af4c37be88fe0d2970e3~suv}
117724f21a94ff32f773af4c37be88fe0d2970e3~suv
117724f21a94ff32f773af4c37be88fe0d2970e3~suvlivecheck.type regex
117724f21a94ff32f773af4c37be88fe0d2970e3~suvlivecheck.url ${homepage}download/releases/
117724f21a94ff32f773af4c37be88fe0d2970e3~suvlivecheck.regex Python (${branch}.\[0-9\]+)