aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2014-09-21 02:35:20 -0500
committerJack Nagel2014-09-21 02:36:14 -0500
commit5d44503b31366ea6240279c0a06e9c02313b80a1 (patch)
tree6dcb96ed4c4d3adbe1803043969fc1ac6a663ef3 /Library/Formula
parent7ebd25fbaeffff77450b3711bb1dee77a0e206d3 (diff)
downloadhomebrew-5d44503b31366ea6240279c0a06e9c02313b80a1.tar.bz2
wine: fix build on 10.7 under superenv
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/wine.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/Library/Formula/wine.rb b/Library/Formula/wine.rb
index 140a9363a..b1e33f094 100644
--- a/Library/Formula/wine.rb
+++ b/Library/Formula/wine.rb
@@ -119,11 +119,21 @@ class Wine < Formula
system "./configure", *args
+ # The Mac driver uses blocks and must be compiled with an Apple compiler
+ # even if the rest of Wine is built with A GNU compiler.
unless ENV.compiler == :clang || ENV.compiler == :llvm || ENV.compiler == :gcc
- # The Mac driver uses blocks and must be compiled with an Apple compiler
- # even if the rest of Wine is built with A GNU compiler.
- system 'make', 'dlls/winemac.drv/Makefile'
- inreplace 'dlls/winemac.drv/Makefile', /^CC\s*=\s*[^\s]+/, "CC = clang"
+ system "make", "dlls/winemac.drv/Makefile"
+ inreplace "dlls/winemac.drv/Makefile" do |s|
+ # We need to use the real compiler, not the superenv shim, which will exec the
+ # configured compiler no matter what name is used to invoke it.
+ s.change_make_var! "CC", "xcrun clang -m32"
+
+ # Emulate some things that superenv would normally handle for us
+ s.change_make_var! "EXTRACFLAGS", s.get_make_var("EXTRACFLAGS").sub(
+ "-gstabs+", # We're configured to use GNU GCC, so remote an unsupported flag
+ "--sysroot=#{MacOS.sdk_path}" # Pass the sysroot to support Xcode-only systems
+ )
+ end
end
system "make install"