Skip to content

Commit

Permalink
libheinz 2.0.0 (new formula)
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Dec 25, 2024
1 parent 9ed6c94 commit 57c8f99
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Formula/lib/libheinz.rb
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

0 comments on commit 57c8f99

Please sign in to comment.