[buildout]
extends =
  ../software-profiles/fontconfig.cfg

parts = ghostscript

[ghostscript-hooks-download]
recipe = hexagonit.recipe.download
url = http://www.nexedi.org/static/buildout-hooks/ghostscript-hooks.py-r40044
filename = ghostscript-hooks.py
md5sum = 731475648c91507bd1dfe2a61ee84552
download-only = true

[ghostscript-common]
recipe = hexagonit.recipe.cmmi
pre-configure-hook = ${ghostscript-hooks-download:location}/${ghostscript-hooks-download:filename}:pre_configure_hook
# we don't include TIFF output driver because the linking might fail if
# libjbig-devel is installed, and it is not required for our purpose anyway.
configure-options =
  --disable-cups --without-x --with-drivers=BMP,PBM,PNG,PS
# it seems that parallel build sometimes fails for ghostscript.
make-options = -j1
environment =
  CFLAGS=-I${fontconfig:location}/include
  LDFLAGS=-L${fontconfig:location}/lib -Wl,-rpath -Wl,${fontconfig:location}/lib

[ghostscript]
# we prefer ghostscript-8 for now, because ghostscript-9.00 seems to have a
# problem with Japanese fonts if -dTextAlphaBits=4 is specified by
# imagemagick.
<= ghostscript-8

[ghostscript-9]
<= ghostscript-common
url = http://ghostscript.com/releases/ghostscript-9.00.tar.gz
md5sum = a402462478b4cdda3e1816899227b845

[ghostscript-8]
<= ghostscript-common
url = http://www.nexedi.org/static/tarballs/ghostscript/ghostscript-8.71-no-looping-symlink.tar.bz2
md5sum = 34639af3ffe8594f2c5ea944dfbe1d78