homebrew-core/Formula/opencascade.rb

66 lines
2.8 KiB
Ruby

class Opencascade < Formula
desc "3D modeling and numerical simulation software for CAD/CAM/CAE"
homepage "https://www.opencascade.com/content/overview"
url "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_5_0;sf=tgz"
version "7.5.0"
sha256 "c8df7d23051b86064f61299a5f7af30004c115bdb479df471711bab0c7166654"
license "LGPL-2.1-only"
revision 1
livecheck do
url "https://www.opencascade.com/content/latest-release"
regex(/href=.*?opencascade[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
rebuild 1
sha256 arm64_big_sur: "ca21853b2cb26e34cf5c3aa6b755689327e023c0b04e4a6d9ff4466a94d8b48e"
sha256 big_sur: "51fd6769b4b4e75062fe5a6486dfe17166471519e1ea8bcb71d5b1f1756d28af"
sha256 catalina: "fb7225acbf5c42a431a30667f5f7e227bf1f68fa1583ea987f0b3caf946c4cab"
sha256 mojave: "1155bf50f284adb9ea20ffa2429a896505f2b7cdec1fe9a24654fb3b94a1f2e8"
end
depends_on "cmake" => :build
depends_on "doxygen" => :build
depends_on "rapidjson" => :build
depends_on "freeimage"
depends_on "freetype"
depends_on "tbb"
depends_on "tcl-tk"
def install
tcltk = Formula["tcl-tk"]
system "cmake", ".",
"-DUSE_FREEIMAGE=ON",
"-DUSE_RAPIDJSON=ON",
"-DUSE_TBB=ON",
"-DINSTALL_DOC_Overview=ON",
"-D3RDPARTY_FREEIMAGE_DIR=#{Formula["freeimage"].opt_prefix}",
"-D3RDPARTY_FREETYPE_DIR=#{Formula["freetype"].opt_prefix}",
"-D3RDPARTY_RAPIDJSON_DIR=#{Formula["rapidjson"].opt_prefix}",
"-D3RDPARTY_RAPIDJSON_INCLUDE_DIR=#{Formula["rapidjson"].opt_include}",
"-D3RDPARTY_TBB_DIR=#{Formula["tbb"].opt_prefix}",
"-D3RDPARTY_TCL_DIR:PATH=#{tcltk.opt_prefix}",
"-D3RDPARTY_TK_DIR:PATH=#{tcltk.opt_prefix}",
"-D3RDPARTY_TCL_INCLUDE_DIR:PATH=#{tcltk.opt_include}",
"-D3RDPARTY_TK_INCLUDE_DIR:PATH=#{tcltk.opt_include}",
"-D3RDPARTY_TCL_LIBRARY_DIR:PATH=#{tcltk.opt_lib}",
"-D3RDPARTY_TK_LIBRARY_DIR:PATH=#{tcltk.opt_lib}",
"-D3RDPARTY_TCL_LIBRARY:FILEPATH=#{tcltk.opt_lib}/libtcl#{tcltk.version.major_minor}.dylib",
"-D3RDPARTY_TK_LIBRARY:FILEPATH=#{tcltk.opt_lib}/libtk#{tcltk.version.major_minor}.dylib",
"-DCMAKE_INSTALL_RPATH:FILEPATH=#{lib}",
*std_cmake_args
system "make", "install"
bin.env_script_all_files(libexec/"bin", CASROOT: prefix)
# Some apps expect resources in legacy ${CASROOT}/src directory
prefix.install_symlink pkgshare/"resources" => "src"
end
test do
output = shell_output("#{bin}/DRAWEXE -c \"pload ALL\"")
assert_equal "1", output.chomp
end
end