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/"
|
|
|
|
url "https://github.com/fmtlib/fmt/releases/download/3.0.0/fmt-3.0.0.zip"
|
|
|
|
sha256 "1b050b66fa31b74f1d75a14f15e99e728ab79572f176a53b2f8ad7c201c30ceb"
|
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-06-01 14:41:04 +00:00
|
|
|
sha256 "89e5da4b7ccda59c840406b830b547b50e9621ec73524ec9d90bdec95087c115" => :el_capitan
|
|
|
|
sha256 "713dd1a92c1e3509c9bd67b0f72cbf4141923288188ffc0630648981c3239c3c" => :yosemite
|
|
|
|
sha256 "0f563f0c3bb0e8425fc4d4dd48d5e493eb2a2e6301fb7eb2e0e646d1dd2f12ca" => :mavericks
|
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
|