homebrew-core/Formula/libmpdclient.rb
2020-01-11 11:03:06 +01:00

36 lines
1.2 KiB
Ruby

class Libmpdclient < Formula
desc "Library for MPD in the C, C++, and Objective-C languages"
homepage "https://www.musicpd.org/libs/libmpdclient/"
url "https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.17.tar.xz"
sha256 "ee9b8f1c7e95b65c8f18a354daf7b16bfcd455fc52a0f3b5abe402316bce3559"
head "https://github.com/MusicPlayerDaemon/libmpdclient.git"
bottle do
cellar :any
sha256 "50582687cdd7253ed54f1546560de8af52fd5a2a9a498ff54f61f78d3d93ef94" => :catalina
sha256 "00448724103d2e46f09f820ab73acf60fefab37262828b0448bb02b374c2f4db" => :mojave
sha256 "c946033764c18e8d8eb89a349e89b304024acfefac569455690a23c6e487a5f4" => :high_sierra
end
depends_on "doxygen" => :build
depends_on "meson-internal" => :build
depends_on "ninja" => :build
def install
system "meson", "--prefix=#{prefix}", ".", "output"
system "ninja", "-C", "output"
system "ninja", "-C", "output", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <mpd/client.h>
int main() {
mpd_connection_new(NULL, 0, 30000);
return 0;
}
EOS
system ENV.cc, "test.cpp", "-L#{lib}", "-lmpdclient", "-o", "test"
system "./test"
end
end