class Irssi < Formula desc "Modular IRC client" homepage "https://irssi.org/" url "https://github.com/irssi/irssi/releases/download/1.2.2/irssi-1.2.2.tar.xz" sha256 "6727060c918568ba2ff4295ad736128dba0b995d7b20491bca11f593bd857578" bottle do sha256 "c8dda1f1cd62fc666406f3db68a9a34cd16ce4acce1082db45d7b575af5860be" => :mojave sha256 "de978c2c68c4254d5fea004006201743cfcf686c76a56cba62ab72a7bf0d9936" => :high_sierra sha256 "b0ea780071ba74669e4f31db648ca4b5de95d3372cb0fc73d41a90e2b6c6947a" => :sierra end head do url "https://github.com/irssi/irssi.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "lynx" => :build end depends_on "pkg-config" => :build depends_on "glib" depends_on "openssl@1.1" uses_from_macos "perl" def install ENV.delete "HOMEBREW_SDKROOT" if MacOS.version == :high_sierra args = %W[ --disable-dependency-tracking --prefix=#{prefix} --sysconfdir=#{etc} --with-bot --with-proxy --enable-true-color --with-socks=no --with-ncurses=#{MacOS.sdk_path}/usr --with-perl=yes --with-perl-lib=#{lib}/perl5/site_perl ] if build.head? ENV["NOCONFIGURE"] = "yes" system "./autogen.sh", *args end system "./configure", *args # "make" and "make install" must be done separately on some systems system "make" system "make", "install" end test do IO.popen("#{bin}/irssi --connect=irc.freenode.net", "w") do |pipe| pipe.puts "/quit\n" pipe.close_write end # This is not how you'd use Perl with Irssi but it is enough to be # sure the Perl element didn't fail to compile, which is needed # because upstream treats Perl build failures as non-fatal. # To debug a Perl problem copy the following test at the end of the install # block to surface the relevant information from the build warnings. ENV["PERL5LIB"] = lib/"perl5/site_perl" system "perl", "-e", "use Irssi" end end