From 7f3c692ac4c6b3d53da611182ca37c1320fb08c5 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 3 Feb 2017 17:26:29 +0100 Subject: [PATCH] woboq_codebrowser 2.0.1 (new formula) Closes #9692. Signed-off-by: FX Coudert --- Formula/woboq_codebrowser.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/woboq_codebrowser.rb diff --git a/Formula/woboq_codebrowser.rb b/Formula/woboq_codebrowser.rb new file mode 100644 index 0000000000..204fca0371 --- /dev/null +++ b/Formula/woboq_codebrowser.rb @@ -0,0 +1,31 @@ +class WoboqCodebrowser < Formula + desc "Generate HTML from C++ Code" + homepage "https://code.woboq.org/" + url "https://github.com/woboq/woboq_codebrowser/archive/2.0.1.tar.gz" + sha256 "f2ec67bb49415986a4bbef515024009433756c83e14fa84f5acc40c83eec19e6" + + depends_on "llvm" + depends_on "cmake" => :build + + def install + system "cmake", ".", "-DLLVM_CONFIG_EXECUTABLE=#{Formula["llvm"].opt_bin}/llvm-config", "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", *std_cmake_args + system "make" + bin.install "indexgenerator/codebrowser_indexgenerator", "generator/codebrowser_generator" + prefix.install "data" + end + + test do + (testpath/"test.c").write <<-EOS.undent + #include + int main() { + printf(\"hi!\"); + } + EOS + system "#{bin}/codebrowser_generator", "-o=#{Dir.pwd}", "-p", "test:#{Dir.pwd}", "#{Dir.pwd}/test.c", "--", "clang", "#{Dir.pwd}/test.c" + assert File.exist? "./test/test.c.html" + assert File.exist? "./refs/printf" + assert File.exist? "./include/sys/stdio.h.html" + assert File.exist? "./fnSearch" + assert File.exist? "./fileIndex" + end +end