2016-06-01 14:05:53 +00:00
|
|
|
class Fmt < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Open-source formatting library for C++"
|
2016-06-01 14:05:53 +00:00
|
|
|
homepage "https://fmtlib.github.io/"
|
2016-11-01 09:54:33 +00:00
|
|
|
url "https://github.com/fmtlib/fmt/archive/3.0.1.tar.gz"
|
|
|
|
sha256 "dce62ab75a161dd4353a98364feb166d35e7eea382169d59d9ce842c49c55bad"
|
2015-05-06 07:12:54 +00:00
|
|
|
|
2015-05-08 08:25:27 +00:00
|
|
|
bottle do
|
2015-12-08 08:38:22 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-11-01 09:57:24 +00:00
|
|
|
sha256 "bac53b7d6efc3f09ddbb5e197aa6ea8f0337010b396f75bb51666bb9f1f4b250" => :sierra
|
|
|
|
sha256 "49151a813dd32732427993f0279620986b4371ec841ebdd506c77f4def10cd12" => :el_capitan
|
|
|
|
sha256 "91122df1a848016cf728ef1fe60fb18edae3f4fe99766eb93043bb6148b69259" => :yosemite
|
2015-05-08 08:25:27 +00:00
|
|
|
end
|
|
|
|
|
2015-05-06 07:12:54 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cmake", ".", *std_cmake_args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
2016-06-01 14:05:53 +00:00
|
|
|
#include <fmt/format.h>
|
2015-05-06 07:12:54 +00:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
std::string str = fmt::format("The answer is {}", 42);
|
|
|
|
std::cout << str;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
|
|
|
system ENV.cxx, "test.cpp", "-o", "test",
|
|
|
|
"-I#{include}",
|
|
|
|
"-L#{lib}",
|
2016-06-01 14:05:53 +00:00
|
|
|
"-lfmt"
|
2015-05-08 07:50:03 +00:00
|
|
|
assert_equal "The answer is 42", shell_output("./test")
|
2015-05-06 07:12:54 +00:00
|
|
|
end
|
|
|
|
end
|