# -*- 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: Portfile 92096 2012-04-18 17:18:45Z pixilla@macports.org $

PortSystem          1.0
PortGroup           muniversal 1.0

name                ace
set name_package    ACE
version             6.1.1
distname            ${name_package}-${version}
categories          devel
maintainers         fourpalms.org:lockhart openmaintainer
platforms           darwin
license             BSD
description         ACE is an object-oriented framework that implements many core patterns for \
                    concurrent communication software.
long_description    The ADAPTIVE Communication Environment (ACE) is a freely available, \
                    open-source object-oriented (OO) framework that implements many core \
                    patterns for concurrent communication software. ACE provides a rich set \
                    of reusable C++ wrapper facades and framework components that perform \
                    common communication software tasks across a range of OS platforms. The \
                    communication software tasks provided by ACE include event \
                    demultiplexing and event handler dispatching, signal handling, service \
                    initialization, interprocess communication, shared memory management, \
                    message routing, dynamic (re)configuration of distributed services, \
                    concurrent execution and synchronization.

conflicts           tao

homepage            http://www.cs.wustl.edu/~schmidt/ACE.html
master_sites        http://download.dre.vanderbilt.edu/previous_versions

use_bzip2           yes

worksrcdir          ACE_wrappers

patch.pre_args      -p1
patchfiles          patch-ace-config.h.diff \
                    patch-include-makeinclude-platform_macros.GNU.diff

checksums           rmd160  096c33d8fd8c042742b4c3d9298905c4dbb38e7b \
                    sha256  8e3aeb2fe6ca5a9bbfb657ab7c00d60ec6226f06a0142ea37227cbf261cdaad7

set os.name "lion"
array set os.names {
     7  panther
     8  tiger
     9  leopard
    10  snowleopard
    11  lion
    12  mountainlion
}
if {"darwin" == ${os.platform}} {
    foreach {key value} [array get os.names]  {
        if {${key} == ${os.major}} {
            set os.name ${value}
        }
    }
}

post-patch {
    reinplace "s|@MACOSX@|${os.name}|g" \
        ${worksrcpath}/ace/config.h \
        ${worksrcpath}/include/makeinclude/platform_macros.GNU
}

use_configure       no

use_parallel_build  no

build.env-append    "DYLD_LIBRARY_PATH=${worksrcpath}/lib"
build.env-append    "ACE_ROOT=${worksrcpath}"
build.env-append    "INSTALL_PREFIX=${prefix}"

destroot.env-append "DYLD_LIBRARY_PATH=${worksrcpath}/lib"
destroot.env-append "ACE_ROOT=${worksrcpath}"
destroot.args-append "INSTALL_PREFIX=${prefix}"

livecheck.url       ${master_sites}
livecheck.regex     ${name_package}-(\\d+\[0-9a-z.\]*)${extract.suffix}
