2009-10-24 19:08:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-09-25 22:31:05 +00:00
|
|
|
class XpdfTarball < Formula
|
2012-04-09 07:20:13 +00:00
|
|
|
url 'ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.03.tar.gz', :using => :nounzip
|
|
|
|
sha1 '499423e8a795e0efd76ca798239eb4d0d52fe248'
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Swftools < Formula
|
2010-03-13 17:40:22 +00:00
|
|
|
homepage 'http://www.swftools.org'
|
2012-04-09 07:20:13 +00:00
|
|
|
url 'http://www.swftools.org/swftools-0.9.2.tar.gz'
|
|
|
|
sha1 'd7cf8874c4187d2edd3e40d20ba325ca17b91973'
|
2009-10-24 19:08:48 +00:00
|
|
|
|
2012-09-02 08:12:52 +00:00
|
|
|
option 'with-xpdf', 'Build with PDF support'
|
|
|
|
option 'with-jpeg', 'Build with JPEG support'
|
|
|
|
option 'with-lame', 'Build with MP3 support'
|
|
|
|
option 'with-giflib', 'Build with GIF support'
|
|
|
|
option 'with-fftw', 'Build with FFTW support'
|
|
|
|
|
|
|
|
depends_on :x11 if build.include? "with-xpdf"
|
|
|
|
depends_on 'jpeg' if build.include? "with-jpeg"
|
|
|
|
depends_on 'lame' if build.include? "with-lame"
|
|
|
|
depends_on 'giflib' if build.include? "with-giflib"
|
|
|
|
depends_on 'fftw' if build.include? "with-fftw"
|
2012-04-09 07:20:13 +00:00
|
|
|
|
|
|
|
def patches
|
|
|
|
# Fixes a conftest for libfftwf.dylib that mistakenly calls fftw_malloc()
|
|
|
|
# rather than fftwf_malloc(). Reported upstream to their mailing list:
|
|
|
|
# http://lists.nongnu.org/archive/html/swftools-common/2012-04/msg00014.html
|
|
|
|
# Patch is merged upstream. Remove at swftools-0.9.3.
|
|
|
|
DATA
|
|
|
|
end
|
2009-10-24 19:08:48 +00:00
|
|
|
|
|
|
|
def install
|
2012-09-25 22:31:05 +00:00
|
|
|
XpdfTarball.new.brew { (buildpath+'lib/pdf').install Dir['*'] } if build.include? "with-xpdf"
|
2009-10-24 19:08:48 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2012-09-02 08:12:52 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
mktemp do
|
|
|
|
system "#{bin}/png2swf", "swftools_test.swf", \
|
|
|
|
"/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png"
|
|
|
|
end
|
|
|
|
end
|
2009-10-24 19:08:48 +00:00
|
|
|
end
|
2012-04-09 07:20:13 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/configure 2012-04-08 10:25:35.000000000 -0700
|
|
|
|
+++ b/configure 2012-04-09 17:42:10.000000000 -0700
|
|
|
|
@@ -6243,7 +6243,7 @@
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
- char*data = fftw_malloc(sizeof(fftwf_complex)*600*800);
|
|
|
|
+ char*data = fftwf_malloc(sizeof(fftwf_complex)*600*800);
|
|
|
|
fftwf_plan plan = fftwf_plan_dft_2d(600, 800, (fftwf_complex*)data, (fftwf_complex*)data, FFTW_FORWARD, FFTW_ESTIMATE);
|
|
|
|
plan = fftwf_plan_dft_r2c_2d(600, 800, (float*)data, (fftwf_complex*)data, FFTW_ESTIMATE);
|
|
|
|
plan = fftwf_plan_dft_c2r_2d(600, 800, (fftwf_complex*)data, (float*)data, FFTW_ESTIMATE);
|