# -*- 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.2
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
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  336f0216575e5808860d9384cfba2b7536bc66fa \
                    sha256  f908c879d98c63a20f5419d56c1da307ad73ee60d4f5ed693434e3fb6d09645b \
                    size    904015

depends_build       port:autoconf \
                    port:automake \
                    port:libtool

depends_lib         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.cmd       ./autogen.sh && ./configure

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
}
