homebrew-core/Formula/mpv.rb

70 lines
2.2 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
revision 3
head "https://github.com/mpv-player/mpv.git"
bottle do
sha256 arm64_big_sur: "1679746b14f23e60d01d41c461f4ffec1142f95989059aa13bd136b6b062b694"
sha256 big_sur: "58a1f5371def7e860246dfbff2f065070838bb70a766a5601fc1b275be183170"
sha256 catalina: "f990b241e40cb6c2b1a2cda146e6e51dfd613f450a94b637fcdbeddb2ef2eb77"
sha256 mojave: "40262c2fe5cf5676ae4f18715ba9eaac2ded398a484a447f7732e37201fe1d90"
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 "luajit-openresty"
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"
# luajit-openresty is keg-only
ENV.prepend_path "PKG_CONFIG_PATH", Formula["luajit-openresty"].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=luajit
]
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