gromacs: migrate from homebrew/science

Closes #17003.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
FX Coudert 2017-08-19 23:55:15 +02:00
parent 56781df9d8
commit ee409e5d56
2 changed files with 44 additions and 1 deletions

44
Formula/gromacs.rb Normal file
View file

@ -0,0 +1,44 @@
class Gromacs < Formula
desc "Versatile package for molecular dynamics calculations"
homepage "http://www.gromacs.org/"
url "https://ftp.gromacs.org/pub/gromacs/gromacs-2016.3.tar.gz"
sha256 "7bf00e74a9d38b7cef9356141d20e4ba9387289cbbfd4d11be479ef932d77d27"
option "with-double", "Enables double precision"
depends_on "cmake" => :build
depends_on "fftw"
depends_on "gsl"
depends_on :mpi => :optional
depends_on :x11 => :optional
def install
args = std_cmake_args + %w[-DGMX_GSL=ON]
args << "-DGMX_DOUBLE=ON" if build.include? "enable-double"
args << "-DGMX_MPI=ON" if build.with? "mpi"
args << "-DGMX_X11=ON" if build.with? "x11"
inreplace "scripts/CMakeLists.txt", "BIN_INSTALL_DIR", "DATA_INSTALL_DIR"
mkdir "build" do
system "cmake", "..", *args
system "make"
ENV.deparallelize { system "make", "install" }
end
bash_completion.install "build/scripts/GMXRC" => "gromacs-completion.bash"
bash_completion.install "#{bin}/gmx-completion-gmx.bash" => "gmx-completion-gmx.bash"
bash_completion.install "#{bin}/gmx-completion.bash" => "gmx-completion.bash"
zsh_completion.install "build/scripts/GMXRC.zsh" => "_gromacs"
end
def caveats; <<-EOS.undent
GMXRC and other scripts installed to:
#{HOMEBREW_PREFIX}/share/gromacs
EOS
end
test do
system "#{bin}/gmx", "help"
end
end

View file

@ -21,7 +21,6 @@
"ggobi": "homebrew/science",
"gimp": "caskroom/cask",
"grads": "caskroom/cask",
"gromacs": "homebrew/science",
"gtkwave": "caskroom/cask",
"hdf@4": "homebrew/science",
"helios": "spotify/public",