aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/portaudio.rb
blob: 35a37bb10ee06999757e396f2d5af0cf790a7471 (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
require 'formula'

class Portaudio < Formula
  url 'http://www.portaudio.com/archives/pa_stable_v19_20111121.tgz'
  homepage 'http://www.portaudio.com'
  md5 '25c85c1cc5e9e657486cbc299c6c035a'

  depends_on 'pkg-config' => :build

  fails_with :llvm do
    build 2334
  end

  def options
    [["--universal", "Build a universal binary."]]
  end

  # Fix PyAudio compilation on Lion
  def patches
    if MacOS.lion?
      "https://trac.macports.org/export/94150/trunk/dports/audio/portaudio/files/patch-include__pa_mac_core.h.diff"
    end
  end

  def install
    ENV.universal_binary if ARGV.build_universal?

    args = [ "--prefix=#{prefix}",
             "--disable-debug",
             "--disable-dependency-tracking",
             # portaudio builds universal unless told not to
             "--enable-mac-universal=#{ARGV.build_universal? ? 'yes' : 'no'}" ]

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

    # Need 'pa_mac_core.h' to compile PyAudio
    include.install "include/pa_mac_core.h"
  end
end