diff options
| author | Joey Korkames | 2013-01-01 15:29:07 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-06-08 16:31:15 -0700 |
| commit | 5730f7ebbe100aa12c7bece35cf74c6b81157615 (patch) | |
| tree | 876403b0e538c13480f6fe1986ff14472c5cc040 /Library/Formula/ghostscript.rb | |
| parent | 13c998390960f5eefa290fb2352be67b8f85c80c (diff) | |
| download | homebrew-5730f7ebbe100aa12c7bece35cf74c6b81157615.tar.bz2 | |
Ghostscript: add DjVU support
Closes #16830.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/ghostscript.rb')
| -rw-r--r-- | Library/Formula/ghostscript.rb | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Library/Formula/ghostscript.rb b/Library/Formula/ghostscript.rb index 7056d5983..f90cf192e 100644 --- a/Library/Formula/ghostscript.rb +++ b/Library/Formula/ghostscript.rb @@ -6,6 +6,15 @@ class GhostscriptFonts < Formula sha1 '2a7198e8178b2e7dba87cb5794da515200b568f5' end +class GsDjVU < Formula + homepage 'http://djvu.sourceforge.net/gsdjvu.html' + url 'http://sourceforge.net/projects/djvu/files/GSDjVu/1.5/gsdjvu-1.5.tar.gz' + version '1.5' + sha1 'c7d0677dae5fe644cf3d714c04b3c2c343906342' + + head 'git://git.code.sf.net/p/djvu/gsdjvu-git' +end + class Ghostscript < Formula homepage 'http://www.ghostscript.com/' url 'http://downloads.ghostscript.com/public/ghostscript-9.07.tar.gz' @@ -14,6 +23,7 @@ class Ghostscript < Formula head 'git://git.ghostscript.com/ghostpdl.git' option 'with-x11', 'Install with X11 support' + option 'with-djvu', 'Build drivers for DjVU file format' if build.head? depends_on :automake @@ -26,6 +36,7 @@ class Ghostscript < Formula depends_on 'jbig2dec' depends_on :libpng depends_on :x11 => '2.7.2' if build.include? 'with-x11' + depends_on 'djvulibre' if build.include? 'with-djvu' # Fix dylib names, per installation instructions def patches @@ -48,6 +59,16 @@ class Ghostscript < Formula src_dir = build.head? ? "gs" : "." + if build.include? 'with-djvu' + GsDjVU.new.brew do + inreplace 'gdevdjvu.c', /#include "gserror.h"/, '' + (buildpath+'base').install 'gdevdjvu.c' + (buildpath+'lib').install 'ps2utf8.ps' + ENV['EXTRA_INIT_FILES'] = 'ps2utf8.ps' + File.open((buildpath+'base/contrib.mak'),'a'){|f|f.write(IO.read('gsdjvu.mak'))} #cat + end + end + cd src_dir do move_included_source_copies args = %W[ @@ -68,9 +89,13 @@ class Ghostscript < Formula # versioned stuff in main tree is pointless for us inreplace 'Makefile', '/$(GS_DOT_VERSION)', '' + inreplace 'Makefile' do |s| + s.change_make_var!('DEVICE_DEVS17','$(DD)djvumask.dev $(DD)djvusep.dev') + end if build.include? 'with-djvu' + # Install binaries and libraries - system "make install" - system "make install-so" + system 'make install' + system 'make install-so' end GhostscriptFonts.new.brew do |
