homebrew-core/Formula/gmsh.rb

54 lines
1.5 KiB
Ruby

class Gmsh < Formula
desc "3D finite element grid generator with CAD engine"
homepage "https://gmsh.info/"
url "https://gmsh.info/src/gmsh-4.5.2-source.tgz"
sha256 "0120fe240d32ff1d7457f1b6b350cb85c1e01801f9d371a8656c526474882682"
head "https://gitlab.onelab.info/gmsh/gmsh.git"
bottle do
cellar :any
sha256 "4787eac55f60fa0dd626955ca570a3569f6693ddbbff2118319134b681055564" => :catalina
sha256 "10292c463e0033d9279b29d2aec15240fa3fbaf1328ea4e6898f3ea9df9eae41" => :mojave
sha256 "5df69577b307b1f9b8d5de405db8b986c4e3f9c49d1b7d06250f35353fbb7c4c" => :high_sierra
end
depends_on "cmake" => :build
depends_on "cairo"
depends_on "fltk"
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "opencascade"
def install
args = std_cmake_args + %W[
-DENABLE_OS_SPECIFIC_INSTALL=0
-DGMSH_BIN=#{bin}
-DGMSH_LIB=#{lib}
-DGMSH_DOC=#{pkgshare}/gmsh
-DGMSH_MAN=#{man}
-DENABLE_BUILD_LIB=ON
-DENABLE_BUILD_SHARED=ON
-DENABLE_NATIVE_FILE_CHOOSER=ON
-DENABLE_PETSC=OFF
-DENABLE_SLEPC=OFF
-DENABLE_OCC=ON
]
ENV["CASROOT"] = Formula["opencascade"].opt_prefix
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
# Move onelab.py into libexec instead of bin
mkdir_p libexec
mv bin/"onelab.py", libexec
end
end
test do
system "#{bin}/gmsh", "#{share}/doc/gmsh/tutorial/t1.geo", "-parse_and_exit"
end
end