class Libuv < Formula desc "Multi-platform support library with a focus on asynchronous I/O" homepage "https://github.com/libuv/libuv" url "https://github.com/libuv/libuv/archive/v1.13.0.tar.gz" sha256 "e084937b2753de250ce9999b9924c22a1fba33b8499e64e44e2e2cff34f1642a" head "https://github.com/libuv/libuv.git", :branch => "v1.x" bottle do cellar :any sha256 "ffa1fbff68f28afc31050aeff66b21b695834361882e66f594309df74191ce09" => :sierra sha256 "45c605c73b6d599f4826ebfa2660cd20c4b16d64d2a019ed583bd81b7cb0b783" => :el_capitan sha256 "b02527e44b929b79b4f887d8c7be2ded4f778e313ccf6d708843bf0506b00923" => :yosemite end option "with-test", "Execute compile time checks (Requires Internet connection)" deprecated_option "with-check" => "with-test" depends_on "pkg-config" => :build depends_on "automake" => :build depends_on "autoconf" => :build depends_on "libtool" => :build depends_on "sphinx-doc" => :build def install # This isn't yet handled by the make install process sadly. cd "docs" do system "make", "man" system "make", "singlehtml" man1.install "build/man/libuv.1" doc.install Dir["build/singlehtml/*"] end system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make" system "make", "check" if build.with? "test" system "make", "install" end test do (testpath/"test.c").write <<-EOS.undent #include #include int main() { uv_loop_t* loop = malloc(sizeof *loop); uv_loop_init(loop); uv_loop_close(loop); free(loop); return 0; } EOS system ENV.cc, "test.c", "-luv", "-o", "test" system "./test" end end