# -*- 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 108171 2013-07-15 06:40:00Z devans@macports.org $

PortSystem      1.0

name            orbit
set gname       ORBit
version         0.5.17
revision        4
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      devel
license         {GPL-2+ LGPL}
maintainers     nomaintainer
description     High-performance CORBA ORB with C lang support
long_description \
                ORBit is a high-performance CORBA ORB with support for the C \
                language. It allows programs to send requests and receive replies \
                from other programs, regardless of the locations of the two \
                programs.
homepage        http://orbit-resource.sourceforge.net/
master_sites    gnome:sources/${gname}/${branch}/
platforms       darwin

use_bzip2       yes
checksums       md5 35acc6f8d49d930b566104fcceb893d3

distname        ${gname}-${version}

patchfiles      patch-configure patch-m4-underquoted

depends_lib     port:glib1 port:gettext

post-patch {
    fs-traverse item ${worksrcpath} {
        if {"Makefile.in" == [file tail ${item}]} {
            reinplace -E {/--mode=/s|(\$\(CC(LD)?\))|"\1"|g} ${item}
        }
    }
}

configure.args  \
    LDFLAGS="-L${prefix}/lib" \
    CPPFLAGS="-I${prefix}/include -DHAVE_LIMITED_WRITEV \
            -DMAX_LIMITED_IOVECS=1024" \
    CFLAGS="-O3 -fstrict-aliasing -funroll-loops" \
    --infodir=${prefix}/share/info

# port:glib1 is not universal
universal_variant  no

livecheck.type  gnome
livecheck.name  ${gname}
livecheck.regex "${gname}-(\\d+(?:\\.\\d+)*)"
