Closed jonchang closed 6 years ago
On Linuxbrew/brew, we stub out OS::Mac::CLT.installed?
to return true
on Linux.
https://github.com/Linuxbrew/brew/blob/27df53693f594e1b42c09ecfa6e68ca709d937fe/Library/Homebrew/os/linux.rb#L22-L28
We could try sending that patch upstream to Homebrew/brew. It seems dirty though. Better I think would be to patch the formulae to guard OS::Mac::CLT.installed?
with if/unless OS.mac?
. There are 29 such formulae that also have Linux bottles.
For example…
diff --git a/Formula/llvm.rb b/Formula/llvm.rb
index c7bdbedb2f..7f354713ff 100644
--- a/Formula/llvm.rb
+++ b/Formula/llvm.rb
@@ -256,7 +256,7 @@ class Llvm < Formula
end
def build_libcxx?
- build.with?("libcxx") || !MacOS::CLT.installed?
+ build.with?("libcxx") || (OS.mac? && !MacOS::CLT.installed?)
end
# Clang cannot find system headers if Xcode CLT is not installed
I have a list of 77 formula that fail brew info
for similar reasons. I'll open a pull request over at linuxbrew/core with that fix.
There's a lot of depends_on :xcode
. It might make more sense to make depends_on :xcode
to imply depends_on :macos
.
There's a few formulae that have depends_on :xcode
that do have depends_on :xcode
but also have a bottle for x86_64_linux
, such as libmxml.rb
. I'm inclined to change depends_on :xcode
to depends_on :xcode if OS.mac?
where needed. 79 formulae have depends_on :xcode
I just did a blanket change with sed
, see https://github.com/Linuxbrew/homebrew-core/pull/8862
I think depends on Xcode does not imply Xcode is needed on Linux. It just means that you need Xcode on Mac.
Good job, everyone! 🎉
brew info llvm
fails with: