# -*- 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                memesuite
version             5.5.5
revision            0
categories          science biology
platforms           darwin linux
license             Noncommercial
maintainers         {@CharlesEGrant uw.edu:cegrant} \
                    {@wsnoble uw.edu:wnoble} \
                    {@tlawbailey gmail.com:tlawbailey} \
                    openmaintainer

description         Motif analysis toolkit
long_description    MEME-Suite is a collection of tools for the analysis of \
                    motifs in DNA, RNA and proteins.
homepage            https://meme-suite.org
master_sites        ${homepage}/meme/meme-software/${version}
distname            meme-${version}

checksums           rmd160  0b3ac95876ba90c0bfd8ab69b98582873ac099a9 \
                    sha256  bebb4a176e72d62e3a2d5ba5f22439185bbc4bbf4769604fbca12dff8e1f739f \
                    size    55017311

set perl_vers       5.34
set py_vers         3.11
set py_vers_nodot   [string map {. {}} ${py_vers}]

depends_lib         port:expat \
                    port:gawk \
                    port:ghostscript \
                    port:gsed \
                    port:perl${perl_vers} \
                    port:p${perl_vers}-file-which \
                    port:p${perl_vers}-html-template \
                    port:p${perl_vers}-html-tree \
                    port:p${perl_vers}-json \
                    port:p${perl_vers}-math-cdf \
                    port:p${perl_vers}-sys-info \
                    port:p${perl_vers}-xml-parser \
                    port:p${perl_vers}-xml-simple \
                    port:python${py_vers_nodot} \
                    port:py${py_vers_nodot}-gnureadline \
                    port:libxml2 \
                    port:libxslt \
                    port:zlib

configure.args      --with-python=${prefix}/bin/python${py_vers} \
                    --with-perl=${prefix}/bin/perl${perl_vers} \
                    --with-gs=${prefix}/bin/gs

# Make serial version of MEME.
variant serial description {Build MEME for serial mode.} {
                    configure.args-append --enable-serial
}

# Make parallel version of MEME using MacPorts port of openmpi.
variant parallel description {Build MEME for parallel mode.} {
                    depends_lib-append port:openmpi
                    configure.args-append --with-mpidir=${prefix}
}

notes "Commercial users should obtain a license as described here: https://meme-suite.org/meme/doc/copyright.html."

test.run            yes

livecheck.type      regex
livecheck.url       https://meme-suite.org/meme/meme-software/
livecheck.regex     meme-(\\d+\\.\\d+(\\.\\d+)?)\\.tar\\.gz
