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.10.0.tar.gz" sha256 "50f4ed57d65af4ab634e2cbdd90c49213020e15b4d77d3631feb633cbba9239f" head "https://github.com/libuv/libuv.git", :branch => "v1.x" bottle do cellar :any rebuild 1 sha256 "e2d8c642d1a099ffcaaef6adeb35c954b2d3431f5db6eedeb2c722700277a4a4" => :sierra sha256 "dcdbd29ff34f2c9c6508bdb19e40de92e9e909c39a44e805ce95d4f0438a92d9" => :el_capitan sha256 "6bf8bfd9b156f56f7c3f129fe3fc4cd0e98782b0c55de6332232dac2303baf9f" => :yosemite 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