42 lines
1.1 KiB
Ruby
42 lines
1.1 KiB
Ruby
|
class Amfora < Formula
|
||
|
desc "Fancy terminal browser for the Gemini protocol"
|
||
|
homepage "https://github.com/makeworld-the-better-one/amfora"
|
||
|
url "https://github.com/makeworld-the-better-one/amfora.git",
|
||
|
tag: "v1.8.0",
|
||
|
revision: "71385e9f4e91ab982076856cac95320173ccea73"
|
||
|
license all_of: [
|
||
|
"GPL-3.0-only",
|
||
|
any_of: ["GPL-3.0-only", "MIT"], # rr
|
||
|
]
|
||
|
head "https://github.com/makeworld-the-better-one/amfora.git"
|
||
|
|
||
|
depends_on "go" => :build
|
||
|
|
||
|
def install
|
||
|
ldflags = %W[
|
||
|
-s -w
|
||
|
-X main.version=#{version}
|
||
|
-X main.commit=#{Utils.git_head}
|
||
|
-X main.builtBy=homebrew
|
||
|
]
|
||
|
system "go", "build", *std_go_args(ldflags: ldflags.join(" "))
|
||
|
pkgshare.install "contrib/themes"
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
require "open3"
|
||
|
|
||
|
input, _, wait_thr = Open3.popen2 "script -q screenlog.txt"
|
||
|
input.puts "stty rows 80 cols 43"
|
||
|
input.puts "env TERM=xterm #{bin}/amfora"
|
||
|
sleep 1
|
||
|
input.putc "q"
|
||
|
|
||
|
screenlog = (testpath/"screenlog.txt").read
|
||
|
assert_match "# New Tab", screenlog
|
||
|
assert_match "## Learn more about Amfora!", screenlog
|
||
|
ensure
|
||
|
Process.kill("TERM", wait_thr.pid)
|
||
|
end
|
||
|
end
|