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

github.setup        OpenLightingProject ola 0.10.2
categories          net comms
platforms           darwin
license             GPL-2+ LGPL-2.1+
maintainers         gmail.com:nomis52 p3k.org:interface pjnewman.co.uk:bugs

description         An open framework for DMX512 lighting control

long_description    The Open Lighting Architecture (OLA) provides a plugin \
                    framework for distributing DMX512 control signals on \
                    Mac and Linux. It provides C++ and Python libraries \
                    which abstract away the underlying DMX over IP protocol \
                    or DMX interface.

homepage            http://www.openlighting.org/ola/

checksums           rmd160  f4302835a47146ae1ef5f0284367171a3ba2fba7 \
                    sha256  986e61874bc80db3b23cf201af2dafa39e3412cc50cddf1cd449c869110bfd27

github.tarball_from releases

# cppunit should be changed to depends_test after MacPorts 2.4 is released
depends_build       port:cppunit \
                    port:pkgconfig

depends_lib         port:protobuf-cpp

configure.args      --disable-fatal-warnings  \
                    --disable-http \
                    --disable-libusb \
                    --disable-osc

variant python26 conflicts python27 description {Enable the Python 2.6 API} {
    depends_lib-append      port:py26-protobuf
    configure.args-append   --enable-python-libs
    configure.python        ${prefix}/bin/python2.6
}

variant python27 conflicts python26 description {Enable the Python 2.7 API} {
    depends_lib-append      port:py27-protobuf
    configure.args-append   --enable-python-libs
    configure.python        ${prefix}/bin/python2.7
}

variant rdm_tests requires python27 description {Enable the RDM Tests} {
    depends_lib-append      port:py27-numpy
    configure.args-append   --enable-rdm-tests
}

variant http description {Build with embedded web server} {
    depends_lib-append      port:libmicrohttpd
    configure.args-delete   --disable-http
}

variant osc description {Build with OSC support} {
    depends_lib-append      port:liblo
    configure.args-delete   --disable-osc
}

variant libusb description {Build with libusb support} {
    depends_lib-append      port:libusb
    configure.args-delete   --disable-libusb
}

default_variants    +http +osc +libusb

if {![variant_isset python26]} {
    default_variants        +python27
}

test.run            yes
test.target         check