class Liblcf < Formula desc "Library for RPG Maker 2000/2003 games data" homepage "https://easyrpg.org/" url "https://github.com/EasyRPG/liblcf/archive/0.6.1.tar.gz" sha256 "224068ede007098d8fad45348da3b47f00a33d5e8a4a693514d5c9290ab1883f" head "https://github.com/EasyRPG/liblcf.git" bottle do cellar :any sha256 "a66e048d476e54e3358ac0dae6bf2f8c86ef62596be798b03cc6b05adcbffdcc" => :catalina sha256 "af1b2189ec52ff85cd7bbf53aee54c988bf933bb36333194831ffeb873a2d514" => :mojave sha256 "400b4d459f287f0c935233a25298cbe3d4ca6b2d2a6f09bb75fd95b917fff811" => :high_sierra sha256 "c27dea64d039f5dc4ed3d57f17c85035b95a3426bbc687edf35aba2d03801bf1" => :sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "expat" depends_on "icu4c" def install system "autoreconf", "-i" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "check" system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include "lsd_reader.h" #include int main() { std::time_t const current = std::time(NULL); assert(current == LSD_Reader::ToUnixTimestamp(LSD_Reader::ToTDateTime(current))); return 0; } EOS system ENV.cc, "test.cpp", "-I#{include}/liblcf", "-L#{lib}", "-llcf", "-std=c++11", \ "-o", "test" system "./test" end end