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.9.1.tar.gz" sha256 "a6ca9f0648973d1463f46b495ce546ddcbe7cce2f04b32e802a15539e46c57ad" head "https://github.com/libuv/libuv.git", :branch => "v1.x" bottle do cellar :any sha256 "abd14bc1902fc465ac4bec515103fdcc5fe84d360cf1152331a169b7658f2d67" => :sierra sha256 "68d0bcd528b8f6ee33759919f8c7f7110095a64ce6cff13ddd08d8d369220dc7" => :el_capitan sha256 "c11095dcf9722f98efedfe6ba5d74b3bb2b99e34e8003f129e7fa97e8a60f391" => :yosemite sha256 "31388adf64b6dcbabed5d69727a4ee7ed64de0b4cf6a5c7868992e05669990c7" => :mavericks end option "without-docs", "Don't build and install documentation" option "with-test", "Execute compile time checks (Requires Internet connection)" option :universal 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 if build.with? "docs" def install ENV.universal_binary if build.universal? if build.with? "docs" # 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 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