homebrew-core/Formula/pulseaudio.rb

85 lines
2.4 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-13.0.tar.xz"
sha256 "961b23ca1acfd28f2bc87414c27bb40e12436efcf2158d29721b1e89f3f28057"
bottle do
sha256 "a638afdb2e14989110a52ab860804ec0c005461d80398b736a641a678371bc3d" => :catalina
sha256 "819cb5b8dd86715db2285f647b1742611dd2a802447aea637f05adae33a6056b" => :mojave
sha256 "a5c5442b2118b9e3e3b2cbd8a8a700a121e9264b11c7096a3b3c42ce780a7a0b" => :high_sierra
sha256 "bc42617a58074e5631eae20559f6a043ee87c8dcfd9944ac45b47467a3cdca66" => :sierra
end
head do
url "https://anongit.freedesktop.org/git/pulseaudio/pulseaudio.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gettext" => :build
depends_on "intltool" => :build
end
depends_on "pkg-config" => :build
depends_on "json-c"
depends_on "libsndfile"
depends_on "libsoxr"
depends_on "libtool"
depends_on "openssl@1.1"
depends_on "speexdsp"
def install
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--enable-coreaudio-output
--disable-neon-opt
--disable-nls
--disable-x11
--with-mac-sysroot=#{MacOS.sdk_path}
--with-mac-version-min=#{MacOS.version}
]
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>--exit-idle-time=-1</string>
<string>--verbose</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>#{var}/log/#{name}.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/#{name}.log</string>
</dict>
</plist>
EOS
end
test do
assert_match "module-sine", shell_output("#{bin}/pulseaudio --dump-modules")
end
end