# $Id: Portfile 90955 2012-03-19 16:34:25Z adfernandes@macports.org $

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

PortSystem  1.0
PortGroup   muniversal 1.0
name		gromacs
version		4.5.4
revision	1
categories	science math
maintainers	adfernandes openmaintainer
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           md5     5013de941017e014b92d41f82c7e86d6 \
                    sha1    c7b3fbd2f3ddf915bc082e7effe76a8276563726 \
                    rmd160  96065d1a173231f75869764a08eb4feccc1ec597

depends_build   port:pkgconfig

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

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

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

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 gcc42] && ![variant_isset gcc43] && ![variant_isset gcc44] } {
    default_variants     +gcc45
}

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

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

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

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