# -*- 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                ViennaRNA
version             2.4.17
revision            1

categories          science
platforms           darwin
maintainers         {gmail.com:giovanni.bussi @GiovanniBussi} openmaintainer
description         C Library and programs for the prediction and comparison\
                    of RNA secondary structures.
long_description    The Vienna RNA Package consists of a C code library and\
                    several stand-alone programs for the prediction and\
                    comparison of RNA secondary structures.
homepage            https://www.tbi.univie.ac.at/RNA/
set branch          [join [lrange [split ${version} .] 0 1] _]_x
master_sites        ${homepage}download/sourcecode/${branch}/

# https://github.com/ViennaRNA/ViennaRNA/blob/master/license.txt
license             restrictive

checksums           rmd160  35c40f8e892295d660646bff11faa05558d1cf7d \
                    sha256  b1e608f6f37cdf4adbcdd1f86fd9ebfcc1e663d58488e0f8173a58879480c121 \
                    size    34680460

configure.args-append  --disable-lto \
                       --with-cluster \
                       --with-kinwalker \
                       --without-doc-pdf \
                       --without-doc-html \
                       --without-perl \
                       --without-python \
                       --without-python3 \
                       --without-tutorial-pdf

depends_lib-append port:gsl \
                   port:mpfr

test.run           yes
test.target        check

variant python38 conflicts python39 description {Enable python3.8 wrappers} {
    depends_lib-append     port:python38
    configure.args-replace --without-python3 PYTHON3=${prefix}/bin/python3.8
    configure.args-append  PYTHON3_DIR=${frameworks_dir}/Python.framework/Versions/3.8/lib/python3.8/site-packages
    configure.args-append  PYTHON3_EXECDIR=${frameworks_dir}/Python.framework/Versions/3.8/lib/python3.8/site-packages
}

variant python39 conflicts python38 description {Enable python3.9 wrappers} {
    depends_lib-append     port:python39
    configure.args-replace --without-python3 PYTHON3=${prefix}/bin/python3.9
    configure.args-append  PYTHON3_DIR=${frameworks_dir}/Python.framework/Versions/3.9/lib/python3.9/site-packages
    configure.args-append  PYTHON3_EXECDIR=${frameworks_dir}/Python.framework/Versions/3.9/lib/python3.9/site-packages
}