-
Notifications
You must be signed in to change notification settings - Fork 14
/
mpv.rb
67 lines (59 loc) · 1.96 KB
/
mpv.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
class Mpv < Formula
# based upon the last version of homebrew-core/Formula/mpv.rb at https://github.com/Homebrew/homebrew-core/commit/41444d526c40b93069b7f0c5414539deb0534179
desc "Media player based on MPlayer and mplayer2"
homepage "https://mpv.io"
url "https://github.com/amiaopensource/mpv/archive/2019-10-31.tar.gz"
version "2019-10-31"
sha256 "3a76046fee81383d503ff1aca6668dd28d9f2c74b3aa08e7d73c403deb092676"
head "https://github.com/mpv-player/mpv.git"
depends_on "docutils" => :build
depends_on "pkg-config" => :build
depends_on "[email protected]" => :build
depends_on "ffmpeg"
depends_on "jpeg"
depends_on "libarchive"
depends_on "libass"
depends_on "little-cms2"
depends_on "[email protected]"
depends_on "mujs"
depends_on "uchardet"
depends_on "vapoursynth"
depends_on "youtube-dl"
def install
# LANG is unset by default on macOS and causes issues when calling getlocale
# or getdefaultlocale in docutils. Force the default c/posix locale since
# that's good enough for building the manpage.
ENV["LC_ALL"] = "C"
args = %W[
--prefix=#{prefix}
--enable-html-build
--enable-javascript
--enable-libmpv-shared
--enable-lua
--enable-libarchive
--enable-uchardet
--confdir=#{etc}/mpv
--datadir=#{pkgshare}
--mandir=#{man}
--docdir=#{doc}
--zshdir=#{zsh_completion}
]
system "./bootstrap.py"
system "python3", "waf", "configure", *args
system "python3", "waf", "install"
system "python3", "TOOLS/osxbundle.py", "build/mpv"
prefix.install "build/mpv.app"
end
def caveats
if File.exist?("/usr/local/Caskroom/mpv")
<<~EOS
Warning: A brew cask installation of MPV was detected, so this version may not
be linked. To uninstall cask version and link this version run the command:
brew cask uninstall mpv && brew link mpv
EOS
end
end
test do
system bin/"mpv", "--ao=null", test_fixtures("test.wav")
end
end