aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mplayer.rb
blob: a1203e5d67d458fe1085890f38579bf5f651ef37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'formula'

class Mplayer < Formula
  homepage 'http://www.mplayerhq.hu/'
  url 'ftp://ftp.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc4.tar.bz2'
  md5 '1699c94de39da9c4c5d34e8f58e418f0'

  head 'svn://svn.mplayerhq.hu/mplayer/trunk', :using => StrictSubversionDownloadStrategy

  depends_on 'pkg-config' => :build
  depends_on 'yasm' => :build

  fails_with_llvm "Missing symbols error while linking"

  def patches
    # When building from SVN HEAD, configure prompts the user to pull FFmpeg
    # from git.  Don't do that.
    if ARGV.build_head?
      DATA
    elsif `uname -r` =~ /^11\./
      # Lion requires the following diff (which is already fixed in svn trunk)
      "https://raw.github.com/gist/1105164/704c64c97ab7ffcc3e5f69b1c5d4fb0850f572c1/vd_mpng.c.diff"
    end
  end

  def install
    # (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
    ENV['CFLAGS'] = ''
    ENV['CXXFLAGS'] = ''

    # 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.
    system './configure', "--prefix=#{prefix}", "--disable-cdparanoia"
    system "make"
    system "make install"
  end
end

__END__
diff --git a/configure b/configure
index bbfcd51..5734024 100755
--- a/configure
+++ b/configure
@@ -48,8 +48,6 @@ if test -e ffmpeg/mp_auto_pull ; then
 fi
 
 if ! test -e ffmpeg ; then
-    echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort"
-    read tmp
     if ! git clone --depth 1 git://git.videolan.org/ffmpeg.git ffmpeg ; then
         rm -rf ffmpeg
         echo "Failed to get a FFmpeg checkout"