homebrew-core/Formula/liblcf.rb
2017-10-22 13:58:41 -07:00

46 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"
head "https://github.com/EasyRPG/liblcf.git"
bottle do
cellar :any
sha256 "aba0528a3bb0c2a7fd7e9d0a4ac69fe761cfba96e8264bc0aa475459def0c31e" => :high_sierra
sha256 "0eac25355db71df9fefb9965ee85ab701a768f93fa0b7dfcdddf50aee1c05169" => :sierra
sha256 "004f49f2a08e895bf81d038d8280545037ac516740b38237360517d11887d3d9" => :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