ghostscript.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ################################################################################
  2. #
  3. # ghostscript
  4. #
  5. ################################################################################
  6. GHOSTSCRIPT_VERSION = 9.50
  7. GHOSTSCRIPT_SITE = https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$(subst .,,$(GHOSTSCRIPT_VERSION))
  8. GHOSTSCRIPT_SOURCE = ghostscript-$(GHOSTSCRIPT_VERSION).tar.xz
  9. GHOSTSCRIPT_LICENSE = AGPL-3.0
  10. GHOSTSCRIPT_LICENSE_FILES = LICENSE
  11. # 0001-Fix-cross-compilation-issue.patch
  12. GHOSTSCRIPT_AUTORECONF = YES
  13. GHOSTSCRIPT_DEPENDENCIES = \
  14. host-lcms2 \
  15. host-libjpeg \
  16. host-pkgconf \
  17. host-zlib \
  18. fontconfig \
  19. ghostscript-fonts \
  20. jpeg \
  21. lcms2 \
  22. libpng \
  23. tiff
  24. # Ghostscript includes (old) copies of several libraries, delete them.
  25. # Inspired by linuxfromscratch:
  26. # http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html
  27. define GHOSTSCRIPT_REMOVE_LIBS
  28. rm -rf $(@D)/freetype $(@D)/ijs $(@D)/jbig2dec $(@D)/jpeg \
  29. $(@D)/lcms2mt $(@D)/libpng $(@D)/tiff $(@D)/zlib
  30. endef
  31. GHOSTSCRIPT_POST_PATCH_HOOKS += GHOSTSCRIPT_REMOVE_LIBS
  32. GHOSTSCRIPT_CONF_ENV = \
  33. CCAUX="$(HOSTCC)" \
  34. CFLAGSAUX="$(HOST_CFLAGS) $(HOST_LDFLAGS)"
  35. GHOSTSCRIPT_CONF_OPTS = \
  36. --disable-compile-inits \
  37. --disable-cups \
  38. --enable-fontconfig \
  39. --with-fontpath=/usr/share/fonts \
  40. --enable-freetype \
  41. --disable-gtk \
  42. --without-libpaper \
  43. --with-system-libtiff
  44. ifeq ($(BR2_PACKAGE_JBIG2DEC),y)
  45. GHOSTSCRIPT_DEPENDENCIES += jbig2dec
  46. GHOSTSCRIPT_CONF_OPTS += --with-jbig2dec
  47. else
  48. GHOSTSCRIPT_CONF_OPTS += --without-jbig2dec
  49. endif
  50. ifeq ($(BR2_PACKAGE_LIBIDN),y)
  51. GHOSTSCRIPT_DEPENDENCIES += libidn
  52. GHOSTSCRIPT_CONF_OPTS += --with-libidn
  53. else
  54. GHOSTSCRIPT_CONF_OPTS += --without-libidn
  55. endif
  56. ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
  57. GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
  58. GHOSTSCRIPT_CONF_OPTS += --with-x
  59. else
  60. GHOSTSCRIPT_CONF_OPTS += --without-x
  61. endif
  62. $(eval $(autotools-package))