From d3cec6dc80a690d5579abdc7fcabf53d129d3d3a Mon Sep 17 00:00:00 2001 From: Anatoliy Bulukin Date: Fri, 30 Jan 2015 15:49:22 +0300 Subject: metashell 2.0.0 (new formula) Interactive template metaprogramming shell for c++ Closes #36378. Signed-off-by: Mike McQuaid --- Library/Formula/metashell.rb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Library/Formula/metashell.rb (limited to 'Library') diff --git a/Library/Formula/metashell.rb b/Library/Formula/metashell.rb new file mode 100644 index 000000000..f4c3846ce --- /dev/null +++ b/Library/Formula/metashell.rb @@ -0,0 +1,33 @@ +class Metashell < Formula + homepage "https://github.com/sabel83/metashell" + url "https://github.com/sabel83/metashell/archive/v2.0.0.tar.gz" + sha1 "4dec47b6ee32cdf179b2eb297c289b296d3fba8f" + + depends_on "cmake" => :build + + needs :cxx11 + + def install + ENV.cxx11 + # Build internal Clang + mkdir "templight/build" do + system "cmake", "../llvm", "-DLIBCLANG_BUILD_STATIC=ON", *std_cmake_args + system "make", "clang" + system "make", "libclang" + system "make", "libclang_static" + end + + mkdir "build" do + system "cmake", "..", *std_cmake_args + system "make", "install" + end + end + + test do + (testpath/"test.hpp").write <<-EOS.undent + template struct add_const { using type = const T; }; + add_const::type + EOS + assert_match /const int/, shell_output("cat #{testpath}/test.hpp | #{bin}/metashell -H") + end +end -- cgit v1.2.3