51 lines
1.6 KiB
Ruby
51 lines
1.6 KiB
Ruby
class Cling < Formula
|
|
desc "The cling C++ interpreter"
|
|
homepage "https://root.cern.ch/cling"
|
|
url "https://github.com/root-project/cling.git",
|
|
:tag => "v0.5",
|
|
:revision => "0f1d6d24d4417fc02b73589c8b1d813e92de1c3f"
|
|
revision 2
|
|
|
|
bottle do
|
|
cellar :any
|
|
rebuild 1
|
|
sha256 "e9d2d3b1c5f00e6d511323937a231ec4b86c84934a5e7ab7bd8e589720c68230" => :catalina
|
|
sha256 "6278a45d807370fc4d434ceaa518ca48f1149425a301724deac437ffdf5f0d8d" => :mojave
|
|
sha256 "743ebf99fbc9218f313f9423dad4c767d47bdea4e033d42c8eb989ad89b63458" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
resource "clang" do
|
|
url "http://root.cern.ch/git/clang.git",
|
|
:tag => "cling-patches-r302975",
|
|
:revision => "1f8b137c7eb06ed8e321649ef7e3f3e7a96f361c"
|
|
end
|
|
|
|
resource "llvm" do
|
|
url "http://root.cern.ch/git/llvm.git",
|
|
:tag => "cling-patches-r302975",
|
|
:revision => "2a34248cb945d63ded5ee55128e68efd7e5b87c8"
|
|
end
|
|
|
|
def install
|
|
(buildpath/"src").install resource("llvm")
|
|
(buildpath/"src/tools/cling").install buildpath.children - [buildpath/"src"]
|
|
(buildpath/"src/tools/clang").install resource("clang")
|
|
mkdir "build" do
|
|
system "cmake", *std_cmake_args, "../src",
|
|
"-DCMAKE_INSTALL_PREFIX=#{libexec}",
|
|
"-DCLING_CXX_PATH=clang++"
|
|
system "make", "install"
|
|
end
|
|
bin.install_symlink libexec/"bin/cling"
|
|
prefix.install_metafiles buildpath/"src/tools/cling"
|
|
end
|
|
|
|
test do
|
|
test = <<~EOS
|
|
'#include <stdio.h>' 'printf("Hello!")'
|
|
EOS
|
|
assert_equal "Hello!(int) 6", shell_output("#{bin}/cling #{test}").chomp
|
|
end
|
|
end
|