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

PortSystem          1.0

name                libftdi
if {${name} eq ${subport}} {
    replaced_by         libftdi0
    PortGroup           obsolete 1.0

    epoch               1
}

version             0.20
categories          devel
license             GPL-2+
maintainers         {snc @nerdling} openmaintainer
description         A library to talk to FTDI chips
long_description    A library to talk to FTDI chips: \
                    FT232BM/245BM, FT2232C/D and FT232/245R \
                    using libusb, including the popular bitbang mode. \
                    The license is LGPL.
homepage            http://www.intra2net.com/en/developer/libftdi/
platforms           darwin
master_sites        http://www.intra2net.com/en/developer/libftdi/download/
depends_build-append    port:pkgconfig
depends_lib-append  port:libusb-compat

livecheck.url       http://www.intra2net.com/en/developer/libftdi/download.php
livecheck.type      regex

subport             libftdi0 {
    revision            1

    distname            libftdi-${version}

    checksums           rmd160  7406f831a6d7b3ccf8e246504f7275a5208f94e9 \
                        sha256  3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e \
                        size    423570

    configure.args-append   --with-boost=no \
                            --without-examples \
                            --without-docs

    livecheck.regex     ${name}-(0(\\.\\d+)+)
}

subport             libftdi1 {
    PortGroup           cmake 1.0
    PortGroup           boost 1.0

    version             1.5
    revision            2
    distname            libftdi1-${version}
    use_bzip2           yes

    depends_build-append \
                        path:bin/doxygen:doxygen

    depends_lib-append  port:gettext \
                        port:libconfuse \
                        path:lib/pkgconfig/libusb-1.0.pc:libusb

    boost.depends_type  build

    checksums           rmd160  4b763717d47f9ac5891d7a4d762a989349b7af3c \
                        sha256  7c7091e9c86196148bd41177b4590dccb1510bfe6cea5bf7407ff194482eb049 \
                        size    116297

    cmake.out_of_source yes
    configure.args-append   -DCMAKE_CXX_FLAGS="${configure.cxxflags}" \
                            -DCMAKE_C_FLAGS="${configure.cflags}"

    livecheck.regex     ${subport}-(1(\\.\\d+)+)
}

if {${subport} == ${name}} {
    livecheck.type      none
}