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

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0

github.setup        jezhiggins arabica 2020-April
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             2020.04
revision            1
epoch               1
categories          devel textproc
license             BSD
maintainers         hypergene.com:isak openmaintainer
description         Arabica, an XML toolkit written in C++
long_description    Arabica has a full SAX2 implementation. Layered on SAX is a DOM Level 2.0 implementation, \
                    together with an XPath engine and partial XSLT implementation. It delivers UTF-8-encoded \
                    std::strings or UCS-2 std::wstrings, but can also accommodate custom string types \
                    and alternative encodings. It provides uniform SAX2 wrappers for the Expat parser, \
                    Xerces, Libxml2 and (on Windows) for the Microsoft XML parser COM component.
homepage            https://www.jezuk.co.uk/arabica

checksums           rmd160  59a5be6162c9e6a93676c29e003045c1298ef5dc \
                    sha256  5f7e6a8b3c2a4401f36fe7e825a6908ba36eb3fb75976344e403d1a7ca6f397c \
                    size    2852244

compiler.cxx_standard 2014

depends_lib-append  port:libxml2

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON \
                    -DBUILD_ARABICA_EXAMPLES=OFF \
                    -DBUILD_WITH_BOOST=OFF \
                    -DARABICA_XML_BACKEND=USE_LIBXML2

variant boost description "Use Boost" {
    PortGroup       boost 1.0

    configure.args-replace \
                    -DBUILD_WITH_BOOST=OFF -DBUILD_WITH_BOOST=ON
}

default_variants-append +boost

variant expat description "Use expat XML backend" {
    depends_lib-replace     port:libxml2 port:expat
    configure.args-replace  -DARABICA_XML_BACKEND=USE_LIBXML2 -DARABICA_XML_BACKEND=USE_EXPAT
}
