diff options
author | Teddy Wing | 2019-06-16 10:07:20 +0200 |
---|---|---|
committer | Teddy Wing | 2019-06-16 10:50:46 +0200 |
commit | 0970ddf2c67f0fe9f269efeeba24b146407e5fbc (patch) | |
tree | 93a7ab0dcbf940e98945fd17ad40e22c37333d4a | |
parent | 01c36e71f917a8f5e2bf55d95f1fbef994e29673 (diff) | |
download | homebrew-formulae-0970ddf2c67f0fe9f269efeeba24b146407e5fbc.tar.bz2 |
HomebrewFormula/dome-key.rb: Fix `:lion`/"10.7" `depends_on`
Turns out we didn't solve the problem with the previous commit, as
"10.7" still needs to be in Homebrew's `MacOS::Version::SYMBOLS` hash in
order to be recognised.
To work around this, depend on Lion if Homebrew provides it, otherwise
display a message in the Caveats section about the minimum OS version.
-rw-r--r-- | HomebrewFormula/dome-key.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/HomebrewFormula/dome-key.rb b/HomebrewFormula/dome-key.rb index a6c6e7e..488171e 100644 --- a/HomebrewFormula/dome-key.rb +++ b/HomebrewFormula/dome-key.rb @@ -10,7 +10,16 @@ class DomeKey < Formula sha256 "03fd038e1ae67ce1fce949d2d5fcafb50bbee2f4344b71c16577929c557718a1" # Rust code requires at least 10.7 - depends_on :macos => "10.7" + depends_on :macos => :lion if MacOS::Version::SYMBOLS.has_key?(:lion) + + def minimum_os + return "" if MacOS::Version::SYMBOLS.has_key?(:lion) + + <<~EOS + DomeKey requires Mac OS X 10.7 Lion or later. + + EOS + end def install bin.install "dome-key" @@ -23,7 +32,7 @@ class DomeKey < Formula end def caveats; <<~EOS - To get started with a set of mappings, try running the these commands: + #{minimum_os}To get started with a set of mappings, try running the these commands: mkdir -p $HOME/.config/dome-key cat <<EOM > $HOME/.config/dome-key/mappings.dkmap |