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
|
|
|
|
url 'http://valgrind.org/downloads/valgrind-3.8.0.tar.bz2'
|
|
|
|
sha1 '074b09e99b09634f1efa6f7f0f87c7a541fb9b0d'
|
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
|
|
|
|
# For Xcode-only systems, we have to patch hard-coded paths, use xcrun and
|
|
|
|
# add missing CFLAGS. See: https://bugs.kde.org/show_bug.cgi?id=295084
|
|
|
|
DATA
|
|
|
|
end unless MacOS::CLT.installed?
|
|
|
|
|
2010-08-12 04:08:44 +00:00
|
|
|
def install
|
2012-08-23 21:12:30 +00:00
|
|
|
# avoid undefined symbol __bzero
|
|
|
|
ENV.remove_from_cflags "-mmacosx-version-min=#{MacOS.version}"
|
2012-08-11 03:23:03 +00:00
|
|
|
|
2010-08-24 17:28:40 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
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-02 02:00:17 +00:00
|
|
|
system "make", "AR=ar" # have to set AR or valgrind picks cc (WTF?)
|
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
|
2012-09-02 02:00:17 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/coregrind/Makefile.in b/coregrind/Makefile.in
|
|
|
|
index d62cf92..477b069 100644
|
|
|
|
--- a/coregrind/Makefile.in
|
|
|
|
+++ b/coregrind/Makefile.in
|
|
|
|
@@ -82,10 +82,10 @@ bin_PROGRAMS = valgrind$(EXEEXT) vgdb$(EXEEXT)
|
|
|
|
@VGCONF_OS_IS_DARWIN_TRUE@ m_mach/vm_map.h
|
|
|
|
|
|
|
|
@VGCONF_OS_IS_DARWIN_TRUE@am__append_10 = \
|
|
|
|
-@VGCONF_OS_IS_DARWIN_TRUE@ /usr/include/mach/mach_vm.defs \
|
|
|
|
-@VGCONF_OS_IS_DARWIN_TRUE@ /usr/include/mach/task.defs \
|
|
|
|
-@VGCONF_OS_IS_DARWIN_TRUE@ /usr/include/mach/thread_act.defs \
|
|
|
|
-@VGCONF_OS_IS_DARWIN_TRUE@ /usr/include/mach/vm_map.defs
|
|
|
|
+@VGCONF_OS_IS_DARWIN_TRUE@ $(HOMEBREW_SDKROOT)/usr/include/mach/mach_vm.defs \
|
|
|
|
+@VGCONF_OS_IS_DARWIN_TRUE@ $(HOMEBREW_SDKROOT)/usr/include/mach/task.defs \
|
|
|
|
+@VGCONF_OS_IS_DARWIN_TRUE@ $(HOMEBREW_SDKROOT)/usr/include/mach/thread_act.defs \
|
|
|
|
+@VGCONF_OS_IS_DARWIN_TRUE@ $(HOMEBREW_SDKROOT)/usr/include/mach/vm_map.defs
|
|
|
|
|
|
|
|
@VGCONF_HAVE_PLATFORM_SEC_TRUE@am__append_11 = libcoregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
|
|
|
|
@ENABLE_LINUX_TICKET_LOCK_PRIMARY_TRUE@am__append_12 = \
|
|
|
|
diff --git a/coregrind/link_tool_exe_darwin.in b/coregrind/link_tool_exe_darwin.in
|
|
|
|
index bf483a9..8474346 100644
|
|
|
|
--- a/coregrind/link_tool_exe_darwin.in
|
|
|
|
+++ b/coregrind/link_tool_exe_darwin.in
|
|
|
|
@@ -138,7 +138,7 @@ die "Can't find '-arch archstr' in command line"
|
|
|
|
|
|
|
|
|
|
|
|
# build the command line
|
|
|
|
-my $cmd = "/usr/bin/ld";
|
|
|
|
+my $cmd = "ld";
|
|
|
|
|
|
|
|
$cmd = "$cmd -static";
|