homebrew-core/Formula/shairport-sync.rb

92 lines
2.5 KiB
Ruby

class ShairportSync < Formula
desc "AirTunes emulator that adds multi-room capability"
homepage "https://github.com/mikebrady/shairport-sync"
url "https://github.com/mikebrady/shairport-sync/archive/3.3.7.tar.gz"
sha256 "7f8d4ecec53f2f681a962467bf09205568fc936c8c31a9ee07b1bd72d3d95b12"
license "MIT"
head "https://github.com/mikebrady/shairport-sync.git", branch: "development"
livecheck do
url :stable
strategy :github_latest
end
bottle do
rebuild 1
sha256 arm64_big_sur: "ef60c478cd72141489399f23790442691c75df2019e5c83200a28fbeacc4c943"
sha256 big_sur: "9b2ab0fbb73a44beca8d4d79bfc47ee1a7ecc2e2c30390bc5f38f53e98be7938"
sha256 catalina: "6f89f17dec98194146ad0fbbadb987efc8c6bda21c0f0b5d549a308a248abdd6"
sha256 mojave: "0ed4ea3dd099b0ee7f518b2a0a2fe1c48ff6c4bdb56efb963cb1e1c8c36586c2"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "pkg-config" => :build
depends_on "libao"
depends_on "libconfig"
depends_on "libdaemon"
depends_on "libsoxr"
depends_on "openssl@1.1"
depends_on "popt"
depends_on "pulseaudio"
def install
system "autoreconf", "-fvi"
args = %W[
--with-os=darwin
--with-libdaemon
--with-ssl=openssl
--with-dns_sd
--with-ao
--with-stdout
--with-pa
--with-pipe
--with-soxr
--with-metadata
--with-piddir=#{var}/run
--sysconfdir=#{etc}/shairport-sync
--prefix=#{prefix}
]
system "./configure", *args
system "make", "install"
end
def post_install
(var/"run").mkpath
end
plist_options manual: "shairport-sync"
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}/shairport-sync</string>
<string>--use-stderr</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
output = shell_output("#{bin}/shairport-sync -V")
assert_match "libdaemon-OpenSSL-dns_sd-ao-pa-stdout-pipe-soxr-metadata", output
end
end