homebrew-core/Formula/pidgin.rb

92 lines
3.2 KiB
Ruby

class Pidgin < Formula
desc "Multi-protocol chat client"
homepage "https://pidgin.im/"
url "https://downloads.sourceforge.net/project/pidgin/Pidgin/2.14.8/pidgin-2.14.8.tar.bz2"
sha256 "3f8085c0211c4ca1ba9f8a03889b3d60738432c1673b57b0086070ef6e094cca"
license "GPL-2.0-or-later"
livecheck do
url "https://sourceforge.net/projects/pidgin/files/Pidgin/"
regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/?["' >]}i)
strategy :page_match
end
bottle do
sha256 arm64_monterey: "6d599427835355c185246b8280881ec639fd76b6a29b303fb88138bb468aacad"
sha256 arm64_big_sur: "c848ea93d573f4104a7a7edf23c41d159ac5070e36f08d84e14d65af4a5a3bef"
sha256 monterey: "8bdf97ea93acf5243579d8138ffcd76b8c426cc2d38440e895ec6993d9b52d65"
sha256 big_sur: "309a8ac7ee4e09f884ad79985d23895d77ddec13197a71ed764f73f9984d9175"
sha256 catalina: "fbea5ba3a0051d76282289dadc36ec61d0c466aa1dda6358ccae7a8f12f48b42"
sha256 mojave: "10159d6af23b8603b31160d0eba5dd689693e1cf8a6486e032ee0fc34dbbc703"
end
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "gettext"
depends_on "gnutls"
depends_on "gtk+"
depends_on "libgcrypt"
depends_on "libgnt"
depends_on "libidn"
depends_on "libotr"
depends_on "pango"
# Finch has an equal port called purple-otr but it is a NIGHTMARE to compile
# If you want to fix this and create a PR on Homebrew please do so.
resource "pidgin-otr" do
url "https://otr.cypherpunks.ca/pidgin-otr-4.0.2.tar.gz"
sha256 "f4b59eef4a94b1d29dbe0c106dd00cdc630e47f18619fc754e5afbf5724ebac4"
end
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--disable-avahi
--disable-dbus
--disable-doxygen
--disable-gevolution
--disable-gstreamer
--disable-gstreamer-interfaces
--disable-gtkspell
--disable-meanwhile
--disable-vv
--enable-gnutls=yes
--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework
--with-tkconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tk.framework
--without-x
]
ENV["ac_cv_func_perl_run"] = "yes" if MacOS.version == :high_sierra
# patch pidgin to read plugins and allow them to live in separate formulae which can
# all install their symlinks into these directories. See:
# https://github.com/Homebrew/homebrew-core/pull/53557
inreplace "finch/finch.c", "LIBDIR", "\"#{HOMEBREW_PREFIX}/lib/finch\""
inreplace "libpurple/plugin.c", "LIBDIR", "\"#{HOMEBREW_PREFIX}/lib/purple-2\""
inreplace "pidgin/gtkmain.c", "LIBDIR", "\"#{HOMEBREW_PREFIX}/lib/pidgin\""
inreplace "pidgin/gtkutils.c", "DATADIR", "\"#{HOMEBREW_PREFIX}/share\""
system "./configure", *args
system "make", "install"
resource("pidgin-otr").stage do
ENV.prepend "CFLAGS", "-I#{Formula["libotr"].opt_include}"
ENV.append_path "PKG_CONFIG_PATH", "#{lib}/pkgconfig"
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
system "make", "install"
end
end
test do
system "#{bin}/finch", "--version"
system "#{bin}/pidgin", "--version"
pid = fork { exec "#{bin}/pidgin", "--config=#{testpath}" }
sleep 5
Process.kill "SIGTERM", pid
end
end