2016-11-30 10:24:10 +00:00
|
|
|
class Qjson < Formula
|
|
|
|
desc "Map JSON to QVariant objects"
|
2017-02-16 23:06:19 +00:00
|
|
|
homepage "https://qjson.sourceforge.io"
|
2016-11-30 10:25:09 +00:00
|
|
|
url "https://github.com/flavio/qjson/archive/0.9.0.tar.gz"
|
|
|
|
sha256 "e812617477f3c2bb990561767a4cd8b1d3803a52018d4878da302529552610d4"
|
2016-11-30 10:24:10 +00:00
|
|
|
|
|
|
|
bottle do
|
|
|
|
cellar :any
|
2016-11-30 11:10:41 +00:00
|
|
|
sha256 "cd843f07c21db43f1d38a1651b371a53ccd4c44975c08d56db0d6a4284c9d587" => :sierra
|
|
|
|
sha256 "89d3c3cc1ce2d45b37a6c8001c047b46135111419c27e27377a0158fd0685ebf" => :el_capitan
|
|
|
|
sha256 "4cabfd9f2086b49b21bac869d061b0bd467f8cbef378f16f23c4b3019f655c05" => :yosemite
|
2016-11-30 10:24:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
depends_on "cmake" => :build
|
2016-11-30 10:25:09 +00:00
|
|
|
depends_on "qt5"
|
2016-11-30 10:24:10 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "cmake", ".", *std_cmake_args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
2016-11-30 10:25:09 +00:00
|
|
|
#include <qjson-qt5/parser.h>
|
2016-11-30 10:24:10 +00:00
|
|
|
int main() {
|
|
|
|
QJson::Parser parser;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2016-11-30 10:25:09 +00:00
|
|
|
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11", "-I#{include}",
|
|
|
|
"-L#{lib}", "-lqjson-qt5",
|
|
|
|
"-I#{Formula["qt5"].opt_include}",
|
|
|
|
"-F#{Formula["qt5"].opt_lib}", "-framework", "QtCore"
|
2016-11-30 10:24:10 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|