homebrew-core/Formula/pulseaudio.rb
2018-06-20 23:38:48 -07:00

96 lines
2.6 KiB
Ruby

class Pulseaudio < Formula
desc "Sound system for POSIX OSes"
homepage "https://wiki.freedesktop.org/www/Software/PulseAudio/"
url "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-12.0.tar.xz"
sha256 "6e422dbdc9fd11c0cb6af869e5eda73dc24a8be3c14725440edd51ce6b464444"
bottle do
sha256 "2c006b3a31c7954b98216f6a124947bfb20832e7c218552c10a4416b6e814147" => :high_sierra
sha256 "c5c10482da0a611492700637c565a6ff9ef02d9eb64222d5a47a313c664b2fe0" => :sierra
sha256 "b3badeccbf1cf174ecac48db89fbc9922283c352f53854eb1df9614ebae449b1" => :el_capitan
end
head do
url "https://anongit.freedesktop.org/git/pulseaudio/pulseaudio.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "intltool" => :build
depends_on "gettext" => :build
end
option "with-nls", "Build with native language support"
deprecated_option "without-speex" => "without-speexdsp"
depends_on "pkg-config" => :build
if build.with? "nls"
depends_on "intltool" => :build
depends_on "gettext" => :build
end
depends_on "libtool"
depends_on "json-c"
depends_on "libsndfile"
depends_on "libsoxr"
depends_on "openssl"
depends_on "speexdsp" => :recommended
depends_on "glib" => :optional
depends_on "gconf" => :optional
depends_on "gtk+3" => :optional
depends_on "jack" => :optional
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=#{MacOS.sdk_path}
--with-mac-version-min=#{MacOS.version}
--disable-x11
]
args << "--disable-nls" if build.without? "nls"
if build.head?
# autogen.sh runs bootstrap.sh then ./configure
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
end
plist_options :manual => "pulseaudio"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/pulseaudio</string>
<string>--start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
assert_match "module-sine", shell_output("#{bin}/pulseaudio --dump-modules")
end
end