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.30.0.tar.gz" sha256 "44c8fdadf3b3f393006a4ac4ba144020673a3f9cd72bed1fbb2c366ebcf0d199" head "https://github.com/libuv/libuv.git", :branch => "v1.x" bottle do cellar :any sha256 "2be7b463e83611319cbe311aa3b0242765a2a0a802b1c18861d657159f8a0329" => :mojave sha256 "9caf2d3439a25b3ff9b369636be30843b5309f07690e462d8a03e824b9e90ee9" => :high_sierra sha256 "ea5c2c70d7920875f0fdf0326a6a184c672039f88b4141f1a8540a9d4ee09320" => :sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "pkg-config" => :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", "install" end test do (testpath/"test.c").write <<~EOS #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", "-L#{lib}", "-luv", "-o", "test" system "./test" end end