-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
70 lines (57 loc) · 2.43 KB
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
cask "vlc@nightly" do
arch arm: "arm64", intel: "x86_64"
livecheck_arch = on_arch_conditional arm: "-arm64", intel: "-intel64"
on_arm do
version "4.0.0,20241230-0413,dc430c65"
sha256 "b213e268b7a7218fe03578559a8ff919597714803efb9866b317a954b58efc4b"
url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{version.csv.second}/vlc-#{version.csv.first}-dev-arm64-#{version.csv.third}.dmg"
end
on_intel do
version "4.0.0,20241230-0415,dc430c65"
sha256 "965339920fc5cb71528d8c934f3bbb9f2d332670647ad5630d71a26bf0382f8f"
url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{version.csv.second}/vlc-#{version.csv.first}-dev-intel64-#{version.csv.third}.dmg"
end
name "VLC media player"
desc "Open-source cross-platform multimedia player"
homepage "https://www.videolan.org/vlc/"
livecheck do
url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/"
regex(/href=.*?vlc[._-]v?(\d+(?:\.\d+)+)-dev#{livecheck_arch}-(\h+)\.dmg/i)
strategy :page_match do |page, regex|
directory = page.scan(%r{href=["']?v?(\d+(?:[.-]\d+)+)/?["' >]}i)
.flatten
.uniq
.max
next if directory.blank?
# Fetch the directory listing page for newest build
build_response = Homebrew::Livecheck::Strategy.page_content(
"https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{directory}/",
)
next if (build_page = build_response[:content]).blank?
match = build_page.match(regex)
next if match.blank?
"#{match[1]},#{directory},#{match[2]}"
end
end
deprecate! date: "2025-05-01", because: :unsigned
conflicts_with cask: "vlc"
app "VLC.app"
# shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
shimscript = "#{staged_path}/vlc.wrapper.sh"
binary shimscript, target: "vlc"
preflight do
File.write shimscript, <<~EOS
#!/bin/sh
exec '#{appdir}/VLC.app/Contents/MacOS/VLC' "$@"
EOS
end
zap trash: [
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.videolan.vlc.sfl*",
"~/Library/Application Support/org.videolan.vlc",
"~/Library/Application Support/VLC",
"~/Library/Caches/org.videolan.vlc",
"~/Library/Preferences/org.videolan.vlc",
"~/Library/Preferences/org.videolan.vlc.plist",
"~/Library/Saved Application State/org.videolan.vlc.savedState",
]
end