class Gmsh < Formula desc "3D finite element grid generator with CAD engine" homepage "https://gmsh.info/" url "https://gmsh.info/src/gmsh-4.2.2-source.tgz" sha256 "e9ee9f5c606bbec5f2adbb8c3d6023c4e2577f487fa4e4ecfcfc94a241cc8dcc" head "https://gitlab.onelab.info/gmsh/gmsh.git" bottle do cellar :any sha256 "9fb549078d58da757682e80f0b0914132b091d792a7815de341c9165e6b80998" => :mojave sha256 "58dede90657a47fe870ac7a9365a4c09f1db589c6ae337ab6e36c898539272bb" => :high_sierra sha256 "b42d1cc505238581218f8b1ea20e324169c220571fcb4e84870b9f8098da6829" => :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