Skip to content

Commit cfbd671

Browse files
committed
netgen@6.2.2601: checkin new version of netgen
1 parent 20dc5d4 commit cfbd671

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

Formula/netgen@6.2.2601.rb

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
# SPDX-FileNotice: Part of the FreeCAD project.
3+
4+
class NetgenAT622601 < Formula
5+
desc "C++ Library of NETGEN's tetrahedral mesh generator"
6+
homepage "https://github.com/ngsolve/netgen"
7+
url "https://github.com/ngsolve/netgen.git",
8+
tag: "v6.2.2601"
9+
license "LGPL-2.1-only"
10+
head "https://github.com/ngsolve/netgen.git", branch: "master"
11+
12+
keg_only :versioned_formula
13+
14+
depends_on "cmake" => :build
15+
depends_on "llvm" => :build
16+
depends_on "ninja" => :build
17+
depends_on "opencascade"
18+
depends_on "pybind11"
19+
depends_on "python@3.13"
20+
21+
def install
22+
ENV["CC"] = Formula["llvm"].opt_bin/"clang"
23+
ENV["CXX"] = Formula["llvm"].opt_bin/"clang++"
24+
25+
python3 = Formula["python@3.13"].opt_bin/"python3.13"
26+
27+
ENV["PYTHON"] = python3.to_s
28+
29+
# Get the Python includes directory without duplicates
30+
py_inc_output = `#{python3}-config --includes`
31+
py_inc_dirs = py_inc_output.scan(/-I([^\s]+)/).flatten.uniq
32+
py_inc_dir = py_inc_dirs.join(" ")
33+
34+
puts "----------------------------------------------------"
35+
puts "PYTHON=#{ENV["PYTHON"]}"
36+
puts "----------------------------------------------------"
37+
38+
args = %W[
39+
-DCMAKE_INSTALL_PREFIX=#{prefix}
40+
-DUSE_PYTHON=ON
41+
-DPython3_EXECUTABLE=#{python3}
42+
-DPython3_INCLUDE_DIR=#{py_inc_dir}
43+
-DUSE_GUI=OFF
44+
-DUSE_OCC=ON
45+
-DUSE_SUPERBUILD=OFF
46+
-DBUILD_FOR_CONDA=OFF
47+
-G Ninja
48+
-L
49+
]
50+
51+
system "cmake", "-S", ".", "-B", "build", *args
52+
system "cmake", "--build", "build"
53+
system "cmake", "--install", "build"
54+
end
55+
56+
def caveats
57+
<<~EOS
58+
this is a versioned formula so it is NOT linked in HOMBREW_PREFIX by default
59+
running brew test netgen currently fails with gcc if built with llvm
60+
EOS
61+
end
62+
63+
test do
64+
ENV["CC"] = Formula["llvm"].opt_bin/"clang"
65+
ENV["CXX"] = Formula["llvm"].opt_bin/"clang++"
66+
67+
ng_inc = Formula["netgen@6.2.2601"].opt_include
68+
69+
(testpath/"test.cpp").write <<~EOS
70+
#include <meshing/meshing.hpp>
71+
int main() { return 0; }
72+
EOS
73+
74+
system ENV.cxx, "test.cpp", "-I#{ng_inc}/include", "-L#{lib}", "-lnglib", "-o", "test"
75+
system "./test"
76+
end
77+
end

0 commit comments

Comments
 (0)