Created
January 16, 2015 15:46
-
-
Save mykebates/09bb94c3e5952746949b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Mpd < Formula | |
homepage "http://www.musicpd.org/" | |
stable do | |
url "http://www.musicpd.org/download/mpd/0.19/mpd-0.19.4.tar.xz" | |
sha1 "f0397d7e923cd11fef8dae238efe9ae9ff12120f" | |
end | |
bottle do | |
sha1 "38d6602a734389d74c4ea37d73819930cbf9eada" => :yosemite | |
sha1 "14160a3231b017c04bb2fff41db315f47927d969" => :mavericks | |
sha1 "6bcccd5c053c08f580e9df775d987e3917f8f27f" => :mountain_lion | |
end | |
head do | |
url "git://git.musicpd.org/master/mpd.git" | |
depends_on "autoconf" => :build | |
depends_on "automake" => :build | |
end | |
option "with-wavpack", "Build with wavpack support (for .wv files)" | |
option "with-lastfm", "Build with last-fm support (for experimental Last.fm radio)" | |
option "with-lame", "Build with lame support (for MP3 encoding when streaming)" | |
option "with-two-lame", "Build with two-lame support (for MP2 encoding when streaming)" | |
option "with-flac", "Build with flac support (for Flac encoding when streaming)" | |
option "with-libvorbis", "Build with vorbis support (for Ogg encoding)" | |
option "with-yajl", "Build with yajl support (for playing from soundcloud)" | |
option "with-opus", "Build with opus support (for Opus encoding and decoding)" | |
option "with-despotify", "enable support for despotify" | |
option "with-shout", "enables the shoutcast streaming output" | |
deprecated_option "with-vorbis" => "with-libvorbis" | |
depends_on "pkg-config" => :build | |
depends_on "boost" => :build | |
depends_on "glib" | |
depends_on "libid3tag" | |
depends_on "sqlite" | |
depends_on "libsamplerate" | |
depends_on "icu4c" | |
needs :cxx11 | |
depends_on "libmpdclient" | |
depends_on "ffmpeg" # lots of codecs | |
# mpd also supports mad, mpg123, libsndfile, and audiofile, but those are | |
# redundant with ffmpeg | |
depends_on "fluid-synth" # MIDI | |
depends_on "faad2" # MP4/AAC | |
depends_on "wavpack" => :optional # WavPack | |
depends_on "libshout" => :optional # Streaming (also pulls in Vorbis encoding) | |
depends_on "lame" => :optional # MP3 encoding | |
depends_on "two-lame" => :optional # MP2 encoding | |
depends_on "flac" => :optional # Flac encoding | |
depends_on "jack" => :optional # Output to JACK | |
depends_on "libmms" => :optional # MMS input | |
depends_on "libzzip" => :optional # Reading from within ZIPs | |
depends_on "yajl" => :optional # JSON library for SoundCloud | |
depends_on "opus" => :optional # Opus support | |
depends_on "libvorbis" => :optional | |
def install | |
# mpd specifies -std=gnu++0x, but clang appears to try to build | |
# that against libstdc++ anyway, which won't work. | |
# The build is fine with G++. | |
ENV.libcxx | |
system "./autogen.sh" if build.head? | |
args = %W[ | |
--disable-debug | |
--disable-dependency-tracking | |
--prefix=#{prefix} | |
--enable-bzip2 | |
--enable-ffmpeg | |
--enable-fluidsynth | |
--enable-osx | |
--disable-libwrap | |
] | |
args << "--disable-mad" | |
args << "--disable-curl" if MacOS.version <= :leopard | |
args << "--enable-zzip" if build.with? "libzzip" | |
args << "--enable-lastfm" if build.with? "lastfm" | |
args << "--disable-lame-encoder" if build.without? "lame" | |
args << "--disable-soundcloud" if build.without? "yajl" | |
args << "--enable-vorbis-encoder" if build.with? "libvorbis" | |
args << "--enable-despotify" | |
args << "--enable-shout" | |
system "./configure", *args | |
system "make" | |
ENV.j1 # Directories are created in parallel, so let's not do that | |
system "make install" | |
end | |
plist_options :manual => "mpd" | |
def plist; <<-EOS.undent | |
<?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>#{HOMEBREW_PREFIX}</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>#{opt_bin}/mpd</string> | |
<string>--no-daemon</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<true/> | |
</dict> | |
</plist> | |
EOS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment