ghostscript.mk 2.2 KB

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