-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvtk.rb
More file actions
114 lines (105 loc) · 4.64 KB
/
vtk.rb
File metadata and controls
114 lines (105 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
class Vtk < Formula
desc "Toolkit for 3D computer graphics, image processing, and visualization"
homepage "https://www.vtk.org/"
url "https://www.vtk.org/files/release/9.5/VTK-9.5.2.tar.gz"
sha256 "cee64b98d270ff7302daf1ef13458dff5d5ac1ecb45d47723835f7f7d562c989"
license "BSD-3-Clause"
revision 2
head "https://gitlab.kitware.com/vtk/vtk.git", branch: "master"
bottle do
sha256 cellar: :any, arm64_tahoe: "1c527182b2977e2a90c68cd000622dc312685e49a9a87402917a416969203b56"
sha256 cellar: :any, arm64_sequoia: "40821fb74f71d78ea3c1a8a3de870a31f977a17d31ddd6aac627a2423c01e6f5"
sha256 cellar: :any, arm64_sonoma: "a6549d4e94df069fe0dc2eaa771136292820eb3462c6493c66385fddbe873d17"
sha256 cellar: :any, sonoma: "3dc0560fee378ce9b12866898a5675bad8e1d3837e5a6bf8877248b3b933f311"
sha256 cellar: :any_skip_relocation, arm64_linux: "89c83a857f7f529adaecea5c7f18926bf80409f30043b8d1c25cec30350cd6c7"
sha256 cellar: :any_skip_relocation, x86_64_linux: "5971c75d68c2918f19705522211fd276c8de22878656fb1fed2bcd77c55333bc"
end
depends_on "cmake" => [:build, :test]
depends_on "boost"
depends_on "cgns"
depends_on "double-conversion"
depends_on "eigen"
depends_on "fontconfig"
depends_on "freetype"
depends_on "hdf5"
depends_on "jpeg-turbo"
depends_on "jsoncpp"
depends_on "libharu"
depends_on "libogg"
depends_on "libpng"
depends_on "libtiff"
depends_on "lz4"
depends_on "netcdf"
depends_on "nlohmann-json"
depends_on "proj"
depends_on "pugixml"
depends_on "sqlite"
depends_on "theora"
depends_on "utf8cpp"
depends_on "xz"
uses_from_macos "expat"
uses_from_macos "libxml2"
uses_from_macos "zlib"
on_linux do
depends_on "gl2ps"
depends_on "libx11"
depends_on "libxcursor"
depends_on "mesa"
end
def install
# Work around superenv to avoid mixing `expat` usage in libraries across dependency tree.
# Brew `expat` usage in Python has low impact as it isn't loaded unless pyexpat is used.
# TODO: Consider adding a DSL for this or change how we handle Python's `expat` dependency
if OS.mac? && MacOS.version < :sequoia
env_vars = %w[CMAKE_PREFIX_PATH HOMEBREW_INCLUDE_PATHS HOMEBREW_LIBRARY_PATHS PATH PKG_CONFIG_PATH]
ENV.remove env_vars, /(^|:)#{Regexp.escape(Formula["expat"].opt_prefix)}[^:]*/
ENV.remove "HOMEBREW_DEPENDENCIES", "expat"
end
qml_plugin_dir = lib/"qml/VTK.#{version.major_minor}"
vtkmodules_dir = prefix/Language::Python.site_packages(python)/"vtkmodules"
rpaths = [rpath, rpath(source: qml_plugin_dir), rpath(source: vtkmodules_dir)]
args = %W[
-DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_INSTALL_RPATH:STRING=#{rpaths.join(";")}
-DCMAKE_DISABLE_FIND_PACKAGE_ICU:BOOL=ON
-DCMAKE_CXX_STANDARD=14
-DVTK_IGNORE_CMAKE_CXX11_CHECKS=ON
-DVTK_WRAP_PYTHON:BOOL=OFF
-DVTK_PYTHON_VERSION:STRING=3
-DVTK_LEGACY_REMOVE:BOOL=ON
-DVTK_MODULE_ENABLE_VTK_InfovisBoost:STRING=YES
-DVTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms:STRING=YES
-DVTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig:STRING=YES
-DVTK_MODULE_USE_EXTERNAL_VTK_cgns:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_eigen:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_expat:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_libharu:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_libproj:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_lz4:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_lzma:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_nlohmannjson:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_ogg:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_png:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_theora:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_tiff:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_utf8:BOOL=ON
-DVTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=ON
-DVTK_GROUP_ENABLE_Qt:STRING=NO
-DVTK_QT_VERSION:STRING=6
]
# External gl2ps causes failure linking to macOS OpenGL.framework
args << "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps:BOOL=ON" unless OS.mac?
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
end