homebrew-core/Formula/mpv.rb

66 lines
2.0 KiB
Ruby

class Mpv < Formula
desc "Media player based on MPlayer and mplayer2"
homepage "https://mpv.io"
url "https://github.com/mpv-player/mpv/archive/v0.33.0.tar.gz"
sha256 "f1b9baf5dc2eeaf376597c28a6281facf6ed98ff3d567e3955c95bf2459520b4"
license :cannot_represent
head "https://github.com/mpv-player/mpv.git"
bottle do
sha256 "82651bb364974f9dabe113a52c921888c97dddf33a02b38ae6557c38a6a5a128" => :big_sur
sha256 "64bc86054fe67befc54e50318a52ee71b711732b678a62c2609866beb12b7030" => :catalina
sha256 "7e1ca3cf5a9557299161f6584f5457c4fc98e9cb5d1001919587e74b675794ca" => :mojave
end
depends_on "docutils" => :build
depends_on "pkg-config" => :build
depends_on "python@3.9" => :build
depends_on xcode: :build
depends_on "ffmpeg"
depends_on "jpeg"
depends_on "libarchive"
depends_on "libass"
depends_on "little-cms2"
depends_on "lua@5.1"
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"
# libarchive is keg-only
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libarchive"].opt_lib/"pkgconfig"
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}
--lua=51deb
]
system Formula["python@3.9"].opt_bin/"python3", "bootstrap.py"
system Formula["python@3.9"].opt_bin/"python3", "waf", "configure", *args
system Formula["python@3.9"].opt_bin/"python3", "waf", "install"
end
test do
system bin/"mpv", "--ao=null", test_fixtures("test.wav")
assert_match "vapoursynth", shell_output(bin/"mpv --vf=help")
end
end