[buildout]
extends =
  fontconfig.cfg
  libjpeg.cfg
  libtiff.cfg
  pkgconfig.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
configure-options =
  --disable-cups
  --disable-cairo
  --without-x
  --with-drivers=FILES
# it seems that parallel build sometimes fails for ghostscript.
make-options = -j1
environment =
  PATH=${pkgconfig:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${fontconfig:location}/lib/pkgconfig
  CPPFLAGS=-I${libtiff:location}/include
  LDFLAGS=-Wl,-rpath -Wl,${fontconfig:location}/lib -L${libjpeg:location}/lib -Wl,-rpath -Wl,${libjpeg:location}/lib -L${libtiff:location}/lib -Wl,-rpath -Wl,${libtiff:location}/lib
  LD_LIBRARY_PATH=${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