Skip to content

Instantly share code, notes, and snippets.

@clemensg
Last active December 18, 2015 13:18
Show Gist options
  • Save clemensg/5788538 to your computer and use it in GitHub Desktop.
Save clemensg/5788538 to your computer and use it in GitHub Desktop.
Fixes most of homebrew's problems on OSX 10.9 Mavericks (If /usr/include does not exist, treat it like a system with Xcode only)
From 3a37b93f95081f697f9d0941360af7fcee701099 Mon Sep 17 00:00:00 2001
From: Clemens Gruber <clemensgru@gmail.com>
Date: Sat, 15 Jun 2013 18:38:32 +0200
Subject: [PATCH] Fix Homebrew on OSX 10.9 Mavericks
---
Library/Homebrew/os/mac/xcode.rb | 2 +-
Library/Homebrew/superenv/macsystem.rb | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index 3fdd904..c7fdfd2 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -159,7 +159,7 @@ module MacOS::CLT extend self
# Xcode < 4.3, this is the standard location. Otherwise, it means that
# the user has installed the "Command Line Tools for Xcode" package.
def installed?
- MacOS.dev_tools_path == Pathname.new("/usr/bin")
+ (MacOS.dev_tools_path == Pathname.new("/usr/bin")) and File.directory? "/usr/include"
end
def latest_version?
diff --git a/Library/Homebrew/superenv/macsystem.rb b/Library/Homebrew/superenv/macsystem.rb
index 7d2a788..83a51fd 100644
--- a/Library/Homebrew/superenv/macsystem.rb
+++ b/Library/Homebrew/superenv/macsystem.rb
@@ -1,7 +1,10 @@
# new code because I don't really trust the Xcode code now having researched it more
module MacSystem extend self
def xcode_clt_installed?
- File.executable? "/usr/bin/clang" and File.executable? "/usr/bin/lldb" and File.executable? "/usr/bin/make"
+ # OSX 10.9 has to be treated like Xcode without CLT
+ # (In both cases, there is no /usr/include directory)
+ File.executable? "/usr/bin/clang" and File.executable? "/usr/bin/lldb" and
+ File.executable? "/usr/bin/make" and File.directory? "/usr/include"
end
def xcode43_without_clt?
--
1.8.1.6
@clemensg
Copy link
Author

Apply with: cd brew --prefix && patch -p1 < homebrew_mavericks_fix.patch

@sookcha
Copy link

sookcha commented Jun 18, 2013

I got the error below:
/usr/local ⮀ ⭠ master ⮀ patch -p1 < homebrew_mavericks_fix.patch
patching file Library/Homebrew/os/mac/xcode.rb
Hunk #1 FAILED at 159.
1 out of 1 hunk FAILED -- saving rejects to file Library/Homebrew/os/mac/xcode.rb.rej
patching file Library/Homebrew/superenv/macsystem.rb
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file Library/Homebrew/superenv/macsystem.rb.rej

@dynjo
Copy link

dynjo commented Jul 11, 2013

Same here

@redhoodie
Copy link

And also with me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment