Skip to content

Commit

Permalink
Merge pull request #297 from vhbit/brew-regression
Browse files Browse the repository at this point in the history
Fixed regression introduced in #289
  • Loading branch information
yonaskolb authored Apr 14, 2018
2 parents 62a37b1 + 84d9c14 commit 6dfd95e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Formula/xcodegen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ def install
# libxml2 has to be included in ISYSTEM_PATH for building one of
# dependencies. It didn't happen automatically before Xcode 9.3
# so homebrew patched environment variable to get it work.
# But since Xcode 9.3 includes it already, the build will fail
# because of redefinition of libxml2 module.
#
# That works fine when you have just Xcode installed, but there
# is also CLT. If it is also installed, ISYSTEM_PATH has
# a reference to CLT libxml2 AND a reference to Xcode default
# toolchain libxml2. That causes build failure with "module redeclared"
# error. So if both Xcode and CLT are installed one reference
# has to be removed.
#
# It's a bug of homebrew but before it's fixed, it's easier
# to provide in-place workaround for now.
# Please remove this once homebrew is patched.

# step 1: capture old value and patch environment
if OS::Mac::Xcode.version >= Version.new("9.3") then
if OS::Mac::Xcode.version >= Version.new("9.3") && !OS::Mac::Xcode.without_clt? then
old_isystem_paths = ENV["HOMEBREW_ISYSTEM_PATHS"]
ENV["HOMEBREW_ISYSTEM_PATHS"] = old_isystem_paths.gsub("/usr/include/libxml2", "")
end
Expand Down

0 comments on commit 6dfd95e

Please sign in to comment.