aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pulseaudio.rb
blob: 25dc01c0bc533d594aff6a923bc2eb5ac45f58ef (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 Pulseaudio < Formula
  homepage 'http://pulseaudio.org'
  url 'http://freedesktop.org/software/pulseaudio/releases/pulseaudio-2.1.tar.gz'
  sha1 '957399478456c1dd5632bc84e9ee06a07a9c4c9c'

  head 'git://anongit.freedesktop.org/pulseaudio/pulseaudio'

  option "with-dbus", "Enable dbus"

  # Dependencies from http://www.freedesktop.org/wiki/Software/PulseAudio/Ports/OSX
  if build.head?
    depends_on :autoconf
    depends_on :automake
    depends_on :libtool 
  end

  depends_on 'pkg-config' => :build

  depends_on 'intltool'
  depends_on 'libsndfile'
  depends_on 'speex'
  depends_on 'gdbm'
  depends_on 'liboil'
  depends_on 'json-c'
  depends_on 'dbus' if build.include? 'with-dbus'

  def install
    args = ["--prefix=#{prefix}",
            "--disable-jack",
            "--disable-hal",
            "--disable-bluez",
            "--disable-avahi",
            "--with-udev-rules-dir=#{prefix}/lib/udev/rules.d",
            "--with-mac-sysroot=#{MacOS.sdk_path}",
            "--with-mac-version-min=#{MacOS.version}"]

    args << '--disable-dbus' unless build.include? 'with-dbus'
    args << "--disable-nls" if build.head? and not Formula.factory('libtool').installed?

    if build.head? then
      system "./autogen.sh", *args
    else
      system "./configure", *args
    end

    system "make"
    system "make install"
  end

  def test
    system "#{bin}/pulseaudio"
  end
end