2010-04-07 16:26:37 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Valgrind < Formula
|
2010-04-07 16:26:37 +00:00
|
|
|
homepage 'http://www.valgrind.org/'
|
2010-08-12 04:08:44 +00:00
|
|
|
|
2011-11-09 20:31:04 +00:00
|
|
|
# Valgrind 3.7.0 drops support for OS X 10.5
|
2012-08-11 03:23:03 +00:00
|
|
|
if MacOS.version >= 10.6
|
2012-09-25 23:22:28 +00:00
|
|
|
url 'http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2'
|
|
|
|
sha1 'aa7a3b0b9903f59a11ae518874852e8ccb12751c'
|
2011-11-09 20:31:04 +00:00
|
|
|
else
|
|
|
|
url "http://valgrind.org/downloads/valgrind-3.6.1.tar.bz2"
|
|
|
|
md5 "2c3aa122498baecc9d69194057ca88f5"
|
|
|
|
end
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2012-08-11 03:23:03 +00:00
|
|
|
head 'svn://svn.valgrind.org/valgrind/trunk'
|
|
|
|
|
|
|
|
if build.head?
|
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
2010-10-13 13:25:33 +00:00
|
|
|
skip_clean 'lib'
|
|
|
|
|
2012-09-02 02:00:17 +00:00
|
|
|
def patches
|
2012-09-25 23:22:28 +00:00
|
|
|
# 1: For Xcode-only systems, we have to patch hard-coded paths, use xcrun &
|
|
|
|
# add missing CFLAGS. See: https://bugs.kde.org/show_bug.cgi?id=295084
|
|
|
|
# 2: Fix for 10.7.4 w/XCode-4.5, duplicate symbols. Reported upstream in
|
|
|
|
# https://bugs.kde.org/show_bug.cgi?id=307415
|
|
|
|
p = []
|
|
|
|
p << 'https://gist.github.com/raw/3784836/f046191e72445a2fc8491cb6aeeabe84517687d9/patch1.diff' unless MacOS::CLT.installed?
|
|
|
|
p << 'https://gist.github.com/raw/3784930/dc8473c0ac5274f6b7d2eb23ce53d16bd0e2993a/patch2.diff' if MacOS.version == :lion
|
|
|
|
return p.empty? ? nil : p
|
|
|
|
end
|
2012-09-02 02:00:17 +00:00
|
|
|
|
2010-08-12 04:08:44 +00:00
|
|
|
def install
|
2012-09-25 23:22:28 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
2011-11-09 23:26:43 +00:00
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
args << "--enable-only64bit" << "--build=amd64-darwin"
|
|
|
|
else
|
|
|
|
args << "--enable-only32bit"
|
|
|
|
end
|
2010-08-12 04:08:44 +00:00
|
|
|
|
2012-08-11 03:23:03 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2010-08-12 04:08:44 +00:00
|
|
|
system "./configure", *args
|
2012-09-25 23:22:28 +00:00
|
|
|
system 'make'
|
2010-08-12 04:08:44 +00:00
|
|
|
system "make install"
|
2010-04-07 16:26:37 +00:00
|
|
|
end
|
2011-05-08 11:56:49 +00:00
|
|
|
|
2011-11-09 20:31:04 +00:00
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/valgrind", "ls", "-l"
|
2011-11-09 20:31:04 +00:00
|
|
|
end
|
2011-11-09 23:26:43 +00:00
|
|
|
end
|