class Ncmpc < Formula desc "Curses Music Player Daemon (MPD) client" homepage "https://www.musicpd.org/clients/ncmpc/" url "https://www.musicpd.org/download/ncmpc/0/ncmpc-0.30.tar.xz" sha256 "e3fe0cb58b8a77f63fb1645c2f974b334f1614efdc834ec698ee7d861f1b12a3" bottle do sha256 "6ccc21b95ad0603a163fb790bd920ed680313ae75a93aac79e57a11ada7fbf6a" => :high_sierra sha256 "fc2d55287927be971b13587c1cda6b379ad5804ec09ac8bbc85cd6b87c064e26" => :sierra sha256 "242415e2c3fc29b9c863fd0ce5ff5b4ac66eccc17f79af4b102f43fddaf543fb" => :el_capitan end depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "gcc" if DevelopmentTools.clang_build_version <= 800 depends_on "gettext" depends_on "glib" depends_on "libmpdclient" fails_with :clang do build 800 cause "error: no matching constructor for initialization of 'value_type'" end def install sdk = MacOS::CLT.installed? ? "" : MacOS.sdk_path # Fix undefined symbols _COLORS, _COLS, etc. # Reported 21 Sep 2017 https://github.com/MusicPlayerDaemon/ncmpc/issues/6 (buildpath/"ncurses.pc").write <<~EOS Name: ncurses Description: ncurses Version: 5.4 Libs: -L/usr/lib -lncurses Cflags: -I#{sdk}/usr/include EOS ENV.prepend_path "PKG_CONFIG_PATH", buildpath mkdir "build" do system "meson", "--prefix=#{prefix}", ".." system "ninja", "install" end end test do system bin/"ncmpc", "--help" end end