homebrew-core/Formula/liblcf.rb
2017-02-08 10:08:54 +00: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.0.tar.gz"
sha256 "27333416afd5069429d5a81fd032faad6f8fe60bd1bfe0ac3240c1496dce90f2"
revision 1
head "https://github.com/EasyRPG/liblcf.git"
bottle do
cellar :any
sha256 "b3157783da712d9e7e159a0f7bb654e01384813613befa9eda8488940df658c7" => :sierra
sha256 "6243f9c34e36b4ddd2cd078c79934dc57d1498b5ab1645a7a5f38fb4fd45e55f" => :el_capitan
sha256 "c7db4406fa2035cdf5b5ff527a28799e2a068d7738e9452ae1bef1e88331d599" => :yosemite
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.undent
#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