aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/valgrind.rb
diff options
context:
space:
mode:
authorMax Howell2012-09-01 22:00:17 -0400
committerMax Howell2012-09-01 23:18:28 -0400
commita98896c51bb5230583145e0d4560ceb115fffa18 (patch)
treec15b1f6bdfbc1bc2ae0a1ee0f7a51c30fac1cb73 /Library/Formula/valgrind.rb
parent9aa5520b5327e8f30660971784fc615dcb9a3863 (diff)
downloadhomebrew-a98896c51bb5230583145e0d4560ceb115fffa18.tar.bz2
valgrind: patch for xcode-only
Since even superenv cannot solve this, we need this ugly patch. Valgrind devs have no Macs. Closes #14441. Signed-off-by: Max Howell <mxcl@me.com> Quite a bit of amendment from me.
Diffstat (limited to 'Library/Formula/valgrind.rb')
-rw-r--r--Library/Formula/valgrind.rb41
1 files changed, 40 insertions, 1 deletions
diff --git a/Library/Formula/valgrind.rb b/Library/Formula/valgrind.rb
index b776cdb28..9bb48de39 100644
--- a/Library/Formula/valgrind.rb
+++ b/Library/Formula/valgrind.rb
@@ -22,6 +22,12 @@ class Valgrind < Formula
skip_clean 'lib'
+ 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?
+
def install
# avoid undefined symbol __bzero
ENV.remove_from_cflags "-mmacosx-version-min=#{MacOS.version}"
@@ -35,7 +41,7 @@ class Valgrind < Formula
system "./autogen.sh" if build.head?
system "./configure", *args
- system "make"
+ system "make", "AR=ar" # have to set AR or valgrind picks cc (WTF?)
system "make install"
end
@@ -43,3 +49,36 @@ class Valgrind < Formula
system "#{bin}/valgrind", "ls", "-l"
end
end
+
+__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";