homebrew-core/Formula/cheapglk.rb

48 lines
1.4 KiB
Ruby
Raw Normal View History

2017-02-06 10:26:50 +00:00
class Cheapglk < Formula
desc "Extremely minimal Glk library"
homepage "http://www.eblong.com/zarf/glk/index.html"
url "http://www.eblong.com/zarf/glk/cheapglk-106.tar.gz"
version "1.0.6"
sha256 "2753562a173b4d03ae2671df2d3c32ab7682efd08b876e7e7624ebdc8bf1510b"
2017-02-06 10:26:50 +00:00
bottle do
cellar :any_skip_relocation
2017-09-18 15:10:18 +00:00
sha256 "47c6f59d902a306b30c6255f65fd7626e32d5c39800fd80daeada852e95994f2" => :high_sierra
2017-05-02 17:47:45 +00:00
sha256 "d76d29db8ea0201fcef949e02cbddb1c06311dece796a263192ffef487a3aa2c" => :sierra
sha256 "497a5399738c026d318d3213b764f20fb80ccea94181919fad2e80eb75086055" => :el_capitan
sha256 "8351c9dec39fd8e860e50a8e693e1c648def81c3ddcbdd3a856f656d585b0082" => :yosemite
2017-02-06 10:26:50 +00:00
end
keg_only "it conflicts with other Glk libraries"
2017-02-06 10:26:50 +00:00
def install
system "make"
lib.install "libcheapglk.a"
include.install "glk.h", "glkstart.h", "gi_blorb.h", "gi_dispa.h", "Make.cheapglk"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include "glk.h"
#include "glkstart.h"
glkunix_argumentlist_t glkunix_arguments[] = {
{ NULL, glkunix_arg_End, NULL }
};
int glkunix_startup_code(glkunix_startup_t *data)
{
return TRUE;
}
void glk_main()
{
glk_exit();
}
EOS
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcheapglk", "-o", "test"
assert_match version.to_s, pipe_output("./test", "echo test", 0)
2017-02-06 10:26:50 +00:00
end
end