class Libyaml < Formula desc "YAML Parser" homepage "https://github.com/yaml/libyaml" url "https://github.com/yaml/libyaml/archive/0.2.5.tar.gz" sha256 "fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e" license "MIT" livecheck do url "https://github.com/yaml/libyaml/releases/latest" regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i) end bottle do cellar :any sha256 "56d3549b342cffb181e3eb05356697bbb362b9733c73e0eeff9b637ecf92cd23" => :catalina sha256 "a04988b3868cfadf7bcaff6b753b59388cbea70b38f2fa41a25229150d073696" => :mojave sha256 "d3e22ad09c3d6872c5f7ee7c7f1146c9f14c178ff4c3a3488a20bf584bc854d5" => :high_sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build def install system "./bootstrap" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main() { yaml_parser_t parser; yaml_parser_initialize(&parser); yaml_parser_delete(&parser); return 0; } EOS system ENV.cc, "test.c", "-L#{lib}", "-lyaml", "-o", "test" system "./test" end end