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

name                libsbml
version             5.19.0
categories          science
platforms           darwin
maintainers         {@funasoul gmail.com:funasoul} openmaintainer
license             LGPL-2.1+

description         The Systems Biology Markup Language library

long_description    LibSBML is a free, open-source programming library to \
                    help you read, write, manipulate, translate, and validate \
                    SBML files and data streams. It is not an application \
                    itself (though it does come with example programs), but \
                    rather a library you can embed in your own applications.

homepage            http://sbml.org/Software/libSBML
master_sites        sourceforge:project/sbml/libsbml/${version}/experimental/source
patchfiles          patch-python-mp.diff \
                    patch-readSBML-py.diff

distname            libSBML-${version}-Source

checksums           rmd160  a462e9c497ed5072a3fc9ad24280b6fc0cadc6b8 \
                    sha256  b2bcea187060e4fb4e6f51a69cc84a22f39cf45bc41fc4e1534ce5e4ef579b58 \
                    size    16948303

depends_build-append port:check \
                    port:pkgconfig

depends_lib-append  port:bzip2 \
                    port:zlib

configure.args-append -DWITH_EXAMPLES:BOOL=ON -DWITH_CHECK:BOOL=ON

test.run            yes
test.target         check

variant arrays description {Enable libSBML support for the SBML Level 3 Arrays and Sets ('arrays')} {
    configure.args-append   -DENABLE_ARRAYS:BOOL=ON
}

variant comp description {Enable libSBML support for the SBML Level 3 Hierarchical Model ('comp')} {
    configure.args-append   -DENABLE_COMP:BOOL=ON
}

variant cppnamespace description {Use a C++ namespace for libSBML} {
    configure.args-append   -DWITH_CPP_NAMESPACE:BOOL=ON
}

variant distrib description {Enable libSBML support for the SBML Level 3 Distributions ('distrib')} {
    configure.args-append   -DENABLE_DISTRIB:BOOL=ON
}

variant dyn description {Enable libSBML support for the SBML Level 3 Dynamic Structures ('dyn')} {
    configure.args-append   -DENABLE_DYN:BOOL=ON
}

variant expat conflicts libxml2 description {Use the Expat XML parser library} {
    depends_lib-append      port:expat
    configure.args-append   -DWITH_EXPAT:BOOL=ON
    configure.args-append   -DWITH_LIBXML:BOOL=OFF
    configure.args-append   -DWITH_XERCES:BOOL=OFF
}

variant fbc description {Enable libSBML support for the SBML Level 3 Flux Balance Constraints ('fbc')} {
    configure.args-append   -DENABLE_FBC:BOOL=ON
}

variant groups description {Enable libSBML support for the SBML Level 3 Groups ('groups')} {
    configure.args-append   -DENABLE_GROUPS:BOOL=ON
}

variant java description {Configure to use Java} {
    depends_build-append   port:swig-java
    configure.args-append  -DWITH_JAVA:BOOL=ON
}

variant layout description {Enable libSBML support for the SBML Level 3 Graphical Layout ('layout')} {
    configure.args-append   -DENABLE_LAYOUT:BOOL=ON
}

variant libxml2 conflicts expat description {Use the libxml2 XML parser library} {
    depends_lib-append      port:libxml2
    configure.args-append   -DWITH_EXPAT:BOOL=OFF
    configure.args-append   -DWITH_LIBXML:BOOL=ON
    configure.args-append   -DWITH_XERCES:BOOL=OFF
}

variant multi description {Enable libSBML support for the SBML Level 3 Multistate and Multicomponent ('multi')} {
    configure.args-append   -DENABLE_MULTI:BOOL=ON
}

variant python27 conflicts python38 python39 description {Configure to use Python version 2.7} {
    depends_build-append  port:swig-python
    depends_lib-append      port:python27
    configure.args-append   -DWITH_PYTHON:BOOL=ON -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 -DPYTHON_USE_DYNAMIC_LOOKUP:BOOL=ON
}

variant python38 conflicts python27 python39 description {Configure to use Python version 3.8} {
    depends_build-append  port:swig-python
    depends_lib-append      port:python38
    configure.args-append   -DWITH_PYTHON:BOOL=ON -DPYTHON_EXECUTABLE=${prefix}/bin/python3.8 -DPYTHON_USE_DYNAMIC_LOOKUP:BOOL=ON
}

variant python39 conflicts python27 python38 description {Configure to use Python version 3.9} {
    depends_build-append  port:swig-python
    depends_lib-append      port:python39
    configure.args-append   -DWITH_PYTHON:BOOL=ON -DPYTHON_EXECUTABLE=${prefix}/bin/python3.9 -DPYTHON_USE_DYNAMIC_LOOKUP:BOOL=ON
}

variant qual description {Enable libSBML support for the SBML Level 3 Qualitative Models ('qual')} {
    configure.args-append   -DENABLE_QUAL:BOOL=ON
}

variant render description {Enable libSBML support for the SBML Level 3 Rendering ('render')} {
    configure.args-append   -DENABLE_RENDER:BOOL=ON
}

variant req description {Enable libSBML support for the SBML Level 3 Required Elements ('req')} {
    configure.args-append   -DENABLE_REQUIREDELEMENTS:BOOL=ON
}

variant spatial description {Enable libSBML support for the SBML Level 3 Spatial Processes ('spatial')} {
    configure.args-append   -DENABLE_SPATIAL:BOOL=ON
}

if {![variant_isset expat] && ![variant_isset libxml2]} {
      default_variants +libxml2
}

livecheck.regex     /libSBML-(\[0-9.\]+)-Source${extract.suffix}
