# -*- 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
# $Id: Portfile 108345 2013-07-20 12:07:24Z mojca@macports.org $

# Important: keep in sync with the 'gromacs-double' port!

PortSystem          1.0
PortGroup           muniversal 1.0
name                gromacs
version             4.5.5
revision            2
categories          science math
license             gpl
maintainers         nomaintainer
description         The World's fastest Molecular Dynamics package
long_description    GROMACS is a versatile package to perform molecular \
                    dynamics, i.e. simulate the Newtonian equations of motion for \
                    systems with hundreds to millions of particles. It is primarily \
                    designed for biochemical molecules like proteins and lipids that \
                    have a lot of complicated bonded interactions, but since GROMACS is \
                    extremely fast at calculating the nonbonded interactions (that \
                    usually dominate simulations) many groups are also using it for \
                    research on non-biological systems, e.g. polymers.
platforms           darwin

distname            gromacs-${version}
dist_subdir         gromacs
homepage            http://www.gromacs.org/
master_sites        ftp://ftp.gromacs.org/pub/gromacs \
                    http://cluster.earlham.edu/detail/home/charliep/packages

checksums           rmd160  a3d40c3ac6ec9ee3e4607bd35afca1dd4715154e \
                    sha256  e0605e4810b0d552a8761fef5540c545beeaf85893f4a6e21df9905a33f871ba

depends_build       port:pkgconfig

depends_lib         port:fftw-3-single \
                    port:libxml2

configure.args      --bindir=${prefix}/lib/${name}/bin \
                    --enable-shared \
                    --without-x

variant x11 conflicts no_x11 description {enable the openmotif interface} {
    depends_lib-append      port:openmotif
    configure.args-delete   --without-x
    configure.args-append   --with-x
}

# remove this in August 2014
variant no_x11 conflicts x11 description {legacy compatibility variant} {}
if {[variant_isset no_x11]} {
    default_variants        -x11
} else {
    default_variants        +x11
}

variant gsl description {enable extra analyses via the GNU scientific library} {
    depends_lib-append      port:gsl
    configure.args-append   --with-gsl
}

variant openmpi description {build using openmpi parallelization} {
    depends_lib-append      port:openmpi
    configure.args-append   --enable-mpi
}

if { ![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] } {
    default_variants    +gcc47
}

variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {build with macports-gcc-4.3} {
    depends_lib-append  port:gcc43
    configure.compiler  macports-gcc-4.3
}

variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {build with macports-gcc-4.4} {
    depends_lib-append  port:gcc44
    configure.compiler  macports-gcc-4.4
}

variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {build with macports-gcc-4.5} {
    depends_lib-append  port:gcc45
    configure.compiler  macports-gcc-4.5
}

variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {build with macports-gcc-4.6} {
    depends_lib-append  port:gcc46
    configure.compiler  macports-gcc-4.6
}

variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 description {build with macports-gcc-4.7} {
    depends_lib-append  port:gcc47
    configure.compiler  macports-gcc-4.7
}
