homebrew-core/Formula/mpv.rb
2016-12-18 10:03:35 -08:00

79 lines
2.4 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.22.0.tar.gz"
sha256 "c0f9ac8f0e37a391d19007b333ef8787c2f45d75a0d4401c0098cde52c5082f6"
revision 1
head "https://github.com/mpv-player/mpv.git"
bottle do
rebuild 1
sha256 "0b2c1b383fb869a19c8f16354cb77ba0bb6292729b96ee546cdb45e3ff8886d7" => :sierra
sha256 "3cbcd834815feaa351de6e33ec5d30537b7ac8e3bb6cb404ca617b1a9c4d1f1d" => :el_capitan
sha256 "0aa28954619134b2f6803612917a4758c3b052e3bb81adf2004a23ca9aed6aff" => :yosemite
end
option "with-bundle", "Enable compilation of the .app bundle."
depends_on "pkg-config" => :build
depends_on "docutils" => :build
depends_on :python3 => :build
depends_on "libass"
depends_on "ffmpeg"
depends_on "jpeg" => :recommended
depends_on "little-cms2" => :recommended
depends_on "lua" => :recommended
depends_on "youtube-dl" => :recommended
depends_on "jack" => :optional
depends_on "libaacs" => :optional
depends_on "libarchive" => :optional
depends_on "libbluray" => :optional
depends_on "libcaca" => :optional
depends_on "libdvdnav" => :optional
depends_on "libdvdread" => :optional
depends_on "pulseaudio" => :optional
depends_on "rubberband" => :optional
depends_on "uchardet" => :optional
depends_on "vapoursynth" => :optional
depends_on :x11 => :optional
depends_on :macos => :mountain_lion
def install
# LANG is unset by default on osx 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-zsh-comp
--enable-libmpv-shared
--enable-html-build
--confdir=#{etc}/mpv
--datadir=#{pkgshare}
--mandir=#{man}
--docdir=#{doc}
--zshdir=#{zsh_completion}
]
args << "--enable-libarchive" if build.with? "libarchive"
args << "--enable-pulse" if build.with? "pulseaudio"
system "./bootstrap.py"
system "python3", "waf", "configure", *args
system "python3", "waf", "install"
if build.with? "bundle"
system "python3", "TOOLS/osxbundle.py", "build/mpv"
prefix.install "build/mpv.app"
end
end
test do
system bin/"mpv", "--ao=null", test_fixtures("test.wav")
end
end