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

boost.depends_type  build

name            libetonyek
version         0.1.12
revision        2

# Drop on next update:
if {${os.platform} eq "darwin" && ${os.major} < 10} {
    incr revision
}

maintainers     {gmail.com:rjvbertin @RJVB}
categories      textproc
license         MPL-2+

description     Libetonyek is a library that parses the file format of Apple iWork documents.
long_description \
                {*}${description}. It supports Keynote versions 2-6, Numbers 1-2 and Pages 1-4.

homepage        https://wiki.documentfoundation.org/DLP/Libraries/libetonyek
master_sites    http://dev-www.libreoffice.org/src/${name}

use_xz          yes

checksums       rmd160  2ee881430fd7b68b3aaa1c743633949749b8e663 \
                sha256  b9fa82fbeb8cb7a701101060e4f3e1e4ef7c38f574b2859d3ecbe43604c21f83 \
                size    1513688

depends_build   port:gperf \
                port:mdds-2.1 \
                path:bin/pkg-config:pkgconfig

depends_lib     port:glm \
                port:liblangtag \
                port:librevenge \
                port:libxml2 \
                port:zlib

compiler.cxx_standard       2011

# Disable some of the chattiest warnings (gives significant speed-up, about 14% for me)
configure.cflags-append     -Wno-c99-extensions -Wno-variadic-macros
configure.cxxflags-append   -Wno-variadic-macros

configure.args  --disable-dependency-tracking \
                --disable-tests \
                --disable-werror \
                --enable-silent-rules \
                --with-mdds=2.1 \
                --with-sysroot=${prefix} \
                --without-docs

variant docs description "Build API documentation" {
    depends_build-append    path:bin/doxygen:doxygen
    configure.args-delete   --without-docs
}

variant mdds14 description "Legacy compatibility build against mdds 1.4.x" {
    depends_build-replace \
                port:mdds-2.1 \
                port:mdds
    configure.args-replace \
                --with-mdds=2.1 \
                --with-mdds=1.4
}

livecheck.regex "${name}-(\[0-9.\]+)${extract.suffix}"
