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

github.setup    28msec zorba 3.1
revision        4
license         Apache-2
categories      textproc devel
platforms       darwin
maintainers     nomaintainer
description     The XQuery Processor

long_description \
    Zorba is a general purpose XQuery processor implementing in C++ the W3C \
    family of specifications. It is not an XML database. The query processor \
    has been designed to be embeddable in a variety of environments such as \
    other programming languages extended with XML processing capabilities, \
    browsers, database servers, XML message dispatchers, or smartphones. Its \
    architecture employes a modular design, which allows customizing the Zorba \
    query processor to the environment’s needs. In particular the architecture \
    of the query processor allows a pluggable XML store (e.g. main memory, DOM \
    stores, persistent disk-based large stores, S3 stores).

homepage        http://www.zorba.io/home

checksums       rmd160  b2bbc7dc718473eccb4f3f03fced5802a15ca827 \
                sha256  536b5949346c2623be1f068b7cca27e94efcc8df7dc807b61c4b085082f5675b

# In-source builds are not allowed
cmake.out_of_source yes

patchfiles      patch-src-types-schema-SchemaValidatorFilter.h.diff

depends_build-append \
    port:bison \
    port:flex

depends_lib \
    port:boost \
    port:curl \
    port:fop \
    port:geos \
    port:icu \
    port:libarchive \
    port:libiconv \
    port:libxml2 \
    port:libxslt \
    port:sqlite3 \
    port:tidy \
    port:xercesc3

# External modules not installed:
#   port:ImageMagick    - image         skip this, creates too big .mpkg files
#                       - schema-tools  xmlbeans port not available
#                       - read-pdf      fontbox port not available
#   port:cclient        - email         breaks zorba build

# Dependencies for external modules
#    port:cclient       - email
#    port:geos          - geo
#    port:libarchive    - archive
#    port:libxslt       - language/xslt
#    port:fop           - xsl-fo

configure.args-append \
    -DCURL_FOUND=YES \
    -DCURL_INCLUDE_DIR=${prefix}/include \
    -DCURL_LIBRARY=${prefix}/lib/libcurl.dylib \
    -DZORBA_XQUERYX=YES

# required for ICU
compiler.cxx_standard     2011
configure.cppflags-append -DU_USING_ICU_NAMESPACE=1
configure.cxxflags-append -std=c++11

test.env DYLD_LIBRARY_PATH=${worksrcpath}/src
test.run yes