[buildout]
extends =
  ../fontconfig/buildout.cfg
  ../freetype/buildout.cfg
  ../libtiff/buildout.cfg
  ../libxml2/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../xz-utils/buildout.cfg

parts = ghostscript

[ghostscript-common]
recipe = slapos.recipe.cmmi
shared = true
pkg_config_depends = ${libtiff:location}/lib/pkgconfig:${fontconfig:location}/lib/pkgconfig:${fontconfig:pkg_config_depends}
configure-options =
  --disable-cups
  --disable-threadsafe
  --with-system-libtiff
  --without-libidn
  --without-x
  --with-drivers=FILES
# it seems that parallel build sometimes fails for ghostscript.
make-options = -j1
environment =
  PATH=${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
  PKG_CONFIG_PATH=${:pkg_config_depends}
  LDFLAGS=-Wl,-rpath=${fontconfig:location}/lib -Wl,-rpath=${freetype:location}/lib -Wl,-rpath=${libtiff:location}/lib
  LD_LIBRARY_PATH=${fontconfig:location}/lib:${freetype:location}/lib:${libtiff:location}/lib:${libxml2:location}/lib

[ghostscript]
<= ghostscript-9

[ghostscript-9]
<= ghostscript-common
url = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/ghostscript-9.50.tar.xz
md5sum = 6cea6bae4a7cdfac6ccb09f07f0caf8c