aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/pulseaudio.rb
blob: 38ff6501f92ac9b3c4c00d66065ffbed5c82c655 (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
56
57
58
59
60
require 'formula'

class Pulseaudio < Formula
  homepage "http://pulseaudio.org"
  url "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-5.0.tar.xz"
  sha1 "e420931a0b9cf37331cd06e30ba415046317ab85"

  option "with-nls", "Build with native language support"
  option :universal

  depends_on "pkg-config" => :build
  depends_on "libtool" => :build
  depends_on "intltool" => :build if build.with? "nls"
  depends_on "gettext" => :build if build.with? "nls"

  depends_on "json-c"
  depends_on "libsndfile"
  depends_on "libsamplerate"

  depends_on :x11 => :optional
  depends_on "glib" => :optional
  depends_on "gconf" => :optional
  depends_on "d-bus" => :optional
  depends_on "gtk+3" => :optional
  depends_on "jack" => :optional

  # i386 patch per MacPorts
  patch :p0 do
    url "https://trac.macports.org/export/119615/trunk/dports/audio/pulseaudio/files/i386.patch"
    sha1 "4193a6112f90d103875d2ca91462c26d811a9386"
  end

  fails_with :clang do
    build 421
    cause "error: thread-local storage is unsupported for the current target"
  end

  def install
    args = %W[
      --disable-dependency-tracking
      --disable-silent-rules
      --prefix=#{prefix}
      --enable-coreaudio-output
      --disable-neon-opt
      --with-mac-sysroot=/
    ]

    args << "--with-mac-sysroot=#{MacOS.sdk_path}"
    args << "--with-mac-version-min=#{MacOS.version}"
    args << "--disable-nls" if build.without? "nls"

    if build.universal?
      args << "--enable-mac-universal"
      ENV.universal_binary
    end

    system "./configure", *args
    system "make", "install"
  end
end