# -*- 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           conflicts_build 1.0

name                omniORB
version             4.2.0
revision            1
categories          devel
platforms           darwin
universal_variant   no
# executables are GPL, libs are LGPL
license             {LGPL GPL-2+}
maintainers         nomaintainer

description         high performance CORBA ORB for C++
long_description    omniORB is a robust high performance CORBA ORB for C++ and \
                    Python. omniORB is largely CORBA 2.6 compliant.
homepage            http://omniorb.sourceforge.net/

conflicts_build     ${name}
depends_lib         port:python27

master_sites        sourceforge:project/omniorb/omniORB/omniORB-${version}/
use_bzip2           yes
checksums           rmd160  0f9c18c95df9718d3a3b960cf24e1732a851a23d \
                    sha256  74c273fc997c2881b128feb52182dbe067acfecc4cf37475f43c104338eba8bc

patchfiles          patch-configure.diff \
                    patch-mk-beforeauto.mk.in.diff \
                    src_tool_omniidl_cxx_cccp_config-darwin.h.diff
post-patch {
    reinplace "s|\\(\$(CXXLINKOPTIONS)\\)|\\1 [get_canonical_archflags cxx]|g" \
        ${worksrcpath}/mk/beforeauto.mk.in
}

configure.python    ${prefix}/bin/python2.7
configure.args      CC="${configure.cc}" \
                    CXX="${configure.cxx}" \
                    CCFLAGS="[get_canonical_archflags cc]" \
                    EXTRA_GCC_CXXFLAGS="[get_canonical_archflags cxx]" \
                    --with-omniORB-config="${prefix}/etc/omniORB.cfg" \
                    --with-omniNames-logdir="${prefix}/var"

if {${build_arch} eq "x86_64" && ${os.platform} eq "darwin"} {
    configure.args-append --build=${build_arch}-apple-${os.platform}${os.version}
}

variant ssl description {Enable SSL support} {
    configure.args-append   --with-openssl
    depends_lib-append      path:lib/libssl.dylib:openssl
}

notes "
Install py27-omniORBpy for omniORBpy.
"

livecheck.type      regex
livecheck.url       http://omniorb.sourceforge.net/
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"