55 lines
1.6 KiB
Ruby
55 lines
1.6 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.30.1.tar.gz"
|
|
sha256 "d85566c2c4eae7d8e2c2d27d40e728fea29f9086e98e795c5cdce1a790f43de5"
|
|
head "https://github.com/libuv/libuv.git", :branch => "v1.x"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "a7c0a80eb3050913c1841fdc9da04e140965102e47550d43f46e8517e0ec4b08" => :mojave
|
|
sha256 "fdce5416ab53843eed73712e05310f2d83da403fdef7bcfb56bfb43553779e8c" => :high_sierra
|
|
sha256 "7e375b70ed5a1e418415fde22d4ada98dd4a8d8b35aadb75d3fe2248c8d6cc07" => :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 <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
|