homebrew-core/Formula/libevent.rb
2019-09-09 09:38:35 +02:00

50 lines
1.5 KiB
Ruby

class Libevent < Formula
desc "Asynchronous event library"
homepage "https://libevent.org/"
url "https://github.com/libevent/libevent/archive/release-2.1.11-stable.tar.gz"
sha256 "229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e"
revision 1
bottle do
cellar :any
sha256 "1e14fc34baae0b65cac6d7c75bc5ed0ccb1f6bbaa30c8f0f8477ab8ba85fb3c5" => :mojave
sha256 "89df3b053409a11d520e9ca88aed17221416c60c5799ec51813f8c2c7e3536de" => :high_sierra
sha256 "a9bddcb861a3464a0e9111926e4cb8d932ad860540f571edb74d448ef5a54811" => :sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "doxygen" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "openssl@1.1"
def install
inreplace "Doxyfile", /GENERATE_MAN\s*=\s*NO/, "GENERATE_MAN = YES"
system "./autogen.sh"
system "./configure", "--disable-dependency-tracking",
"--disable-debug-mode",
"--prefix=#{prefix}"
system "make"
system "make", "install"
system "make", "doxygen"
man3.install Dir["doxygen/man/man3/*.3"]
doc.install Dir["doxygen/html/*"]
end
test do
(testpath/"test.c").write <<~EOS
#include <event2/event.h>
int main()
{
struct event_base *base;
base = event_base_new();
event_base_free(base);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-levent", "-o", "test"
system "./test"
end
end