homebrew-core/Formula/liblcf.rb
2017-12-05 23:19:43 -08:00

47 lines
1.5 KiB
Ruby

class Liblcf < Formula
desc "Library for RPG Maker 2000/2003 games data"
homepage "https://easyrpg.org/"
url "https://github.com/EasyRPG/liblcf/archive/0.5.3.tar.gz"
sha256 "4d2784ab927e2f61595b8efeb61664bcc64b3f746d12c893e302645dda3acddc"
revision 1
head "https://github.com/EasyRPG/liblcf.git"
bottle do
cellar :any
sha256 "d786156862ef590c591e8fd43b5dd8cce5e0d8f88777fbb080ab57d4365e742d" => :high_sierra
sha256 "9578cac708bf4bad4df6eb3aa7672d20793956d7c9246699eebf2f4e8241f182" => :sierra
sha256 "2d00352d1b55fcd5265e6f770f7f906be65b7fa2aa6f041807e50968a8137198" => :el_capitan
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "icu4c"
depends_on "expat"
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 <cassert>
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