Ticket #25557: python24.diff

File python24.diff, 7.4 KB (added by danchr (Dan Villiom Podlaski Christiansen), 14 years ago)
  • _resources/port1.0/group/python24-1.0.tcl

    old new  
    4646depends_lib             port:python24
    4747
    4848use_configure   no
     49supported_archs         i386 ppc
    4950
    5051build.cmd               ${python.bin} setup.py
    5152build.target    build
  • lang/python24/Portfile

    old new  
    55
    66name                    python24
    77version                 2.4.6
    8 revision                7
     8revision                8
    99set major               [lindex [split $version .] 0]
    1010set branch              [join [lrange [split ${version} .] 0 1] .]
    1111categories              lang
     
    4343
    4444depends_lib             port:gettext port:openssl
    4545
    46 configure.args          --with-cxx=${configure.cxx} \
     46supported_archs         i386 ppc
     47configure.universal_archs i386 ppc
     48
     49configure.args          --with-gcc="${configure.cc} ${configure.cc_archflags}" \
     50                        --with-cxx="${configure.cxx} ${configure.cxx_archflags}" \
    4751                        --enable-shared \
    4852                        --enable-framework=${frameworks_dir} \
    4953                        --mandir=${prefix}/share/man \
     
    8286select.file             ${filespath}/python[string map {. {}} ${branch}]
    8387
    8488platform macosx {
    85     if {(![variant_isset universal] && ![string match *64* $build_arch]) || ([variant_isset universal] && ![string match *64* $universal_archs])} {
    86         post-destroot {
    87             set framewpath ${frameworks_dir}/Python.framework
    88             set framewdir  ${framewpath}/Versions/${branch}
    89    
    90             foreach dir { lib include } {
    91                 file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
    92                 ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
    93             }
    94             # Since the lib/python${branch} dir was just moved above and
    95             # libpython2.4.a in lib/python${branch}/config is relative, we need
    96             # to repoint it here
    97             file delete ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
    98             ln -s ${framewdir}/Python ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
    99    
    100             ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
    101    
    102             file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
    103    
    104             # delete symlinks without version suffix, use python_select instead to choose version
    105             foreach bin { python pythonw idle pydoc smtpd.py } {
    106                 file delete ${destroot}${prefix}/bin/${bin}
    107             }
    108             foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py] {
    109                 file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
    110                 ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
    111             }
    112    
    113             foreach dir { Headers Resources Python Versions/Current } {
    114                 file delete ${destroot}${framewpath}/${dir}
    115             }
    116    
    117             # Without this, LINKFORSHARED is set to
    118             # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
    119             # (this becomes Python.framework/Versions/2.4/Python) which doesn't
    120             # quite work (see ticket #15099); instead specifically list the
    121             # full path to the proper Python framework file (which becomes
    122             # ${prefix}/Library/Frameworks/Python.framework/Versions/2.4/Python)
    123             reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${prefix}/lib/python${branch}/config/Makefile
     89    post-destroot {
     90        set framewpath ${frameworks_dir}/Python.framework
     91        set framewdir  ${framewpath}/Versions/${branch}
     92   
     93        foreach dir { lib include } {
     94            file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
     95            ln -s ${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
     96        }
     97        # Since the lib/python${branch} dir was just moved above and
     98        # libpython2.4.a in lib/python${branch}/config is relative, we need
     99        # to repoint it here
     100        file delete ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
     101        ln -s ${framewdir}/Python ${destroot}${prefix}/lib/python${branch}/config/libpython${branch}.a
     102   
     103        ln -s ${framewdir}/Python ${destroot}${prefix}/lib/libpython${branch}.dylib
     104   
     105        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
     106   
     107        # delete symlinks without version suffix, use python_select instead to choose version
     108        foreach bin { python pythonw idle pydoc smtpd.py } {
     109            file delete ${destroot}${prefix}/bin/${bin}
    124110        }
    125     } else {
    126         # 64-bit, can't build mac-specific stuff
    127         configure.args-delete --enable-framework=${frameworks_dir}
    128         configure.args-append --disable-toolbox-glue
    129         destroot.target       install maninstall
    130 
    131         post-destroot {
    132             # delete symlinks without version suffix, use python_select instead to choose version
    133             foreach bin { python pythonw idle pydoc smtpd.py python-config } {
    134                 file delete ${destroot}${prefix}/bin/${bin}
    135             }
    136    
    137             file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
    138    
    139             # install select file for python_select
    140             xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
    141             xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
     111        foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py] {
     112            file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
     113            ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
    142114        }
     115   
     116        foreach dir { Headers Resources Python Versions/Current } {
     117            file delete ${destroot}${framewpath}/${dir}
     118        }
     119   
     120        # Without this, LINKFORSHARED is set to
     121        # ... $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
     122        # (this becomes Python.framework/Versions/2.4/Python) which doesn't
     123        # quite work (see ticket #15099); instead specifically list the
     124        # full path to the proper Python framework file (which becomes
     125        # ${prefix}/Library/Frameworks/Python.framework/Versions/2.4/Python)
     126        reinplace {s|^\(LINKFORSHARED=.*\)$(PYTHONFRAMEWORKDIR).*$|\1 $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)|} ${destroot}${prefix}/lib/python${branch}/config/Makefile
    143127    }
    144128}
    145129
     
    190174}
    191175
    192176variant universal {
     177   configure.args-delete \
     178      --with-gcc="${configure.cc} ${configure.cc_archflags}" \
     179      --with-cxx="${configure.cxx} ${configure.cxx_archflags}"
     180   configure.args-append \
     181      --with-gcc="${configure.cc}" \
     182      --with-cxx="${configure.cxx}"
     183
    193184   if {${configure.sdkroot} != ""} {
    194185      configure.args-append   --enable-universalsdk=${configure.sdkroot}
    195186   } else {