ocp: use new dsl

This commit is contained in:
Adam Vandenberg 2012-09-02 11:50:23 -07:00
parent b4bb08e5b7
commit 3a5757710d

View file

@ -1,34 +1,32 @@
require "formula"
class Ocp < Formula
url "http://downloads.sourceforge.net/project/opencubicplayer/ocp-0.1.21/ocp-0.1.21.tar.bz2"
md5 '558a6eacfadfd9c60c97a6e9c7f83f47'
homepage "http://sourceforge.net/p/opencubicplayer/home/"
url "http://downloads.sourceforge.net/project/opencubicplayer/ocp-0.1.21/ocp-0.1.21.tar.bz2"
sha1 "aaa16cf1979c572b09c73e7cc61350bfc4477380"
option "without-mad", "disable mad mpeg audio support"
option "without-flac", "disable FLAC support"
option "with-adplug", "enable adplug support"
depends_on "libvorbis"
depends_on "mad" unless ARGV.include? "--without-mad"
depends_on "flac" unless ARGV.include? "--without-flac"
depends_on "adplug" if ARGV.include? "--with-adplug"
def options
[
["--without-mad", "disable mad mpeg audio support"],
["--without-flac", "disable FLAC support"],
["--with-adplug", "enable adplug support"],
]
end
depends_on "mad" => :recommended unless build.include? "without-mad"
depends_on "flac" => :recommended unless build.include? "without-flac"
depends_on "adplug" => :optional if build.include? "with-adplug"
def install
ENV.deparallelize
args = ["--prefix=#{prefix}",
"--without-x11",
"--without-sdl",
"--without-desktop_file_install"]
args = %W[
--prefix=#{prefix}
--without-x11
--without-sdl
--without-desktop_file_install
]
args << "--without-mad" if ARGV.include? "--without-mad"
args << "--without-flac" if ARGV.include? "--without-flac"
args << "--with-adplug" if ARGV.include? "--with-adplug"
args << "--without-mad" if build.include? "without-mad"
args << "--without-flac" if build.include? "without-flac"
args << "--with-adplug" if build.include? "with-adplug"
system "./configure", *args
system "make"