# -*- 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 88781 2012-01-11 17:02:56Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           muniversal 1.0

name                baresip
version             0.4.0
categories          net
platforms           darwin
maintainers         db.org:aeh
license             BSD

description         portable and modular SIP User-Agent \
                    with audio and video support

long_description    ${name} is a ${description}.

homepage            http://www.creytiv.com/
master_sites        ${homepage}pub/

checksums           rmd160  7e1cf797d756cfbf5acaba93fc22b44414a9ebd3 \
                    sha256  e1c81730556f2cd24db94e63e4f3172892a1e8ca1047f1f506d5bbd0b436e17f

depends_lib         port:libre \
                    port:librem \
                    port:spandsp-devel \
                    path:bin/ffmpeg:ffmpeg

use_configure       no

build.args          PREFIX=${prefix} \
                    SYSROOT_ALT=${prefix} \
                    MOD_AUTODETECT= \
                    USE_CONS=1 \
                    USE_COREAUDIO=1 \
                    USE_FFMPEG=1 \
                    USE_G711=1 \
                    USE_G722=1 \
                    USE_OPENGL=1 \
                    USE_QTCAPTURE=1 \
                    USE_STDIO=1 \
                    USE_UUID=1 \
                    LIBRE_MK=${prefix}/share/re/re.mk \
                    LIBRE_INC=${prefix}/include/re \
                    LIBRE_SO=${prefix}/lib \
                    EXTRA_CFLAGS=-I${prefix}/include/rem
destroot.args       ${build.args}

if {[tbool configure.ccache]} {
    build.env-append CCACHE=ccache
}

if {[variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_env(${arch})    CC='${configure.cc} -arch ${arch}'
        lappend merger_destroot_env(${arch}) CC='${configure.cc} -arch ${arch}'
    }
} else {
    build.env-append    CC='${configure.cc} ${configure.cc_archflags}'
    destroot.env-append CC='${configure.cc} ${configure.cc_archflags}'
}
