homebrew-core/Formula/jack.rb
2018-06-15 04:27:11 -07:00

68 lines
2.3 KiB
Ruby

# This now builds a version of JACKv1 which matches the current API
# for JACKv2. JACKv2 is not buildable on a number of macOS
# distributions, and the JACK team instead suggests installation of
# JACKOSX, a pre-built binary form for which the source is not available.
# If you require JACKv2, you should use that. Otherwise, this formula should
# operate fine.
# Please see https://github.com/Homebrew/homebrew/pull/22043 for more info
class Jack < Formula
desc "Audio Connection Kit"
homepage "http://jackaudio.org"
url "http://jackaudio.org/downloads/jack-audio-connection-kit-0.125.0.tar.gz"
sha256 "3517b5bff82139a76b2b66fe2fd9a3b34b6e594c184f95a988524c575b11d444"
revision 3
bottle do
sha256 "fccd8282d9bfb354ae7d6963eb4433b93a52c22cdfab047733ea1c93326fafad" => :high_sierra
sha256 "b9f624c969a2f782abe7c1cf4adbff04a9492db383584c5ca6cb24aa46d3857e" => :sierra
sha256 "825f40e89b4566ffaf11fd7feeb22cec00b2216de1890900442b3dda3fec1287" => :el_capitan
end
depends_on "pkg-config" => :build
depends_on "berkeley-db"
depends_on "libsndfile"
depends_on "libsamplerate"
def install
sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path
# Makefile hardcodes Carbon header location
inreplace Dir["drivers/coreaudio/Makefile.{am,in}"],
"/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h",
"#{sdk}/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h"
ENV["LINKFLAGS"] = ENV.ldflags
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
plist_options :manual => "jackd -d coreaudio"
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>WorkingDirectory</key>
<string>#{prefix}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/jackd</string>
<string>-d</string>
<string>coreaudio</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/jackd --version")
end
end