homebrew-core/Formula/gmsh.rb
2018-11-19 19:05:55 -05:00

65 lines
1.8 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.0.5-source.tgz"
sha256 "194354f5cfede4ef47cb6f1d2bde294873315a1b34be114564defef88d108adf"
head "https://gitlab.onelab.info/gmsh/gmsh.git"
bottle do
cellar :any
sha256 "a9f4320ca0c64b2a117514f8a7a6884413cdc27f326481d51077854ed6fb385e" => :mojave
sha256 "ad131603c4c31212499c1e661af46f08a57d9176c38925fe5f353ea2ee95b6c6" => :high_sierra
sha256 "90827adb1f047b9299ffdc97cab8bc1d87204101379a8418011f5019cb7f7458" => :sierra
end
option "with-opencascade", "Build with opencascade support"
depends_on "cmake" => :build
depends_on "gcc" # for gfortran
depends_on "open-mpi"
depends_on "fltk" => :optional
depends_on "cairo" if build.with? "fltk"
depends_on "opencascade" => :optional
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
]
if build.with? "opencascade"
ENV["CASROOT"] = Formula["opencascade"].opt_prefix
args << "-DENABLE_OCC=ON"
else
args << "-DENABLE_OCC=OFF"
end
args << "-DENABLE_FLTK=OFF" if build.without? "fltk"
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
def caveats
"To use onelab.py set your PYTHONDIR to #{libexec}"
end
test do
system "#{bin}/gmsh", "#{share}/doc/gmsh/tutorial/t1.geo", "-parse_and_exit"
end
end