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

github.setup        plumed plumed2 2.9.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
name                py-plumed

categories-append   science
license             LGPL-3
maintainers         {gmail.com:giovanni.bussi @GiovanniBussi} openmaintainer

description         Python wrappers for plumed.
long_description    {*}${description} They allow the plumed library to be directly used from python.

homepage            https://www.plumed.org

checksums           rmd160  af05bf43a7df583cf21c7cb2374cceea7dfe4066 \
                    sha256  63e01c425c59e4921429fb79d03710b5d115e47fc8025a165477c6807cbf0014 \
                    size    116844795

python.versions     310 311

# python setup is located in python subdir of plumed repository
worksrcdir  ${distname}/python

if {${name} ne ${subport}} {

# setup the wrappers so that by default they load MacPorts plumed library
    build.env-append    plumed_default_kernel=${prefix}/lib/libplumedKernel.dylib \
                        plumed_macports=yes

    depends_build-append    port:py${python.version}-cython

    depends_lib-append      path:${prefix}/lib/libplumedKernel.dylib:plumed

    depends_test-append     port:py${python.version}-numpy \
                            port:py${python.version}-pandas

    test.run                yes
}

notes "
PLUMED is linked with runtime binding. By setting the environment variable PLUMED_KERNEL\
to the path of libplumedKernel.dylib you can replace your own PLUMED library at runtime.\
By default, ${prefix}/lib/libplumedKernel.dylib is linked.
"
