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.25.0.tar.gz"
|
|
sha256 "ce3036d444c3fb4f9a9e2994bec1f4fa07872b01456998b422ce918fdc55c254"
|
|
head "https://github.com/libuv/libuv.git", :branch => "v1.x"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "3a7417b6cb8f6a6c05a8abc649e667188728873e103af2902c84f6eac4d69a64" => :mojave
|
|
sha256 "d703cb826103401469a05ea8fcb0fa9cbbe7ab592d414afdef2c81531ee65d7b" => :high_sierra
|
|
sha256 "9cd7c61d434dfdcc24f6068971272f6395fcc7de0432f3ec01be2bf87a16592a" => :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
|