forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathget_iplayer.rb
141 lines (115 loc) · 5.64 KB
/
get_iplayer.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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/refs/tags/v3.35.tar.gz"
sha256 "048ff5f9bd5c6c0f51a05fd0c97eb137029d1950b594384a920c3c674f121e8c"
license "GPL-3.0-or-later"
revision 1
head "https://github.com/get-iplayer/get_iplayer.git", branch: "develop"
bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "2afa41ecf4c919fd5aa50ff71dd890a03305f169aed50c5291ce06086cfe64a0"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "2afa41ecf4c919fd5aa50ff71dd890a03305f169aed50c5291ce06086cfe64a0"
sha256 cellar: :any_skip_relocation, arm64_ventura: "a33980bca4250bdd0bbf352c024e87c702e089ea33189e28b1112900b31f4bcd"
sha256 cellar: :any_skip_relocation, sonoma: "92c8f4689603554af4b398623e280c7732517face497be8d05a6501c880b3ba1"
sha256 cellar: :any_skip_relocation, ventura: "f0147cd1affbbbbdf25b08a716e2820d63593c29c9fe369434151e33603ff2ac"
sha256 cellar: :any_skip_relocation, x86_64_linux: "4b73722b70117c80021fe22930c045724bb3748154aa05b41db371280241efda"
end
depends_on "atomicparsley"
depends_on "ffmpeg"
uses_from_macos "libxml2"
uses_from_macos "perl"
on_linux do
depends_on "openssl@3"
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 programme schedules", output,
"Mojolicious not found"
end
end