-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
9ed6c94
commit 57c8f99
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Libheinz < Formula | ||
desc "C++ base library of Heinz Maier-Leibnitz Zentrum" | ||
homepage "https://jugit.fz-juelich.de/mlz/libheinz" | ||
url "https://jugit.fz-juelich.de/mlz/libheinz/-/archive/v2.0.0/libheinz-v2.0.0.tar.bz2" | ||
sha256 "e1e67da3997de1c28e60a9c5c7a45e383526b0fa18aefbb6e7c7d671b487da8a" | ||
license "GPL-3.0-or-later" | ||
|
||
depends_on "cmake" => :build | ||
|
||
def install | ||
system "cmake", "-S", ".", "-B", "build", *std_cmake_args | ||
system "cmake", "--build", "build" | ||
system "cmake", "--install", "build" | ||
end | ||
|
||
test do | ||
(testpath/"test.cpp").write <<~CPP | ||
#include <heinz/Vectors3D.h> | ||
#include <iostream> | ||
int main() { | ||
R3 vector(1.0, 2.0, 3.0); | ||
if (vector.x() == 1.0 && vector.y() == 2.0 && vector.z() == 3.0) { | ||
std::cout << "Success" << std::endl; | ||
return 0; | ||
} | ||
return 1; | ||
} | ||
CPP | ||
|
||
system ENV.cxx, "-std=c++17", "test.cpp", "-I#{include}", "-o", "test" | ||
system "./test" | ||
end | ||
end |