# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sts=4:sw=4:ts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           active_variants 1.1
PortGroup           boost 1.0

github.setup        NationalAssociationOfRealtors libRETS 1.6.6
revision            0

# Drop on next update:
if {${os.platform} eq "darwin" && ${os.major} < 10} {
    incr revision
}

set name            librets
license             Permissive
categories          devel
maintainers         nomaintainer

description         RETS client library
long_description    libRETS is RETS client library written in C++ that allows rapid \
                    development of RETS client applications. By saving the developer from \
                    dealing with the RETS protocol details, the application writer can \
                    concentrate on their application, saving them time and money in \
                    the process.

checksums           rmd160  f03b74ea62cc761deef8cfc30f2116201f31eecf \
                    sha256  1b80c77c471a40080be6bb6b1229b1398455ad319e861000ff5d8649e8dd812f \
                    size    4156047
github.tarball_from archive

use_autoreconf      yes

depends_lib-append  port:curl \
                    port:swig

# Requires boost static, hence forbids boost +no_static
require_active_variants boost {} no_static

# Require php5 bindings to use swig-php +php56
if {[variant_isset php5]} {
    require_active_variants swig-php php56 {}
}

configure.args-append \
                    --disable-perl \
                    --disable-php \
                    --disable-ruby \
                    --disable-java \
                    --disable-python \
                    --disable-dotnet

variant java description {Build Java bindings} {
    depends_lib-append port:swig-java
    configure.args-delete --disable-java
}

variant perl description {Build Perl bindings} {
    depends_lib-append port:swig-perl
    configure.args-delete --disable-perl
}

variant php5 description {Build PHP5 bindings} {
    depends_lib-append port:swig-php
    configure.args-delete --disable-php
}

variant python description {Build Python bindings} {
    depends_lib-append port:swig-python
    configure.args-delete --disable-python
}

variant ruby description {Build Ruby bindings} {
    depends_lib-append port:swig-ruby
    configure.args-delete --disable-ruby
}

variant sql2dmql description {Build SQL to DMQL compiler} {
    depends_lib port:antlr
    configure.args-append --enable-sql-compiler
}
