From ee409e5d56f0f06d98228323c2c25be1dcc813d4 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sat, 19 Aug 2017 23:55:15 +0200 Subject: [PATCH] gromacs: migrate from homebrew/science Closes #17003. Signed-off-by: FX Coudert --- Formula/gromacs.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++ tap_migrations.json | 1 - 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Formula/gromacs.rb diff --git a/Formula/gromacs.rb b/Formula/gromacs.rb new file mode 100644 index 0000000000..e915dcc0e6 --- /dev/null +++ b/Formula/gromacs.rb @@ -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 diff --git a/tap_migrations.json b/tap_migrations.json index 9c4c0c3aad..7035d4eb2b 100644 --- a/tap_migrations.json +++ b/tap_migrations.json @@ -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",