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" bottle do cellar :any sha256 "0a8ab56e634a686654b83cfa5a94ea7a388bc19149372fceea54663cbad029f9" => :mojave sha256 "44db0195483e874f8c8fc7ed4bb6e6f82bf31b17536859fdf2189dcedf70ca1e" => :high_sierra sha256 "61c7fa8f31268fa382b5bdc99d37f5d463aa673e661db562458dc34d599be75c" => :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" conflicts_with "pincaster", :because => "both install `event_rpcgen.py` binaries" 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 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