2010-07-28 17:09:39 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Installs a relatively minimalist version of the GPAC tools. The
|
|
|
|
# most commonly used tool in this package is the MP4Box metadata
|
|
|
|
# interleaver, which has relatively few dependencies.
|
|
|
|
#
|
|
|
|
# The challenge with building everything is that Gpac depends on
|
|
|
|
# a much older version of FFMpeg and WxWidgets than the version
|
|
|
|
# that Brew installs
|
|
|
|
#
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gpac < Formula
|
2010-07-28 17:09:39 +00:00
|
|
|
url 'http://downloads.sourceforge.net/gpac/gpac-0.4.5.tar.gz'
|
|
|
|
homepage 'http://gpac.sourceforge.net/index.php'
|
|
|
|
md5 '755e8c438a48ebdb13525dd491f5b0d1'
|
2011-02-12 14:04:49 +00:00
|
|
|
head 'https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac', :using => :svn
|
2010-07-28 17:09:39 +00:00
|
|
|
|
2011-11-03 17:22:37 +00:00
|
|
|
depends_on 'a52dec' => :optional
|
|
|
|
depends_on 'jpeg' => :optional
|
|
|
|
depends_on 'faad2' => :optional
|
|
|
|
depends_on 'libogg' => :optional
|
|
|
|
depends_on 'libvorbis' => :optional
|
|
|
|
depends_on 'mad' => :optional
|
2010-07-28 17:09:39 +00:00
|
|
|
depends_on 'sdl' => :optional
|
2011-11-03 17:22:37 +00:00
|
|
|
depends_on 'theora' => :optional
|
2011-11-17 03:36:29 +00:00
|
|
|
|
2011-11-03 17:22:37 +00:00
|
|
|
depends_on 'ffmpeg' => :optional if ARGV.build_head?
|
|
|
|
depends_on 'openjpeg' => :optional if ARGV.build_head?
|
2010-07-28 17:09:39 +00:00
|
|
|
|
2011-11-17 03:36:29 +00:00
|
|
|
def options
|
|
|
|
[['--with-lowercase', 'Install binaries with lowercase names']]
|
|
|
|
end
|
|
|
|
|
2010-07-28 17:09:39 +00:00
|
|
|
def install
|
|
|
|
ENV.deparallelize
|
2012-02-26 14:28:48 +00:00
|
|
|
|
2011-11-03 17:22:37 +00:00
|
|
|
args = ["--disable-wx",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}",
|
2012-02-26 14:28:48 +00:00
|
|
|
# gpac build system is barely functional
|
|
|
|
"--extra-cflags=-I/usr/X11/include",
|
2011-11-03 17:22:37 +00:00
|
|
|
# Force detection of X libs on 64-bit kernel
|
|
|
|
"--extra-ldflags=-L/usr/X11/lib"]
|
|
|
|
args << "--use-ffmpeg=no" unless ARGV.build_head?
|
|
|
|
args << "--use-openjpeg=no" unless ARGV.build_head?
|
|
|
|
|
2010-07-28 17:09:39 +00:00
|
|
|
system "chmod +x configure"
|
2011-11-03 17:22:37 +00:00
|
|
|
system "./configure", *args
|
2011-11-17 03:36:29 +00:00
|
|
|
|
2011-11-03 17:22:37 +00:00
|
|
|
system "chmod", "+rw", "Makefile"
|
|
|
|
["MP4Box","MP4Client"].each do |name|
|
2011-12-28 18:18:06 +00:00
|
|
|
filename = "applications/#{name.downcase}/Makefile"
|
2011-11-03 17:22:37 +00:00
|
|
|
system "chmod", "+rw", filename
|
2011-11-17 03:36:29 +00:00
|
|
|
|
|
|
|
if ARGV.include? '--with-lowercase'
|
|
|
|
inreplace filename, name, name.downcase
|
|
|
|
inreplace "Makefile", name, name.downcase
|
|
|
|
end
|
2011-11-03 17:22:37 +00:00
|
|
|
end
|
|
|
|
|
2010-07-28 17:09:39 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|