2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-08-12 00:29:24 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Mplayer < Formula
|
2009-12-07 15:31:51 +00:00
|
|
|
homepage 'http://www.mplayerhq.hu/'
|
2012-06-08 20:11:03 +00:00
|
|
|
url 'http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz'
|
|
|
|
sha1 '913a4bbeab7cbb515c2f43ad39bc83071b2efd75'
|
2011-06-19 00:08:27 +00:00
|
|
|
|
2010-06-28 21:55:31 +00:00
|
|
|
head 'svn://svn.mplayerhq.hu/mplayer/trunk', :using => StrictSubversionDownloadStrategy
|
2009-12-07 15:31:51 +00:00
|
|
|
|
2012-08-29 21:52:33 +00:00
|
|
|
option 'with-x', 'Build with X11 support'
|
2012-11-17 11:21:16 +00:00
|
|
|
option 'without-osd', 'Build without OSD'
|
2012-08-29 21:52:33 +00:00
|
|
|
|
2011-03-26 19:33:49 +00:00
|
|
|
depends_on 'yasm' => :build
|
2012-06-08 20:11:03 +00:00
|
|
|
depends_on 'xz' => :build
|
2013-04-04 23:04:43 +00:00
|
|
|
depends_on 'libcaca' => :optional
|
2012-08-29 21:52:33 +00:00
|
|
|
depends_on :x11 if build.include? 'with-x'
|
2009-08-12 00:29:24 +00:00
|
|
|
|
2012-11-17 11:21:16 +00:00
|
|
|
unless build.include? 'without-osd' or build.include? 'with-x'
|
|
|
|
# These are required for the OSD. We can get them from X11, or we can
|
|
|
|
# build our own.
|
|
|
|
depends_on :fontconfig
|
|
|
|
depends_on :freetype
|
|
|
|
end
|
|
|
|
|
2012-06-08 20:11:03 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 211
|
|
|
|
cause 'Inline asm errors during compile on 32bit Snow Leopard.'
|
|
|
|
end unless MacOS.prefer_64_bit?
|
2011-10-27 21:25:47 +00:00
|
|
|
|
2011-03-08 07:04:30 +00:00
|
|
|
def patches
|
2012-06-08 20:11:03 +00:00
|
|
|
# When building SVN, configure prompts the user to pull FFmpeg from git.
|
|
|
|
# Don't do that.
|
2012-08-29 21:52:33 +00:00
|
|
|
DATA if build.head?
|
2011-03-08 07:04:30 +00:00
|
|
|
end
|
|
|
|
|
2009-08-12 00:29:24 +00:00
|
|
|
def install
|
2011-06-19 00:08:27 +00:00
|
|
|
# (A) Do not use pipes, per bug report and MacPorts
|
|
|
|
# * https://github.com/mxcl/homebrew/issues/622
|
|
|
|
# * http://trac.macports.org/browser/trunk/dports/multimedia/mplayer-devel/Portfile
|
|
|
|
# (B) Any kind of optimisation breaks the build
|
2012-06-08 20:11:03 +00:00
|
|
|
# (C) It turns out that ENV.O1 fixes link errors with llvm.
|
2010-02-19 23:39:52 +00:00
|
|
|
ENV['CFLAGS'] = ''
|
|
|
|
ENV['CXXFLAGS'] = ''
|
2012-06-08 20:11:03 +00:00
|
|
|
ENV.O1 if ENV.compiler == :llvm
|
2009-12-07 15:31:51 +00:00
|
|
|
|
2011-06-29 15:15:59 +00:00
|
|
|
# we disable cdparanoia because homebrew's version is hacked to work on OS X
|
|
|
|
# and mplayer doesn't expect the hacks we apply. So it chokes.
|
2012-06-08 20:11:03 +00:00
|
|
|
# Specify our compiler to stop ffmpeg from defaulting to gcc.
|
2012-07-12 12:04:58 +00:00
|
|
|
# Disable openjpeg because it defines int main(), which hides mplayer's main().
|
|
|
|
# This issue was reported upstream against openjpeg 1.5.0:
|
|
|
|
# http://code.google.com/p/openjpeg/issues/detail?id=152
|
2012-08-29 21:52:33 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--cc=#{ENV.cc}
|
|
|
|
--host-cc=#{ENV.cc}
|
|
|
|
--disable-cdparanoia
|
|
|
|
--disable-libopenjpeg
|
|
|
|
]
|
|
|
|
|
2012-11-17 11:21:16 +00:00
|
|
|
args << "--enable-menu" unless build.include? 'without-osd'
|
2012-08-29 21:52:33 +00:00
|
|
|
args << "--disable-x11" unless build.include? 'with-x'
|
2013-04-04 23:04:43 +00:00
|
|
|
args << "--enable-caca" if build.with? 'libcaca'
|
2012-08-29 21:52:33 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2009-09-18 08:13:46 +00:00
|
|
|
system "make"
|
2009-08-12 00:29:24 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-09-02 08:08:00 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/mplayer", "-ao", "null", "/System/Library/Sounds/Glass.aiff"
|
|
|
|
end
|
2009-12-04 17:44:18 +00:00
|
|
|
end
|
2011-03-08 07:04:30 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/configure b/configure
|
2012-10-16 21:04:23 +00:00
|
|
|
index a1fba5f..5deaa80 100755
|
2011-03-08 07:04:30 +00:00
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
2012-10-16 21:04:23 +00:00
|
|
|
@@ -49,8 +49,6 @@ if test -e ffmpeg/mp_auto_pull ; then
|
2011-10-27 21:25:47 +00:00
|
|
|
fi
|
2011-03-08 07:04:30 +00:00
|
|
|
|
2011-10-27 21:25:47 +00:00
|
|
|
if ! test -e ffmpeg ; then
|
2011-04-16 18:12:40 +00:00
|
|
|
- echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort"
|
|
|
|
- read tmp
|
2012-10-16 21:04:23 +00:00
|
|
|
if ! git clone --depth 1 git://source.ffmpeg.org/ffmpeg.git ffmpeg ; then
|
2011-10-27 21:25:47 +00:00
|
|
|
rm -rf ffmpeg
|
|
|
|
echo "Failed to get a FFmpeg checkout"
|