# $Id: Portfile 40886 2008-10-17 06:41:01Z blb@macports.org $ PortSystem 1.0 name python26 version 2.6 revision 1 set major [lindex [split $version .] 0] set branch [join [lrange [split ${version} .] 0 1] .] categories lang platforms darwin maintainers blb 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}/ \ ftp://ftp.python.org/pub/python/${version}/ # ftp.python.jp works, but no 2.6 as of 2008-10-05 # ftp://ftp.python.jp/ftp.python.org/python/${version}/ distname Python-${version} extract.suffix .tgz checksums md5 d16d29a77db2cd3af882a591f431a403 \ sha1 d7fd08304b66cb4020786a7ee5aa452235046ecd \ rmd160 b44d5cc7efa198b21f41e43e1d28af60875f0a4e # Can be removed once MacPorts 1.7.0 is released if {![info exists applications_dir]} { set applications_dir /Applications/MacPorts } if {![info exists frameworks_dir]} { set frameworks_dir ${prefix}/Library/Frameworks } patchfiles patch-setup.py.diff \ patch-Lib-cgi.py.diff \ patch-Mac-IDLE-Makefile.in.diff \ patch-Mac-Makefile.in.diff \ patch-Mac-PythonLauncher-Makefile.in.diff \ patch-Mac-Tools-Doc-setup.py.diff depends_lib port:gettext configure.args --enable-shared \ --enable-framework=${frameworks_dir} \ --mandir=${prefix}/share/man \ --without-readline \ --disable-tk \ --enable-ipv6 use_parallel_build no post-patch { reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \ ${worksrcpath}/Mac/Makefile.in ${worksrcpath}/Mac/IDLE/Makefile.in \ ${worksrcpath}/Mac/Tools/Doc/setup.py \ ${worksrcpath}/Mac/PythonLauncher/Makefile.in reinplace "s|xargs -0 rm -r|xargs -0 rm -rf|g" \ ${worksrcpath}/Mac/PythonLauncher/Makefile.in } build.target all test.run yes test.target test destroot.target frameworkinstall maninstall post-destroot { 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} } ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1 # 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}/${name} ${destroot}${prefix}/etc/select/python/ } 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 7 { # there is no SystemStubs on 10.3 post-patch { reinplace "s|-lSystemStubs||g" ${worksrcpath}/configure \ ${worksrcpath}/configure.in } post-configure { reinplace "s|-lSystemStubs||g" ${worksrcpath}/Makefile.pre.in \ ${worksrcpath}/Makefile.pre ${worksrcpath}/Makefile } # To avoid GCC incompatibility issue. See http://nxg.me.uk/note/2004/restFP/ (by ebgssth at gmail.com, ticket #13322) configure.ldflags-append "-lcc_dynamic" } platform darwin 8 { # TODO: would configure.compiler be more appropriate? configure.args-append --with-cxx=/usr/bin/g++-4.0 } platform darwin 9 { configure.cppflags-append -D__DARWIN_UNIX03 } platform darwin 10 { configure.compiler gcc-4.2 } variant universal { configure.args-append --enable-universalsdk } livecheck.check regex livecheck.url ${homepage}download/releases/ livecheck.regex Python (${branch}.\[0-9\]+)