diff options
| author | Xu Cheng | 2014-12-28 19:22:11 +0800 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-28 12:06:14 +0000 |
| commit | 8cf9a3fb56a3a32116b2d28830d505506da905d8 (patch) | |
| tree | 5e2a561c543681859522f715b35cd993b84415d4 /Library/Formula/ghostscript.rb | |
| parent | 98a9c5595ab546f3492d49918bdf24f4f156c2aa (diff) | |
| download | homebrew-8cf9a3fb56a3a32116b2d28830d505506da905d8.tar.bz2 | |
ghostscript: modernize
Diffstat (limited to 'Library/Formula/ghostscript.rb')
| -rw-r--r-- | Library/Formula/ghostscript.rb | 82 |
1 files changed, 40 insertions, 42 deletions
diff --git a/Library/Formula/ghostscript.rb b/Library/Formula/ghostscript.rb index f18b8fcb0..daab1b488 100644 --- a/Library/Formula/ghostscript.rb +++ b/Library/Formula/ghostscript.rb @@ -1,11 +1,9 @@ -require 'formula' - class Ghostscript < Formula - homepage 'http://www.ghostscript.com/' + homepage "http://www.ghostscript.com/" stable do - url 'http://downloads.ghostscript.com/public/ghostscript-9.15.tar.gz' - sha1 'f53bcc47e912c7bffc2ced62ed9311376fb18bab' + url "http://downloads.ghostscript.com/public/ghostscript-9.15.tar.gz" + sha1 "f53bcc47e912c7bffc2ced62ed9311376fb18bab" patch :DATA # Uncomment OS X-specific make vars end @@ -18,10 +16,10 @@ class Ghostscript < Formula end head do - url 'git://git.ghostscript.com/ghostpdl.git' + url "git://git.ghostscript.com/ghostpdl.git" resource 'djvu' do - url 'git://git.code.sf.net/p/djvu/gsdjvu-git' + url "git://git.code.sf.net/p/djvu/gsdjvu-git" end depends_on "autoconf" => :build @@ -35,30 +33,30 @@ class Ghostscript < Formula end end - option 'with-djvu', 'Build drivers for DjVU file format' + option "with-djvu", "Build drivers for DjVU file format" - depends_on 'pkg-config' => :build - depends_on 'jpeg' - depends_on 'libtiff' - depends_on 'jbig2dec' - depends_on 'little-cms2' - depends_on 'libpng' - depends_on :x11 => ['2.7.2', :optional] - depends_on 'djvulibre' if build.with? 'djvu' - depends_on 'freetype' + depends_on "pkg-config" => :build + depends_on "jpeg" + depends_on "libtiff" + depends_on "jbig2dec" + depends_on "little-cms2" + depends_on "libpng" + depends_on :x11 => ["2.7.2", :optional] + depends_on "djvulibre" if build.with? "djvu" + depends_on "freetype" - conflicts_with 'gambit-scheme', :because => 'both install `gsc` binaries' + conflicts_with "gambit-scheme", :because => "both install `gsc` binaries" # http://sourceforge.net/projects/gs-fonts/ - resource 'fonts' do - url 'https://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz' - sha1 '2a7198e8178b2e7dba87cb5794da515200b568f5' + resource "fonts" do + url "https://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz" + sha1 "2a7198e8178b2e7dba87cb5794da515200b568f5" end # http://djvu.sourceforge.net/gsdjvu.html - resource 'djvu' do - url 'https://downloads.sourceforge.net/project/djvu/GSDjVu/1.6/gsdjvu-1.6.tar.gz' - sha1 'a8c5520d698d8be558a1957b4e5108cba68822ef' + resource "djvu" do + url "https://downloads.sourceforge.net/project/djvu/GSDjVu/1.6/gsdjvu-1.6.tar.gz" + sha1 "a8c5520d698d8be558a1957b4e5108cba68822ef" end def move_included_source_copies @@ -72,13 +70,13 @@ class Ghostscript < Formula def install src_dir = build.head? ? "gs" : "." - resource('djvu').stage do - inreplace 'gsdjvu.mak', '$(GL', '$(DEV' - (buildpath+'devices').install 'gdevdjvu.c' - (buildpath+'lib').install 'ps2utf8.ps' - ENV['EXTRA_INIT_FILES'] = 'ps2utf8.ps' - (buildpath/'devices/contrib.mak').open('a') { |f| f.write(File.read('gsdjvu.mak')) } - end if build.with? 'djvu' + resource("djvu").stage do + inreplace "gsdjvu.mak", "$(GL", "$(DEV" + (buildpath+"devices").install "gdevdjvu.c" + (buildpath+"lib").install "ps2utf8.ps" + ENV["EXTRA_INIT_FILES"] = "ps2utf8.ps" + (buildpath/"devices/contrib.mak").open("a") { |f| f.write(File.read("gsdjvu.mak")) } + end if build.with? "djvu" cd src_dir do move_included_source_copies @@ -89,29 +87,29 @@ class Ghostscript < Formula --disable-gtk --with-system-libtiff ] - args << '--without-x' if build.without? 'x11' + args << "--without-x" if build.without? "x11" if build.head? - system './autogen.sh', *args + system "./autogen.sh", *args else - system './configure', *args + system "./configure", *args end # versioned stuff in main tree is pointless for us - inreplace 'Makefile', '/$(GS_DOT_VERSION)', '' + inreplace "Makefile", "/$(GS_DOT_VERSION)", "" - inreplace 'Makefile' do |s| - s.change_make_var!('DEVICE_DEVS17','$(DD)djvumask.dev $(DD)djvusep.dev') - end if build.with? 'djvu' + inreplace "Makefile" do |s| + s.change_make_var!("DEVICE_DEVS17","$(DD)djvumask.dev $(DD)djvusep.dev") + end if build.with? "djvu" # Install binaries and libraries - system 'make', 'install' - system 'make', 'install-so' + system "make", "install" + system "make", "install-so" end - (share+'ghostscript/fonts').install resource('fonts') + (share+"ghostscript/fonts").install resource("fonts") - (man+'de').rmtree + (man+"de").rmtree end end |
