Ticket #34667: Portfile-cleanup.diff

File Portfile-cleanup.diff, 5.7 KB (added by lockhart (Thomas Lockhart), 12 years ago)

Patch to clean up the current Portfile. Includes substitution of configure.universal_cxxflags for +universal variant. This latest version uses configure.universal_ldflags for LDFLAGS. Duh.

  • Portfile

    old new  
    11# -*- 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
    2 # $Id: Portfile 93517 2012-05-25 14:24:34Z pixilla@macports.org $
     2# $Id: Portfile 93489 2012-05-24 05:19:35Z ryandesign@macports.org $
    33
    44# MacPorts specification for the TAO CORBA package.
    55# Includes ACE even though the ace port is available
     
    1010
    1111PortSystem          1.0
    1212
    13 # Disable the full universal support since TAO already does most of this
    14 # and the extra stuff in muniversal (including making two build trees
    15 # and using libtool to merge libraries) does not work for this case.
    16 # PortGroup           muniversal 1.0
    17 
    1813name                tao
    1914set name_package    ACE+TAO
    2015version             6.1.2
    21 revision            1
     16revision            2
    2217distname            ${name_package}-${version}
    2318categories          devel
    2419platforms           darwin
     
    4035                    ftp://download.dre.vanderbilt.edu/previous_versions
    4136
    4237universal_variant   yes
    43 
    44 variant ssl description {Enable SSL} {
    45         depends_lib port:openssl
    46 }
     38default_variants    +server
    4739
    4840use_bzip2           yes
    4941
     
    7062        set os.name ${value}
    7163    }
    7264}
     65
    7366set libenv          DYLD_LIBRARY_PATH=${worksrcpath}/lib
    7467set aceenv          ACE_ROOT=${worksrcpath}
    7568set taoenv          TAO_ROOT=${worksrcpath}/TAO
     
    9285    reinplace "s|@MACOSX@|${os.name}|g" \
    9386        ${worksrcpath}/ace/config.h \
    9487        ${worksrcpath}/include/makeinclude/platform_macros.GNU
    95     # disable the assignment for compilers in lion and use our environment instead
     88    # Disable the assignment for compilers in lion and use our environment instead
     89    ui_info "patching platform_macosx_lion.GNU"
    9690    reinplace "s|^\\(CXX:=.*\\)|# \\1|g" \
    9791        ${worksrcpath}/include/makeinclude/platform_macosx_lion.GNU
    9892    reinplace "s|^\\(CC:=.*\\)|# \\1|g" \
    9993        ${worksrcpath}/include/makeinclude/platform_macosx_lion.GNU
     94}
    10095
    101     if {[variant_exists universal] && [variant_isset universal]} {
    102         ui_debug "Enabling a universal build"
     96depends_lib-append  path:bin/perl:perl5 \
     97                    port:tcl \
     98                    port:zlib
     99
     100proc setuniversalflags {fname cxxflags ldflags} {
     101    set apat "-arch \[ \]*\[a-z\]\[_a-z0-9\]*"
     102    if {[file exists ${fname}]} {
     103        reinplace "s|^\\(\[ \]*FLAGS_C_CC\[ \]*+=\[ \]*\\)${apat}\\(\[ \]*${apat}\\)*|\\1${cxxflags}|g" \
     104            ${fname}
     105        reinplace "s|^\\(\[ \]*LDFLAGS\[ \]*+=\[ \]*\\)${apat}\\(\[ \]*${apat}\\)*|\\1${ldflags}|g" \
     106            ${fname}
     107    } else {
     108        ui_warn "File ${fname} not found for patching"
     109    }
     110}
     111
     112variant universal {
     113    post-patch {
     114        ui_info "patching platform_macros.GNU"
    103115        reinplace "s|buildbits=64|buildbits=universal|g" \
    104116            ${worksrcpath}/include/makeinclude/platform_macros.GNU
    105         # do not set universal=1 which tries i386 and PPC but fails
    106         reinplace "s|universal=0|universal=0|g" \
    107             ${worksrcpath}/include/makeinclude/platform_macros.GNU
     117        setuniversalflags ${worksrcpath}/include/makeinclude/platform_macosx_${os.name}.GNU \
     118            ${configure.universal_cxxflags} ${configure.universal_ldflags}
    108119    }
     120}
     121
     122variant ssl description {Enable SSL} {
     123    depends_lib-append port:openssl
    109124
    110     if {[variant_exists ssl] && [variant_isset ssl]} {
    111         ui_debug "Enabling SSL"
     125    post-patch {
    112126        reinplace "s|ssl=0|ssl=1|g" \
    113127            ${worksrcpath}/include/makeinclude/platform_macros.GNU
    114128    }
    115 
    116     reinplace "s|@PREFIX@|${prefix}|g" \
    117         ${worksrcpath}/org.macports.${taodaemon}.plist
    118     reinplace "s|@USER@|${taouser}|g" \
    119         ${worksrcpath}/org.macports.${taodaemon}.plist
    120     reinplace "s|@DAEMON@|${taodaemon}|g" \
    121         ${worksrcpath}/org.macports.${taodaemon}.plist
    122129}
    123130
    124 depends_lib         path:bin/perl:perl5 \
    125                     port:tcl \
    126                     port:zlib
     131variant server description {Enable CosNaming server} {
     132    post-patch {
     133        ui_info "patching org.macports.${taodaemon}.plist"
     134        reinplace "s|@PREFIX@|${prefix}|g" \
     135            ${worksrcpath}/org.macports.${taodaemon}.plist
     136        reinplace "s|@USER@|${taouser}|g" \
     137            ${worksrcpath}/org.macports.${taodaemon}.plist
     138        reinplace "s|@DAEMON@|${taodaemon}|g" \
     139            ${worksrcpath}/org.macports.${taodaemon}.plist
     140    }
     141
     142    pre-install {
     143        delete ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/org.macports.${taodaemon}.plist
     144        delete ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/${taodaemon}.wrapper
     145        copy ${worksrcpath}/org.macports.${taodaemon}.plist \
     146            ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/org.macports.${taodaemon}.plist
     147    }
     148
     149    startupitem.create  yes
     150    startupitem.name    ${taodaemon}
     151}
    127152
    128153use_configure       no
    129154
     
    153178    # Files required to build CosEvent classes but not installed
    154179    copy ${worksrcpath}/TAO/orbsvcs/orbsvcs/ESF ${destroot}/${prefix}/include/orbsvcs/ESF
    155180}
    156 pre-install {
    157     delete ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/org.macports.${taodaemon}.plist
    158     delete ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/${taodaemon}.wrapper
    159     copy ${worksrcpath}/org.macports.${taodaemon}.plist \
    160         ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${taodaemon}/org.macports.${taodaemon}.plist
    161 }
    162 startupitem.create  yes
    163 startupitem.name    ${taodaemon}
    164181
    165182livecheck.type      regex
    166183livecheck.url       ${master_sites}