Revision: 74256 http://trac.macports.org/changeset/74256 Author: stromnov@macports.org Date: 2010-12-09 03:07:12 -0800 (Thu, 09 Dec 2010) Log Message: ----------- python27: fix whitespaces Modified Paths: -------------- trunk/dports/lang/python27/Portfile Modified: trunk/dports/lang/python27/Portfile =================================================================== --- trunk/dports/lang/python27/Portfile 2010-12-09 07:12:25 UTC (rev 74255) +++ trunk/dports/lang/python27/Portfile 2010-12-09 11:07:12 UTC (rev 74256) @@ -1,35 +1,36 @@ +# -*- 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 # $Id$ -PortSystem 1.0 -PortGroup select 1.0 +PortSystem 1.0 +PortGroup select 1.0 -name python27 -epoch 1 -version 2.7.1 +name python27 +epoch 1 +version 2.7.1 +revision 0 +set major [lindex [split $version .] 0] +set branch [join [lrange [split ${version} .] 0 1] .] +categories lang +platforms darwin -set major [lindex [split $version .] 0] -set branch [join [lrange [split ${version} .] 0 1] .] -#set branch 2.7 -categories lang -platforms darwin -maintainers jwa openmaintainer +maintainers jwa openmaintainer -description An interpreted, object-oriented programming language -long_description Python is an interpreted, interactive, object-oriented \ - programming language. +description An interpreted, object-oriented programming language +long_description Python is an interpreted, interactive, object-oriented \ + programming language. notes "\ - To fully complete your installation and make python ${branch} the default, \ - please run:\n \ - \tsudo port install python_select\n \ - \tsudo python_select ${name}" + To fully complete your installation and make python ${branch} the default, \ + please run:\n \ + \tsudo port install python_select\n \ + \tsudo python_select ${name}" -homepage http://www.python.org/ -master_sites ${homepage}/ftp/python/${version}/ \ - ftp://ftp.python.org/pub/python/${version}/ +homepage http://www.python.org/ +master_sites ${homepage}/ftp/python/${version}/ \ + ftp://ftp.python.org/pub/python/${version}/ -distname Python-${version} -use_bzip2 yes +distname Python-${version} +use_bzip2 yes checksums md5 aa27bc25725137ba155910bd8e5ddc4f \ sha1 fbe1894322ff91b80726e269c97454f4129fc2a3 \ @@ -42,139 +43,145 @@ # is to work around http://bugs.python.org/issue5766 # patch-readlinefix.diff comes from # <http://bugs.python.org/issue5833> -patchfiles \ - patch-Makefile.pre.in.diff \ - patch-setup.py.diff \ - patch-Lib-cgi.py.diff \ - patch-Lib-ctypes-macholib-dyld.py.diff +patchfiles patch-Makefile.pre.in.diff \ + patch-setup.py.diff \ + patch-Lib-cgi.py.diff \ + patch-Lib-ctypes-macholib-dyld.py.diff +# patch-Mac-PythonLauncher-Makefile.in.diff +# patch-Mac-Makefile.in.diff +# patch-Mac-IDLE-Makefile.in.diff +# patch-Mac-Tools-Doc-setup.py.diff +# patch-readlinefix.diff +# patch-Lib-distutils-dist.py.diff -# patch-Mac-PythonLauncher-Makefile.in.diff \ -# patch-Mac-Makefile.in.diff \ -# patch-Mac-IDLE-Makefile.in.diff \ -# patch-Mac-Tools-Doc-setup.py.diff -# patch-readlinefix.diff -# patch-Lib-distutils-dist.py.diff +depends_lib port:gettext \ + port:zlib \ + port:openssl \ + port:tk \ + port:sqlite3 \ + port:db46 \ + port:ncurses \ + port:gdbm \ + port:bzip2 \ + port:readline -depends_lib port:gettext port:zlib port:openssl port:tk \ - port:sqlite3 port:db46 port:ncurses port:gdbm \ - port:bzip2 port:readline +configure.args --enable-framework=${frameworks_dir} \ + --enable-ipv6 -configure.args --enable-framework=${frameworks_dir} \ - --enable-ipv6 -configure.ccache no +configure.ccache no configure.cppflags-append -I${prefix}/include/ncurses post-patch { - reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Lib/cgi.py \ - ${worksrcpath}/Lib/ctypes/macholib/dyld.py - reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \ - ${worksrcpath}/Mac/Makefile.in ${worksrcpath}/Mac/IDLE/Makefile.in \ - ${worksrcpath}/Mac/PythonLauncher/Makefile.in + reinplace "s|@@PREFIX@@|${prefix}|g" \ + ${worksrcpath}/Lib/cgi.py \ + ${worksrcpath}/Lib/ctypes/macholib/dyld.py + reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|g" \ + ${worksrcpath}/Mac/Makefile.in \ + ${worksrcpath}/Mac/IDLE/Makefile.in \ + ${worksrcpath}/Mac/PythonLauncher/Makefile.in +# ${worksrcpath}/Mac/Tools/Doc/setup.py -# ${worksrcpath}/Mac/Tools/Doc/setup.py + # 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 - # 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 - - # http://trac.macports.org/ticket/21517 + # http://trac.macports.org/ticket/21517 # system "cd ${worksrcpath} && ed - Modules/_localemodule.c < ${filespath}/_localemodule.c.ed" # system "cd ${worksrcpath} && ed - Lib/locale.py < ${filespath}/locale.py.ed" - if {${os.platform} == "darwin" && ${os.major} > 9} { -# # http://trac.macports.org/ticket/21559 - system "cd ${worksrcpath} && ed - Modules/posixmodule.c < ${filespath}/posixmodule.c.ed" - } + if {${os.platform} == "darwin" && ${os.major} > 9} { + # http://trac.macports.org/ticket/21559 + system "cd ${worksrcpath} && ed - Modules/posixmodule.c < ${filespath}/posixmodule.c.ed" + } } -build.target all +build.target all -test.run yes -test.target test +test.run yes +test.target test -destroot.target frameworkinstall maninstall +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}" +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}] +select.group python +select.file ${filespath}/python[string map {. {}} ${branch}] post-destroot { - set framewpath ${frameworks_dir}/Python.framework - set framewdir ${framewpath}/Versions/${branch} + set framewpath ${frameworks_dir}/Python.framework + set framewdir ${framewpath}/Versions/${branch} - foreach dir { Headers Resources Python Versions/Current } { - file delete ${destroot}${framewpath}/${dir} - } + foreach dir { Headers Resources Python Versions/Current } { + file delete ${destroot}${framewpath}/${dir} + } - ln -s ${framewdir}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1 - ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib + ln -s ${framewdir}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1 + ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib # ln -s ${framewdir}/bin/2to3 ${destroot}${prefix}/bin/2to3-${branch} - # Without this, LINKFORSHARED is set to - # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) - # (this becomes Python.framework/Versions/2.6/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/2.6/Python) - reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${framewdir}/lib/python${branch}/config/Makefile + # Without this, LINKFORSHARED is set to + # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) + # (this becomes Python.framework/Versions/2.6/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/2.6/Python) + reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} \ + ${destroot}${framewdir}/lib/python${branch}/config/Makefile - foreach unversionedFile {idle pydoc python python-config pythonw smtpd.py} { - delete ${destroot}${prefix}/bin/${unversionedFile} - } + foreach unversionedFile {idle pydoc python python-config pythonw smtpd.py} { + delete ${destroot}${prefix}/bin/${unversionedFile} + } - # remove -arch flags from the config - reinplace -E {s|-arch [^[:space:]]+||g} \ - ${destroot}${framewdir}/lib/python${branch}/config/Makefile + # remove -arch flags from the config + reinplace -E {s|-arch [^[:space:]]+||g} \ + ${destroot}${framewdir}/lib/python${branch}/config/Makefile } platform darwin { - post-configure { - # See http://trac.macports.org/ticket/18376 - system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.ed" - } + 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 {${os.major} >= 9} { - reinplace \ - "s|ARCH_RUN_32BIT=\".*\"|ARCH_RUN_32BIT=\"arch ${arch_run_32bit}\"|" \ + 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 {${configure.sdkroot} != ""} { - configure.args-append --enable-universalsdk=${configure.sdkroot} - } else { - configure.args-append --enable-universalsdk=/ - } + if {${os.major} >= 9} { + 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 {Enable support for UCS4} { - configure.args-append --enable-unicode=ucs4 + configure.args-append --enable-unicode=ucs4 } variant no_tkinter description {Disable Tkinter support, which will break IDLE} { - patchfiles-append patch-setup_no_tkinter.py.diff - depends_lib-delete port:tk + 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+)*) -