class Gmsh < Formula desc "3D finite element grid generator with CAD engine" homepage "https://gmsh.info/" url "https://gmsh.info/src/gmsh-4.4.1-source.tgz" sha256 "853c6438fc4e4b765206e66a514b09182c56377bb4b73f1d0d26eda7eb8af0dc" head "https://gitlab.onelab.info/gmsh/gmsh.git" bottle do cellar :any sha256 "8586fcd94e5952a8ca25b7972b29c941972e880f06afe6167e521af3c318f0fe" => :mojave sha256 "165aebed189e664d7e57d17944dc44cc7c18e77e64afbb0b0ad454a659bbb701" => :high_sierra sha256 "ad60f546a45254ec1c51693d551cca3eb313ff10e1ccef10f876582db99cf47d" => :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