loudmouth: system openssl fix

Loudmouth has been tapping the system OpenSSL. I was going to keep
offering both, but upstream recommend using GnuTLS instead, so I’ve
just switched to that, externalised the patch to the upstream commit,
and revisioned to get people off of using the depreciated system
OpenSSL.

Closes Homebrew/homebrew#34254.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Dominyk Tiller 2014-11-17 07:54:18 +00:00 committed by Mike McQuaid
parent 9d8aed9840
commit 0d74e41629

View file

@ -1,52 +1,28 @@
require 'formula'
require "formula"
class Loudmouth < Formula
homepage 'http://mcabber.com'
url 'http://mcabber.com/files/loudmouth-1.5.0-20121201.tar.bz2'
version '1.5.0.20121201'
sha1 '502963c3068f7033bb21d788918c1e5cd14f386e'
homepage "http://mcabber.com"
url "http://mcabber.com/files/loudmouth-1.5.0-20121201.tar.bz2"
version "1.5.0.20121201"
sha1 "502963c3068f7033bb21d788918c1e5cd14f386e"
revision 1
option 'with-gnutls', "Use GnuTLS instead of the default OpenSSL"
depends_on 'pkg-config' => :build
depends_on 'glib'
depends_on 'gnutls' => :optional
depends_on 'libidn'
depends_on "pkg-config" => :build
depends_on "glib"
depends_on "libidn"
depends_on "gnutls"
# Fix compilation on 10.9. Sent upstream:
# https://github.com/mcabber/loudmouth/pull/9
patch :DATA
# Has been merged and will be in next release, if there is one.
patch do
url "https://github.com/mcabber/loudmouth/commit/369844a0fc.diff"
sha1 "e52ee2e24a06ebea52b90866a347daf1f1d28382"
end
def install
args = ["--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}"]
if build.with? 'gnutls'
args << "--with-ssl=gnutls"
else
args << "--with-ssl=openssl"
end
system "./configure", *args
system "make install"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}", "--with-ssl=gnutls"
system "make", "install"
end
end
__END__
diff --git a/loudmouth/lm-sock.c b/loudmouth/lm-sock.c
index f3a2803..6e99eca 100644
--- a/loudmouth/lm-sock.c
+++ b/loudmouth/lm-sock.c
@@ -314,6 +314,13 @@ gboolean
_lm_sock_set_keepalive (LmOldSocketT sock, int delay)
{
#ifdef USE_TCP_KEEPALIVES
+
+#ifdef __APPLE__
+#ifndef TCP_KEEPIDLE
+#define TCP_KEEPIDLE TCP_KEEPALIVE
+#endif
+#endif
+
int opt;
opt = 1;