homebrew-core/Formula/mpv.rb
gtm87x 6b43f46bc5 mpv: add option to enable audio CD playback (#16549)
Add libcdio dependency and the option to enable it at compile time (it's not autodetected by default).
2017-08-12 02:30:36 -07:00

91 lines
3 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.26.0.tar.gz"
sha256 "daf3ef358d5f260f2269f7caabce27f446c291457ec330077152127133b71b46"
revision 1
head "https://github.com/mpv-player/mpv.git"
bottle do
sha256 "2014dce521837478b6b5d56e450ff0c90d6502269500d5a32d035f54d16918ca" => :sierra
sha256 "5946e9f37aed8ce6a20c2b0c793f933f0a16117d159dac9684c2da813f130375" => :el_capitan
end
option "with-bundle", "Enable compilation of the .app bundle."
depends_on "pkg-config" => :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 "libcdio" => :optional
depends_on :x11 => :optional
depends_on :macos => :mountain_lion
resource "docutils" do
url "https://files.pythonhosted.org/packages/05/25/7b5484aca5d46915493f1fd4ecb63c38c333bd32aa9ad6e19da8d08895ae/docutils-0.13.1.tar.gz"
sha256 "718c0f5fb677be0f34b781e04241c4067cbd9327b66bdd8e763201130f5175be"
end
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"
ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python2.7/site-packages"
resource("docutils").stage do
system "python", *Language::Python.setup_install_args(buildpath/"vendor")
end
ENV.prepend_path "PATH", buildpath/"vendor/bin"
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-libbluray" if build.with? "libbluray"
args << "--enable-dvdnav" if build.with? "libdvdnav"
args << "--enable-dvdread" if build.with? "libdvdread"
args << "--enable-cdda" if build.with? "libcdio"
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