aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2019-06-16 10:07:20 +0200
committerTeddy Wing2019-06-16 11:15:17 +0200
commitd80aaf766db7fed84a5a4bce0d2b1619c6282f0a (patch)
treed3d88a2445e2a62cb8d48014ba4295ca8034c945
parent9f6d9da7b8af73e2e55b2f8932eb15f6fb8b718a (diff)
downloadDomeKey-master.tar.bz2
HomebrewFormula: Fix `:lion`/"10.7" `depends_on`HEADmaster
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.rb13
-rw-r--r--pkg/dome-key.in.rb13
2 files changed, 22 insertions, 4 deletions
diff --git a/HomebrewFormula/dome-key.rb b/HomebrewFormula/dome-key.rb
index 73beb47..7a5c106 100644
--- a/HomebrewFormula/dome-key.rb
+++ b/HomebrewFormula/dome-key.rb
@@ -6,7 +6,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"
@@ -19,7 +28,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
diff --git a/pkg/dome-key.in.rb b/pkg/dome-key.in.rb
index 7582e34..736e7a5 100644
--- a/pkg/dome-key.in.rb
+++ b/pkg/dome-key.in.rb
@@ -6,7 +6,16 @@ class DomeKey < Formula
sha256 "${SHA256}"
# 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"
@@ -19,7 +28,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