homebrew-core/Formula/lgogdownloader.rb

46 lines
1.4 KiB
Ruby

class Lgogdownloader < Formula
desc "Unofficial downloader for GOG.com games"
homepage "https://sites.google.com/site/gogdownloader/"
url "https://sites.google.com/site/gogdownloader/lgogdownloader-3.7.tar.gz"
sha256 "984859eb2e0802cfe6fe76b1fe4b90e7354e95d52c001b6b434e0a9f5ed23bf0"
revision 3
bottle do
cellar :any
sha256 "173e4d8886806e16bc6fc9ac54775ad050f99766979ce940025796f4608ef1b3" => :big_sur
sha256 "02624e7e2cfaf2738f48caeb93fd7c8dabfa25cc1ad9c086b111fc948d1a2203" => :catalina
sha256 "1b6eed28ec481bed34e3f13a123553ca3cb47f4ddb7ebfd74ea1c50695073ebd" => :mojave
sha256 "a1fe2e5e3da393cf04a119d4e5df9148d1bd2e3179d9a0c942cea76be84e527b" => :high_sierra
end
depends_on "cmake" => :build
depends_on "help2man" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "htmlcxx"
depends_on "jsoncpp"
depends_on "liboauth"
depends_on "rhash"
depends_on "tinyxml2"
def install
system "cmake", ".", *std_cmake_args, "-DJSONCPP_INCLUDE_DIR=#{Formula["jsoncpp"].opt_include}"
system "make", "install"
end
test do
require "pty"
ENV["XDG_CONFIG_HOME"] = testpath
reader, writer = PTY.spawn(bin/"lgogdownloader", "--list", "--retries", "1")
writer.write <<~EOS
test@example.com
secret
EOS
writer.close
assert_equal "HTTP: Login failed", reader.read.lines.last.chomp
reader.close
end
end