diff options
| author | Jack Nagel | 2013-09-18 15:57:52 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-18 15:57:52 -0500 |
| commit | 5a14f0ab35c183cecb493e59a2e97cda34859d2a (patch) | |
| tree | 2d3d87b17d526a811ed9e502957d3caee7bbf876 /Library/Formula/ghostscript.rb | |
| parent | f18baebe4e07a7b284036946583ac66609569f8b (diff) | |
| download | homebrew-5a14f0ab35c183cecb493e59a2e97cda34859d2a.tar.bz2 | |
ghostscript: use resources
Diffstat (limited to 'Library/Formula/ghostscript.rb')
| -rw-r--r-- | Library/Formula/ghostscript.rb | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/Library/Formula/ghostscript.rb b/Library/Formula/ghostscript.rb index b065caeb3..dc6939dca 100644 --- a/Library/Formula/ghostscript.rb +++ b/Library/Formula/ghostscript.rb @@ -1,25 +1,22 @@ require 'formula' -class GsDjVU < Formula - homepage 'http://djvu.sourceforge.net/gsdjvu.html' - url 'http://downloads.sourceforge.net/project/djvu/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' sha1 'b04a88ea8d661fc53d4f7eac34d84456272afc06' - head 'git://git.ghostscript.com/ghostpdl.git' + head do + url 'git://git.ghostscript.com/ghostpdl.git' + + resource 'djvu' do + url 'git://git.code.sf.net/p/djvu/gsdjvu-git' + end + end option 'with-djvu', 'Build drivers for DjVU file format' # TODO - figure out why this is needed - env :std if build.include? 'with-djvu' + env :std if build.with? 'djvu' if build.head? depends_on :automake @@ -32,7 +29,7 @@ class Ghostscript < Formula depends_on 'jbig2dec' depends_on :libpng depends_on :x11 => ['2.7.2', :optional] - depends_on 'djvulibre' if build.include? 'with-djvu' + depends_on 'djvulibre' if build.with? 'djvu' # http://sourceforge.net/projects/gs-fonts/ resource 'fonts' do @@ -40,6 +37,13 @@ class Ghostscript < Formula sha1 '2a7198e8178b2e7dba87cb5794da515200b568f5' end + # http://djvu.sourceforge.net/gsdjvu.html + resource 'djvu' do + url 'http://downloads.sourceforge.net/project/djvu/GSDjVu/1.5/gsdjvu-1.5.tar.gz' + version '1.5' + sha1 'c7d0677dae5fe644cf3d714c04b3c2c343906342' + end + # Fix dylib names, per installation instructions def patches DATA @@ -61,15 +65,13 @@ 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' - (buildpath/'base/contrib.mak').open('a').write(File.read('gsdjvu.mak')) - end - end + resource('djvu').stage do + inreplace 'gdevdjvu.c', /#include "gserror.h"/, '' + (buildpath+'base').install 'gdevdjvu.c' + (buildpath+'lib').install 'ps2utf8.ps' + ENV['EXTRA_INIT_FILES'] = 'ps2utf8.ps' + (buildpath/'base/contrib.mak').open('a').write(File.read('gsdjvu.mak')) + end if build.with? 'djvu' cd src_dir do move_included_source_copies @@ -93,7 +95,7 @@ class Ghostscript < Formula inreplace 'Makefile' do |s| s.change_make_var!('DEVICE_DEVS17','$(DD)djvumask.dev $(DD)djvusep.dev') - end if build.include? 'with-djvu' + end if build.with? 'djvu' # Install binaries and libraries system 'make install' |
