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/'
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2014-02-18 22:49:02 +00:00
|
|
|
stable do
|
|
|
|
url 'http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2'
|
|
|
|
sha1 '9415e28933de9d6687f993c4bb797e6bd49583f1'
|
|
|
|
|
|
|
|
if MacOS.version == :mavericks
|
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
head do
|
|
|
|
url 'svn://svn.valgrind.org/valgrind/trunk'
|
|
|
|
|
2012-08-11 03:23:03 +00:00
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
2013-09-24 03:15:19 +00:00
|
|
|
depends_on :macos => :snow_leopard
|
|
|
|
|
2012-10-25 12:00:43 +00:00
|
|
|
# Valgrind needs vcpreload_core-*-darwin.so to have execute permissions.
|
|
|
|
# See #2150 for more information.
|
|
|
|
skip_clean 'lib/valgrind'
|
|
|
|
|
2014-03-17 03:56:01 +00:00
|
|
|
# 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
|
|
|
|
patch do
|
|
|
|
url "https://gist.github.com/raw/3784836/f046191e72445a2fc8491cb6aeeabe84517687d9/patch1.diff"
|
|
|
|
sha1 "a2252d977302a37873b0f2efe8aa4a4fed2eb2c2"
|
2014-04-01 23:40:20 +00:00
|
|
|
end
|
2014-03-17 03:56:01 +00:00
|
|
|
|
|
|
|
# Fix for 10.7.4 w/XCode-4.5, duplicate symbols. Reported upstream in
|
|
|
|
# https://bugs.kde.org/show_bug.cgi?id=307415
|
|
|
|
patch do
|
|
|
|
url "https://gist.github.com/raw/3784930/dc8473c0ac5274f6b7d2eb23ce53d16bd0e2993a/patch2.diff"
|
|
|
|
sha1 "6e57aa087fafd178b594e22fd0e00ea7c0eed438"
|
|
|
|
end if MacOS.version == :lion
|
|
|
|
|
|
|
|
# Fix for 10.9 Mavericks. From upstream bug:
|
|
|
|
# https://bugs.kde.org/show_bug.cgi?id=326724#c12
|
2014-03-17 04:07:45 +00:00
|
|
|
patch :p0 do
|
2014-03-17 03:56:01 +00:00
|
|
|
url "http://bugsfiles.kde.org/attachment.cgi?id=83590"
|
|
|
|
sha1 "22819a4a02140974e6330f3521b240b68f1619d7"
|
|
|
|
end if MacOS.version == :mavericks
|
2012-09-02 02:00:17 +00:00
|
|
|
|
2014-04-08 15:25:45 +00:00
|
|
|
# Fix for Snow Leopard from MacPorts
|
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/118697/trunk/dports/devel/valgrind/files/patch-compat-snowleo.diff"
|
|
|
|
sha1 "ca22f4d49cfc9ea87469c2138b86c71f4b6b4d4d"
|
|
|
|
end
|
|
|
|
|
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
|
|
|
|
2014-01-21 02:30:12 +00:00
|
|
|
system "./autogen.sh" if build.head? || MacOS.version == :mavericks
|
2010-08-12 04:08:44 +00:00
|
|
|
system "./configure", *args
|
2014-01-21 02:30:12 +00:00
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2010-04-07 16:26:37 +00:00
|
|
|
end
|
2011-05-08 11:56:49 +00:00
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
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
|