jsoncpp 1.9.0

This commit is contained in:
Igor Kapkov 2019-07-03 10:15:15 +10:00 committed by Thierry Moisan
parent 70cfae2f21
commit 6f5dbe6251
No known key found for this signature in database
GPG key ID: A9A4CB593D38CDD0

View file

@ -1,8 +1,8 @@
class Jsoncpp < Formula
desc "Library for interacting with JSON"
homepage "https://github.com/open-source-parsers/jsoncpp"
url "https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz"
sha256 "c49deac9e0933bcb7044f08516861a2d560988540b23de2ac1ad443b219afdb6"
url "https://github.com/open-source-parsers/jsoncpp/archive/1.9.0.tar.gz"
sha256 "bdd3ba9ed1f110b3eb57474d9094e90ab239b93b4803b4f9b1722c281e85a4ac"
head "https://github.com/open-source-parsers/jsoncpp.git"
bottle do
@ -32,12 +32,15 @@ class Jsoncpp < Formula
(testpath/"test.cpp").write <<~EOS
#include <json/json.h>
int main() {
Json::Value root;
Json::Reader reader;
return reader.parse("[1, 2, 3]", root) ? 0: 1;
Json::Value root;
Json::CharReaderBuilder builder;
std::string errs;
std::istringstream stream1;
stream1.str("[1, 2, 3]");
return Json::parseFromStream(builder, stream1, &root, &errs) ? 0: 1;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test",
system ENV.cxx, "-std=c++11", testpath/"test.cpp", "-o", "test",
"-I#{include}/jsoncpp",
"-L#{lib}",
"-ljsoncpp"