homebrew-core/Formula/pianobar.rb

46 lines
1.4 KiB
Ruby

class Pianobar < Formula
desc "Command-line player for https://pandora.com"
homepage "https://github.com/PromyLOPh/pianobar/"
url "https://6xq.net/pianobar/pianobar-2020.04.05.tar.bz2"
sha256 "6c173b6b29ccc1f432e0013fb425e8f9cb4261539b58d344e0b2274963726480"
license "MIT"
revision 3
head "https://github.com/PromyLOPh/pianobar.git"
bottle do
cellar :any
sha256 "110b9a11046cc7948262816411c4ea7c8674ec058593e9a1af4346566fb804a2" => :catalina
sha256 "be9f0156fdb9b50bf22186072d93dba7cf7789888a7ddfaeb51a7f6820099262" => :mojave
sha256 "1982754d59d3f1e01bf1ec265690634ea2578f354e52aa7670292b7d2703126a" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "ffmpeg"
depends_on "json-c"
depends_on "libao"
depends_on "libgcrypt"
uses_from_macos "curl"
def install
# Discard Homebrew's CFLAGS as Pianobar reportedly doesn't like them
ENV["CFLAGS"] = "-O2 -DNDEBUG " +
# Or it doesn't build at all
"-std=c99 " +
# build if we aren't /usr/local'
"#{ENV.cppflags} #{ENV.ldflags}"
system "make", "PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
prefix.install "contrib"
end
test do
require "pty"
PTY.spawn(bin/"pianobar") do |stdout, stdin, _pid|
stdin.putc "\n"
assert_match "pianobar (#{version})", stdout.read
end
end
end