a9a2d47fc5
The gs formula stopped working after libtiff was upgraded to 4.0.1. It gives an error `no rule to make target obj/libtiff_.dev`. Add the `--with-system-libtiff` flag so it compiles against 4.0.1. Remove the `--disable-debug` flag, which is not a valid option. Add deps on little-cms2 and jbig2dec and Add `lcms2` and `jbig2dec` to the `renames` variable so that gs will properly link against those two libraries that many people already have installed who deal with images frequently. Without those additions on systems with `lcms2` and `jbig2dec` installed, `configure` will find them but not link correctly against them. `autogen.sh` automatically calls configure and warns the user that it is running configure with no args, explaining how to put the args after `autogen.sh` if args are desired. Do that for head builds. It is proper and saves configure from being run twice when brewing head. Fixes Homebrew/homebrew#12098 Signed-off-by: Adam Vandenberg <flangy@gmail.com>
72 lines
1.9 KiB
Ruby
72 lines
1.9 KiB
Ruby
require 'formula'
|
|
|
|
class GhostscriptFonts < Formula
|
|
homepage 'http://sourceforge.net/projects/gs-fonts/'
|
|
url 'http://downloads.sourceforge.net/project/gs-fonts/gs-fonts/8.11%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-8.11.tar.gz'
|
|
md5 '6865682b095f8c4500c54b285ff05ef6'
|
|
end
|
|
|
|
class Ghostscript < Formula
|
|
homepage 'http://www.ghostscript.com/'
|
|
url 'http://downloads.ghostscript.com/public/ghostscript-9.05.tar.gz'
|
|
md5 'f7c6f0431ca8d44ee132a55d583212c1'
|
|
|
|
head 'git://git.ghostscript.com/ghostpdl.git'
|
|
|
|
depends_on 'pkg-config' => :build
|
|
depends_on 'jpeg'
|
|
depends_on 'libtiff'
|
|
depends_on 'jbig2dec'
|
|
depends_on 'little-cms2'
|
|
|
|
if ARGV.build_head? and MacOS.xcode_version >= "4.3"
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
end
|
|
|
|
def move_included_source_copies
|
|
# If the install version of any of these doesn't match
|
|
# the version included in ghostscript, we get errors
|
|
# Taken from the MacPorts portfile - http://bit.ly/ghostscript-portfile
|
|
renames = %w(jpeg libpng tiff zlib lcms2 jbig2dec)
|
|
renames << "freetype" if 10.7 <= MACOS_VERSION
|
|
renames.each do |lib|
|
|
mv lib, "#{lib}_local"
|
|
end
|
|
end
|
|
|
|
def install
|
|
ENV.libpng
|
|
ENV.deparallelize
|
|
# ghostscript configure ignores LDFLAGs apparently
|
|
ENV['LIBS'] = "-L/usr/X11/lib"
|
|
|
|
src_dir = ARGV.build_head? ? "gs" : "."
|
|
|
|
cd src_dir do
|
|
move_included_source_copies
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--disable-cups
|
|
--disable-compile-inits
|
|
--disable-gtk
|
|
--with-system-libtiff
|
|
]
|
|
|
|
if ARGV.build_head?
|
|
system './autogen.sh', *args
|
|
else
|
|
system './configure', *args
|
|
end
|
|
# versioned stuff in main tree is pointless for us
|
|
inreplace 'Makefile', '/$(GS_DOT_VERSION)', ''
|
|
system "make install"
|
|
end
|
|
|
|
GhostscriptFonts.new.brew do
|
|
(share+'ghostscript').install '../fonts'
|
|
end
|
|
|
|
(man+'de').rmtree
|
|
end
|
|
end
|