73 lines
3.3 KiB
Ruby
73 lines
3.3 KiB
Ruby
class Opencascade < Formula
|
|
desc "3D modeling and numerical simulation software for CAD/CAM/CAE"
|
|
homepage "https://dev.opencascade.org/"
|
|
url "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V7_5_1;sf=tgz"
|
|
version "7.5.1"
|
|
sha256 "3a43d8b50df78ade72786fa63bc8808deac6380189333663e7b4ef8558ae7739"
|
|
license "LGPL-2.1-only"
|
|
revision 1
|
|
|
|
# The first-party download page (https://dev.opencascade.org/release)
|
|
# references version 7.5.0 and hasn't been updated for later maintenance
|
|
# releases (e.g., 7.5.1, 7.5.2), so we check the Git tags instead. Release
|
|
# information is posted at https://dev.opencascade.org/forums/occt-releases
|
|
# but the text varies enough that we can't reliably match versions from it.
|
|
livecheck do
|
|
url "https://git.dev.opencascade.org/repos/occt.git"
|
|
regex(/^v?(\d+(?:[._]\d+)+(?:p\d+)?)$/i)
|
|
strategy :git do |tags, regex|
|
|
tags.map { |tag| tag[regex, 1]&.gsub("_", ".") }.compact
|
|
end
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "6e9743bf2f4d14d386fae64998a2dc1970d87de03700062560e4f83aabda6fed"
|
|
sha256 cellar: :any, big_sur: "ad919403c283553abdfdf73aff6dae11dcb61b4033135e92ed5320e3a62a9158"
|
|
sha256 cellar: :any, catalina: "93c10007c53833aaae139fe70fb4ea77486087d81489496a3e3463adb3d7a502"
|
|
sha256 cellar: :any, mojave: "494a2b145f132c19af59a46ebbf5c39d8eebda7e46a41c409f2e7abf3f7bb4a7"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "doxygen" => :build
|
|
depends_on "rapidjson" => :build
|
|
depends_on "freeimage"
|
|
depends_on "freetype"
|
|
depends_on "tbb@2020"
|
|
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@2020"].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
|