homebrew-core/Formula/unibilium.rb
2017-08-27 22:49:57 -07:00

37 lines
1.1 KiB
Ruby

class Unibilium < Formula
desc "Very basic terminfo library."
homepage "https://github.com/mauke/unibilium"
url "https://github.com/mauke/unibilium/archive/v1.2.1.tar.gz"
sha256 "6045b4f6adca7b1123284007675ca71f718f70942d3a93d8b9fa5bd442006ec1"
bottle do
cellar :any
sha256 "53b708223a2e95298390b6313ff4917f10efefc3cf349eb57688938f982ee487" => :sierra
sha256 "5c4b97baf010a4d3482f7270e313a274a281df71beb55a8ce69b473611c955ae" => :el_capitan
sha256 "a43da6e759273b81f501077deb01633b54591a907e2cef40ba81b1611af5692e" => :yosemite
end
depends_on "libtool" => :build
def install
system "make"
system "make", "install", "PREFIX=#{prefix}"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <unibilium.h>
#include <stdio.h>
int main()
{
setvbuf(stdout, NULL, _IOLBF, 0);
unibi_term *ut = unibi_dummy();
unibi_destroy(ut);
return 0;
}
EOS
system ENV.cc, "-I#{include}", "test.c", "-L#{lib}", "-lunibilium", "-o", "test"
system "./test"
end
end