forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zlib.rb
37 lines (30 loc) · 900 Bytes
/
zlib.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'formula'
class Zlib < Formula
homepage 'http://www.zlib.net/'
url 'http://zlib.net/zlib-1.2.8.tar.gz'
mirror 'https://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz'
sha1 'a4d316c404ff54ca545ea71a27af7dbc29817088'
keg_only :provided_by_osx
option :universal
# configure script fails to detect the right compiler when "cc" is
# clang, not gcc. zlib mantainers have been notified of the issue.
# See: https://github.com/Homebrew/homebrew-dupes/pull/228
patch :DATA
def install
ENV.universal_binary if build.universal?
system "./configure", "--prefix=#{prefix}"
system "make install"
end
end
__END__
diff --git a/configure b/configure
index b77a8a8..54f33f7 100755
--- a/configure
+++ b/configure
@@ -159,6 +159,7 @@ case "$cc" in
esac
case `$cc -v 2>&1` in
*gcc*) gcc=1 ;;
+ *clang*) gcc=1 ;;
esac
show $cc -c $test.c