homebrew-core/Formula/showkey.rb

43 lines
1.5 KiB
Ruby

class Showkey < Formula
desc "Simple keystroke visualizer"
homepage "http://www.catb.org/~esr/showkey/"
url "http://www.catb.org/~esr/showkey/showkey-1.8.tar.gz"
sha256 "31b6b064976a34d7d8e7a254db0397ba2dc50f1bb6e283038b17c48a358d50d3"
license "MIT"
head "https://gitlab.com/esr/showkey.git", branch: "master"
livecheck do
url :homepage
regex(/showkey[._-]v?(\d+(?:\.\d+)+)/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "077e85f756df5b32424c7e552963e2d76d3c9165be10217c19f9c36592b7b469"
sha256 cellar: :any_skip_relocation, big_sur: "712671c9ed8023a91e5f170d40db86fed18d70703981e1397f63d1bf40f0010f"
sha256 cellar: :any_skip_relocation, catalina: "7565c213c9d1e4d0859164eaa92ec1e6f0cdf4d9e28f8e3a4f7a156971292de1"
sha256 cellar: :any_skip_relocation, mojave: "7bb7683a2f338db50eaed3bb2079308f32d30a43ce0ac37d16b7a9ae98235678"
sha256 cellar: :any_skip_relocation, high_sierra: "2eb4e4da78137fc93f5558e9448744e7dfdef298e6259f562093f956656c86a6"
end
depends_on "xmlto" => :build
def install
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
system "make", "showkey", "showkey.1"
bin.install "showkey"
man1.install "showkey.1"
end
test do
require "expect"
output = Utils.safe_popen_write("script", "-q", "/dev/null", bin/"showkey") do |pipe|
pipe.expect(/interrupt .*? or quit .*? character\.\r?\n$/)
pipe.write "Hello Homebrew!"
sleep 1
pipe.write "\cC\cD"
end
assert_match(/^Hello<SP>Homebrew!<CTL-D=EOT>/, output)
end
end