[36462] branches/python-frameworks/dports/lang

raimue at macports.org raimue at macports.org
Fri May 2 20:01:10 PDT 2008


Revision: 36462
          http://trac.macosforge.org/projects/macports/changeset/36462
Author:   raimue at macports.org
Date:     2008-05-02 20:01:09 -0700 (Fri, 02 May 2008)

Log Message:
-----------
lang/python24, lang/python25:
Major changes to make the ports more similar. I hope I didn't miss some
changes.
This still does not contain any hook to make the transition easier, but these
ports are now very similar which makes them easier to maintain.

Modified Paths:
--------------
    branches/python-frameworks/dports/lang/python24/Portfile
    branches/python-frameworks/dports/lang/python25/Portfile

Modified: branches/python-frameworks/dports/lang/python24/Portfile
===================================================================
--- branches/python-frameworks/dports/lang/python24/Portfile	2008-05-03 00:27:21 UTC (rev 36461)
+++ branches/python-frameworks/dports/lang/python24/Portfile	2008-05-03 03:01:09 UTC (rev 36462)
@@ -2,137 +2,117 @@
 
 PortSystem 1.0
 
-name            python24
-version         2.4.4
-revision        4
-set major       2
-set branch      2.4
-categories      lang
-platforms       darwin freebsd linux
-maintainers     nomaintainer
-description     An interpreted, object-oriented programming language
-long_description    Python is an interpreted, interactive, object-oriented \
-                    programming language.
+name                    python24
+version                 2.4.4
+revision                4
+set major               2
+set branch              2.4
+categories              lang
+platforms               darwin
+maintainers             nomaintainer
 
-homepage        http://www.python.org/
-master_sites    ${homepage}/ftp/python/${version}/ \
-                ftp://ftp.python.org/pub/python/${version}/
-distname        Python-${version}
-checksums       md5 0ba90c79175c017101100ebf5978e906
-patchfiles      patch-configure \
-                patch-Makefile.pre.in \
-                patch-Lib-cgi.py \
-                patch-Lib-site.py \
-                patch-setup.py \
-                patch-Include-pyport.h \
-                patch-Mac-OSX-Makefile.in \
-                patch-Mac-OSX-IDLE-Makefile.in \
-                patch-Mac-OSX-PythonLauncher-Makefile.in
+description             An interpreted, object-oriented programming language
+long_description        Python is an interpreted, interactive, object-oriented \
+                        programming language.
 
-use_bzip2       yes
+homepage                http://www.python.org/
+master_sites            ${homepage}/ftp/python/${version}/ \
+                        ftp://ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.fastorama.com/mirrors/ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.python.jp/pub/python/${version}/
 
-depends_lib     port:gettext
+distname                Python-${version}
+use_bzip2               yes
 
-configure.args  --enable-shared \
-                --mandir=${prefix}/share/man \
-                --bindir=${prefix}/bin \
-                --libdir=${prefix}/lib \
-                --without-readline \
-                --enable-framework=${prefix}/Library/Frameworks \
-                --disable-tk \
-                --enable-ipv6
+checksums               md5 0ba90c79175c017101100ebf5978e906
 
+depends_lib             port:gettext
+
+patchfiles              patch-configure \
+                        patch-Makefile.pre.in \
+                        patch-Lib-cgi.py \
+                        patch-Lib-site.py \
+                        patch-setup.py \
+                        patch-Include-pyport.h \
+                        patch-Mac-OSX-Makefile.in \
+                        patch-Mac-OSX-IDLE-Makefile.in \
+                        patch-Mac-OSX-PythonLauncher-Makefile.in
+
+configure.args          --enable-shared \
+                        --enable-framework=${prefix}/Library/Frameworks \
+                        --mandir=${prefix}/share/man \
+                        --bindir=${prefix}/bin \
+                        --libdir=${prefix}/lib \
+                        --without-readline \
+                        --disable-tk \
+                        --enable-ipv6
+
+use_parallel_build      no
+
 post-patch {
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/site.py
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Mac/OSX/Makefile.in
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/site.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Mac/OSX/Makefile.in
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
 }
 
-build.target    all libpython${branch}.dylib
+build.target            all libpython${branch}.dylib
 
 # Workaround for case-sensitive file systems
 post-build {
     if { ![file exists ${worksrcpath}/python.exe] } {
-        ln -s python ${worksrcpath}/python.exe  
+        ln -s python ${worksrcpath}/python.exe
     }
 }
 
-test.run        yes
-test.target     test
+test.run                yes
+test.target             test
 
-destroot.target frameworkinstall maninstall
+destroot.target         frameworkinstall maninstall
+
 post-destroot {
-    if { [variant_isset macosx]} {
         set framewdir ${prefix}/Library/Frameworks/Python.framework
+
         xinstall -m 755 -d ${destroot}${framewdir}/Versions/${branch}/include
-       ln -s Versions/Current/lib ${destroot}${framewdir}/Libraries
-       ln -sf ${framewdir}/Versions/${branch}/bin/pydoc ${destroot}${prefix}/binpydoc
-       ln -sf ${framewdir}/Versions/${branch}/bin/pydoc ${destroot}${prefix}/binpydoc24
-       ln -s ${prefix}/lib/python${branch}/config ${destroot}${framewdir}/Versions/${branch}/lib/python${branch}/config
-       ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
-       ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${major}.dylib
-       ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython.dylib
-    } elseif { [variant_isset darwin]} {
-       ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
-       ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${major}.dylib
-       ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython.dylib
-    } else {
-        system "cd ${destroot}${prefix}/lib && \
-        ln -s libpython${branch}.so \
-            libpython${version}.so && \
-        ln -s libpython${branch}.so \
-            libpython${major}.so && \
-        ln -s libpython${branch}.so \
-            libpython.so"
-    }
-}
+        ln -s ${framewdir}/Versions/${branch}/bin/pydoc ${destroot}${prefix}/bin/pydoc[string map {. {}} ${branch}]
+        ln -s ${framewdir}/Versions/${branch}/lib/python${branch} ${destroot}${prefix}/lib/python${branch}
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${major}.dylib
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython.dylib
 
+        ln -s ${framewdir}/Versions/${branch}/include/python${branch} ${destroot}${prefix}/include/python${branch}
 
-# delete symlinks without version suffix, use python_select instead to choose version
-platform darwin {
-    post-destroot {
-        file delete ${destroot}${prefix}/bin/python
-        file delete ${destroot}${prefix}/bin/pythonw
-        file delete ${destroot}${prefix}/bin/idle
-        file delete ${destroot}${prefix}/bin/pydoc
-        file delete ${destroot}${prefix}/bin/smtpd.py
-        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}
+        }
+        ln -s ${framewdir}/Versions/${branch}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
+        file delete ${destroot}${prefix}/share/man/man1/python.1
 
+        foreach dir { Headers Resources Python Versions/Current } {
+            file delete ${destroot}${framewdir}/${dir}
+        }
+        ln -s Versions/Current/lib ${destroot}${framewdir}/Libraries
+
         # install select file for python_select
         xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
-        xinstall -m 644 ${filespath}/python24 ${destroot}${prefix}/etc/select/python/
-    }
+        xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
 }
 
-platform puredarwin {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-toolbox-glue --disable-framework
-    destroot.target     install maninstall
-}
-
 platform darwin 8 {
-    configure.args-append --with-cxx=/usr/bin/g++-4.0
+        # 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
+        configure.cppflags-append       -D__DARWIN_UNIX03
 }
 
-platform freebsd {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-framework
-    build.target        all libpython${branch}.so
-    destroot.target     install maninstall
-}
+# TODO: test if this universal variant actually works
+# variant universal {
+        # configure.args-append           --enable-universalsdk
+# }
 
-platform linux {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-framework
-    build.target        all libpython${branch}.so
-    destroot.target     install maninstall
-}
-
-livecheck.check regex
-livecheck.url   http://www.python.org/download/releases/
-livecheck.regex Python (${branch}.\[0-9\]+)
+livecheck.check         regex
+livecheck.url           ${homepage}download/releases/
+livecheck.regex         Python (${branch}.\[0-9\]+)

Modified: branches/python-frameworks/dports/lang/python25/Portfile
===================================================================
--- branches/python-frameworks/dports/lang/python25/Portfile	2008-05-03 00:27:21 UTC (rev 36461)
+++ branches/python-frameworks/dports/lang/python25/Portfile	2008-05-03 03:01:09 UTC (rev 36462)
@@ -5,16 +5,18 @@
 name                    python25
 version                 2.5.2
 revision                2
+set major               2
+set branch              2.5
 categories              lang
 platforms               darwin
-maintainers             mww
+maintainers             nomaintainer
 
 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/${version}/ \
                         ftp://ftp.python.org/pub/python/${version}/ \
                         ftp://ftp.fastorama.com/mirrors/ftp.python.org/pub/python/${version}/ \
                         ftp://ftp.python.jp/pub/python/${version}/
@@ -22,21 +24,27 @@
 distname                Python-${version}
 use_bzip2               yes
 
-checksums       md5 afb5451049eda91fbde10bd5a4b7fadc \
-                sha1 4755d212f50af704c20224a6966e23acc5aea60f \
-                rmd160 b23b02739833e6730799c5866e2b77aae884b63f
+checksums               md5 afb5451049eda91fbde10bd5a4b7fadc \
+                        sha1 4755d212f50af704c20224a6966e23acc5aea60f \
+                        rmd160 b23b02739833e6730799c5866e2b77aae884b63f
 
-depends_lib     port:gettext
+depends_lib             port:gettext
 
-patchfiles      patch-Makefile.pre.in.diff \
-                patch-setup.py.diff \
-                patch-Lib-cgi.py.diff
+patchfiles              patch-Makefile.pre.in.diff \
+                        patch-setup.py.diff \
+                        patch-Lib-cgi.py.diff
 
-configure.args  --enable-shared \
+configure.args          --enable-shared \
                         --enable-framework=${prefix}/Library/Frameworks \
+                        --mandir=${prefix}/share/man \
+                        --bindir=${prefix}/bin \
+                        --libdir=${prefix}/lib \
                         --without-readline \
+                        --disable-tk \
                         --enable-ipv6
 
+use_parallel_build      no
+
 post-patch {
         reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py
         reinplace "s|/Applications/MacPython|/Applications/MacPorts/MacPython|g" \
@@ -46,42 +54,62 @@
                 Mac/BuildScript/build-installer.py
 }
 
-test.run           yes
-test.target        test
+build.target            all libpython${branch}.dylib
 
-destroot.target libpython2.5.dylib frameworkinstall maninstall
+# TODO: From python24, do we still need this?
+# Workaround for case-sensitive file systems
+post-build {
+    if { ![file exists ${worksrcpath}/python.exe] } {
+        ln -s python ${worksrcpath}/python.exe
+    }
+}
 
+test.run                yes
+test.target             test
+
+destroot.target         frameworkinstall maninstall
+
 post-destroot {
-        system "cd ${destroot}${prefix}/bin && \
-                rm idle python pythonw pydoc python-config smtpd.py"
-        system "cd ${destroot}${prefix}/share/man/man1 && \
-                ln -sf ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/share/man/man1/python.1 python2.5.1"
+        set framewdir ${prefix}/Library/Frameworks/Python.framework
 
-        system "cd ${destroot}${prefix}/Library/Frameworks/Python.framework && \
-                rm -f Headers Resources Python && \
-                rm -f Versions/Current"
-        xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
-        xinstall -m 644 ${filespath}/python25 ${destroot}${prefix}/etc/select/python/
-        system "mkdir -p ${destroot}${prefix}/include && \
-                cd ${destroot}${prefix}/include && \
-                ln -sf ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5"
+        xinstall -m 755 -d ${destroot}${framewdir}/Versions/${branch}/include
+        ln -s ${framewdir}/Versions/${branch}/bin/pydoc ${destroot}${prefix}/bin/pydoc[string map {. {}} ${branch}]
+        ln -s ${framewdir}/Versions/${branch}/lib/python${branch} ${destroot}${prefix}/lib/python${branch}
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${major}.dylib
+        ln -s ${framewdir}/Versions/${branch}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib/libpython.dylib
 
-        system "cd ${destroot}${prefix}/lib && \
-                ln -sf ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/lib/libpython2.5.dylib && \
-                ln -sf ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5"
+        # ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
+        # ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython${major}.dylib
+        # ln -s libpython${branch}.dylib ${destroot}${prefix}/lib/libpython.dylib
 
-        system "cd ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.5/share/man/man1/ && \
-                gzip python.1"
+        ln -s ${framewdir}/Versions/${branch}/include/python${branch} ${destroot}${prefix}/include/python${branch}
 
+        # 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}
+        }
+        ln -s ${framewdir}/Versions/${branch}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
+        file delete ${destroot}${prefix}/share/man/man1/python.1
+
+        foreach dir { Headers Resources Python Versions/Current } {
+            file delete ${destroot}${framewdir}/${dir}
+        }
+        ln -s Versions/Current/lib ${destroot}${framewdir}/Libraries
+
+        # install select file for python_select
+        xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
+        xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
 }
 
+# TODO: better message, how to install python_select etc.
 post-activate {
-ui_msg "\n\n\nTo fully complete your installation and make python 2.5 the\ndefault, please run\n\nsudo python_select python25\n\n"
+        ui_msg "\n\n\nTo fully complete your installation and make python 2.5 the\ndefault, please run\n\nsudo python_select python25\n\n"
 }
 
 platform darwin 7 {
         # there is no SystemStubs on 10.3
-        post-patch { 
+        post-patch {
                 reinplace "s|-lSystemStubs||g" \
                         configure configure.in
         }
@@ -94,24 +122,18 @@
 }
 
 platform darwin 8 {
-        configure.args-append   --with-cxx=/usr/bin/g++-4.0
+        # 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
-        configure.args-append   --with-cxx=/usr/bin/g++-4.0
 }
 
 variant universal {
-    configure.args-append   --enable-universalsdk
+        configure.args-append           --enable-universalsdk
 }
 
-# for w/o quicktime sdk, etc. (be prepared for framework build, though)
-platform puredarwin {
-#       configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-        configure.args-append   --disable-toolbox-glue --disable-framework
-}
-
-livecheck.check regex
-livecheck.url   ${homepage}download/releases/
-livecheck.regex {Python (2\.5(?:\.\d+)*)}
+livecheck.check         regex
+livecheck.url           ${homepage}download/releases/
+livecheck.regex         Python (${branch}.\[0-9\]+)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080502/054e5a1f/attachment-0001.html


More information about the macports-changes mailing list