139 lines
5.6 KiB
Ruby
139 lines
5.6 KiB
Ruby
class GetIplayer < Formula
|
|
desc "Utility for downloading TV and radio programmes from BBC iPlayer"
|
|
homepage "https://github.com/get-iplayer/get_iplayer"
|
|
url "https://github.com/get-iplayer/get_iplayer/archive/v3.28.tar.gz"
|
|
sha256 "8ba1e398001609c5893604ea6aac6058c833b54ed00ef150a14fa1cb094b0df3"
|
|
license "GPL-3.0-or-later"
|
|
head "https://github.com/get-iplayer/get_iplayer.git", branch: "develop"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "fa82c21dcb46edf6c7a027ed1c6d8aba29c8dcce6ae079683b75893e44b225af"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1665b3c06fdb20f64e65dfc3b5797d57ee5c5d5389cebb491028ebfac53e2441"
|
|
sha256 cellar: :any_skip_relocation, monterey: "07b328ee6ea86ca846f1263e80f0ce7ec9482c67b485ecd92c920862f4bc083e"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "a2cb3e9aade0602d13ad367fdc4d383944a2b880a725000d0ea3a493caeea9e6"
|
|
sha256 cellar: :any_skip_relocation, catalina: "78274c735f7eb288d87b38ad1a2a5c2cdc09ed174daab435a7d7bc294ad95b0c"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "6a5e1a033517fd5e0d503a04caaa38d204f11b4afac7e57a839007ba1365d54a"
|
|
end
|
|
|
|
depends_on "atomicparsley"
|
|
depends_on "ffmpeg"
|
|
|
|
uses_from_macos "libxml2"
|
|
uses_from_macos "perl"
|
|
|
|
on_linux do
|
|
resource "Try-Tiny" do
|
|
url "https://cpan.metacpan.org/authors/id/E/ET/ETHER/Try-Tiny-0.30.tar.gz"
|
|
sha256 "da5bd0d5c903519bbf10bb9ba0cb7bcac0563882bcfe4503aee3fb143eddef6b"
|
|
end
|
|
|
|
resource "Path:Class" do
|
|
url "https://cpan.metacpan.org/authors/id/K/KW/KWILLIAMS/Path-Class-0.33.tar.gz"
|
|
sha256 "cd8cc6a68e2099eeb6099df6af83b4585eb0ddf6c77490d6fa97eadb09d0c677"
|
|
end
|
|
|
|
resource "Net::HTTP" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/Net-HTTP-6.18.tar.gz"
|
|
sha256 "7e42df2db7adce3e0eb4f78b88c450f453f5380f120fd5411232e03374ba951c"
|
|
end
|
|
|
|
resource "Net::SSLeay" do
|
|
url "https://cpan.metacpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.tar.gz"
|
|
sha256 "2000da483c8471a0b61e06959e92a6fca7b9e40586d5c828de977d3d2081cfdd"
|
|
end
|
|
|
|
resource "HTML::Entities" do
|
|
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.72.tar.gz"
|
|
sha256 "ec28c7e1d9e67c45eca197077f7cdc41ead1bb4c538c7f02a3296a4bb92f608b"
|
|
end
|
|
|
|
resource "HTTP::Cookies" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Cookies-6.04.tar.gz"
|
|
sha256 "0cc7f079079dcad8293fea36875ef58dd1bfd75ce1a6c244cd73ed9523eb13d4"
|
|
end
|
|
|
|
resource "HTTP::Date" do
|
|
url "https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTTP-Date-6.02.tar.gz"
|
|
sha256 "e8b9941da0f9f0c9c01068401a5e81341f0e3707d1c754f8e11f42a7e629e333"
|
|
end
|
|
|
|
resource "HTML::Headers" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Message-6.18.tar.gz"
|
|
sha256 "d060d170d388b694c58c14f4d13ed908a2807f0e581146cef45726641d809112"
|
|
end
|
|
|
|
resource "LWP::ConnCache" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.20.tar.gz"
|
|
sha256 "3cf4d1bdade592fc9dd7710403255ef2eebb075b7365cbe52fcdfc579d79b2b0"
|
|
end
|
|
|
|
resource "LWP::Protocol::https" do
|
|
url "https://cpan.metacpan.org/authors/id/O/OA/OALDERS/LWP-Protocol-https-6.07.tar.gz"
|
|
sha256 "522cc946cf84a1776304a5737a54b8822ec9e79b264d0ba0722a70473dbfb9e7"
|
|
end
|
|
|
|
resource "URI" do
|
|
url "https://cpan.metacpan.org/authors/id/E/ET/ETHER/URI-1.74.tar.gz"
|
|
sha256 "a9c254f45f89cb1dd946b689dfe433095404532a4543bdaab0b71ce0fdcdd53d"
|
|
end
|
|
|
|
resource "XML-LibXML" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0132.tar.gz"
|
|
sha256 "721452e3103ca188f5968ab06d5ba29fe8e00e49f4767790882095050312d476"
|
|
end
|
|
|
|
resource "XML::SAX::Exception" do
|
|
url "https://cpan.metacpan.org/authors/id/K/KH/KHAMPTON/XML-SAX-Base-1.02.tar.gz"
|
|
sha256 "c541861df7e70f83950afedf2058148aa9d4bd733929a869829c97833ad1600b"
|
|
end
|
|
end
|
|
|
|
resource "IO::Socket::IP" do
|
|
url "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/IO-Socket-IP-0.39.tar.gz"
|
|
sha256 "11950da7636cb786efd3bfb5891da4c820975276bce43175214391e5c32b7b96"
|
|
end
|
|
|
|
resource "IO::Socket::SSL" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.066.tar.gz"
|
|
sha256 "0d47064781a545304d5dcea5dfcee3acc2e95a32e1b4884d80505cde8ee6ebcd"
|
|
end
|
|
|
|
resource "Mojolicious" do
|
|
url "https://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-7.94.tar.gz"
|
|
sha256 "171a1741f3ea57519657bfb1e40a5290149d7c7d69a1131464c7db23029e8f6e"
|
|
end
|
|
|
|
resource "Mozilla::CA" do
|
|
url "https://cpan.metacpan.org/authors/id/A/AB/ABH/Mozilla-CA-20180117.tar.gz"
|
|
sha256 "f2cc9fbe119f756313f321e0d9f1fac0859f8f154ac9d75b1a264c1afdf4e406"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
ENV["NO_NETWORK_TESTING"] = "1"
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
inreplace ["get_iplayer", "get_iplayer.cgi"] do |s|
|
|
s.gsub!(/^(my \$version_text);/i, "\\1 = \"#{pkg_version}-homebrew\";")
|
|
end
|
|
|
|
bin.install "get_iplayer", "get_iplayer.cgi"
|
|
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
|
|
man1.install "get_iplayer.1"
|
|
end
|
|
|
|
test do
|
|
output = shell_output("\"#{bin}/get_iplayer\" -f --refresh-include=\"BBC None\" -q dontshowanymatches 2>&1")
|
|
assert_match "get_iplayer #{pkg_version}-homebrew", output, "Unexpected version"
|
|
assert_match "INFO: 0 matching programmes", output, "Unexpected output"
|
|
assert_match "INFO: Indexing tv programmes (concurrent)", output,
|
|
"Mojolicious not found"
|
|
end
|
|
end
|