60 lines
1.8 KiB
Ruby
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.19.0.tar.gz"
|
|
sha256 "37c94b934dce14fcee94f82ecceefaf806ac0601d07bf7148a3bdb35e249e957"
|
|
head "https://github.com/libuv/libuv.git", :branch => "v1.x"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "15a7178d95359c8feac6c6dd6187b47eb2f9f1284e25c9a3422c0c4a74ea411d" => :high_sierra
|
|
sha256 "4e343005f118f66c8a69b3cce30b3b5b4406ea49de9a2793274191f99fb20721" => :sierra
|
|
sha256 "36198d95d6936a29fed4a0a4f1703e5edfcaffef307b63357f54a7ba9eb272d5" => :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
|