snownews: add openssl dependency

Also hacks the configure script so brewed openssl can take precedence
Uses EXTRA_LDFLAGS instead of a patch to supply "-lz", to simplify formula.

Closes Homebrew/homebrew#44001.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
Andrew Janke 2015-09-16 01:15:46 -05:00 committed by Dominyk Tiller
parent 84840fa147
commit cf7a7f1ad2

View file

@ -3,16 +3,17 @@ class Snownews < Formula
homepage "https://kiza.eu/software/snownews"
url "https://kiza.eu/media/software/snownews/snownews-1.5.12.tar.gz"
sha256 "26dd96e9345d9cbc1c0c9470417080dd0c3eb31e7ea944f78f3302d7060ecb90"
revision 1
option "without-nls", "Build without translations"
depends_on "gettext" if build.with? "nls"
depends_on "openssl"
# Fix zlib linking issue on OS X
# snownews author assisted on quest creating this working Formula.
# Author is aware of the issue tackled. However, no statement has been made whether
# any future release will change to a more (homebrew) robust = cleaner = simpler basis.
# homebrew reference added on 2013-07-06 to https://kiza.eu/software/snownews/downloading
# Fix system openssl linking error on OS X.
# Allow EXTRA_LDFLAGS to take precedence so we can link brewed openssl
# instead of deprecated system openssl.
# Upstream has been notified but has no public bug tracker
patch :DATA
def install
@ -20,21 +21,23 @@ class Snownews < Formula
args << "--disable-nls" if build.without? "nls"
system "./configure", *args
system "make", "install", "EXTRA_LDFLAGS=#{ENV.ldflags}", "CC=#{ENV.cc}"
# Must supply -lz because snownews configure relies on "xml2-config --libs" for
# it, which doesn't work on OS X prior to 10.11
system "make", "install", "EXTRA_LDFLAGS=#{ENV.ldflags} -L#{Formula["openssl"].opt_lib} -lz", "CC=#{ENV.cc}"
end
end
__END__
diff --git a/configure b/configure
index a752cd6..296a282 100755
index a752cd6..74e61d7 100755
--- a/configure
+++ b/configure
@@ -33,7 +33,7 @@ if (lc($os) eq "linux") {
if ($use_nls == 1) {
$ldflags .= ' -lintl ';
}
- $ldflags .= ' -liconv';
+ $ldflags .= ' -liconv -lz';
} elsif (lc($os) =~ /cygwin/) {
print "Configuring for a Cygwin system... ";
$cflags = $cflags.' -DSTATIC_CONST_ICONV -I/usr/include/libxml2';
@@ -13,7 +13,7 @@ chomp($xmlldflags);
my $prefix = "/usr/local";
my $cflags = "-Wall -Wno-format-y2k -O2 -DLOCALEPATH=\"\\\"\$(LOCALEPATH)\\\"\" -DOS=\\\"$os\\\" $xmlcflags \$(EXTRA_CFLAGS) ";
-my $ldflags = "-lncurses -lcrypto $xmlldflags \$(EXTRA_LDFLAGS) ";
+my $ldflags = "\$(EXTRA_LDFLAGS) -lncurses -lcrypto $xmlldflags ";
my $use_nls = 1;
parse_cmdl_line();