homebrew-core/Formula/libuv.rb
2018-04-19 00:06:21 -07:00

60 lines
1.8 KiB
Ruby

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.20.1.tar.gz"
sha256 "abc9106789c15a1c8009ab3d114a5b44bd6e240b183240f47e28aa542eea07b4"
head "https://github.com/libuv/libuv.git", :branch => "v1.x"
bottle do
cellar :any
sha256 "9dcffb11c132d5c3fddd6f80325b6491f9a3f265235a498614d16dde9c7b8ecf" => :high_sierra
sha256 "50d7efd713906cf22dffdd98e1e6f7da7e3111780e76337661406fc6b705699c" => :sierra
sha256 "54b462d994767e6d4760b1226be8a54de03ac3c7883c9311d840efa76c0f771d" => :el_capitan
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
#include <uv.h>
#include <stdlib.h>
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