Combining uses_from_macos
with on_macos
?
#1766
-
Hello all, I am working on the Idris 2 formula, which currently specifies: uses_from_macos "zsh" => :build, since: :mojave This is not strictly correct. The actual logic should be something like this:
That is, Zsh is only a build dependency on Mac, and is not required at all on Linux. I tried to write: if on_macos
uses_from_macos "zsh" => :build, since: :mojave
end But this is apparently not allowed:
Is there some workaround to enable Zsh-from-Macos as a build dependency on Mac systems, without forcing Linux users to have Zsh when it's entirely unnecessary for them? Is there any technical reason why this shouldn't be allowed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Why must you use system Zsh on supported macOS? If you relax that restriction, the solution is simple:
If you don't intend to support macOS before Mojave, it's even simpler: Drop the dependency entirely, and Homebrew will automatically use system Zsh on all platforms. |
Beta Was this translation helpful? Give feedback.
-
As per @carlocab , the workaround is: on_macos do
depends_on "zsh" => :build if MacOS.version < :mojave
end |
Beta Was this translation helpful? Give feedback.
As per @carlocab , the workaround is: