ghostscript.mk 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. # 0002-Bug-704342-Include-device-specifier-strings-in-acces.patch
  23. GHOSTSCRIPT_IGNORE_CVES += CVE-2021-3781
  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)/openjpeg $(@D)/tiff \
  30. $(@D)/zlib
  31. endef
  32. GHOSTSCRIPT_POST_PATCH_HOOKS += GHOSTSCRIPT_REMOVE_LIBS
  33. GHOSTSCRIPT_CONF_ENV = \
  34. CCAUX="$(HOSTCC)" \
  35. CFLAGSAUX="$(HOST_CFLAGS) $(HOST_LDFLAGS)" \
  36. PKGCONFIG="$(PKG_CONFIG_HOST_BINARY)"
  37. GHOSTSCRIPT_CONF_OPTS = \
  38. --disable-compile-inits \
  39. --enable-fontconfig \
  40. --with-fontpath=/usr/share/fonts \
  41. --enable-freetype \
  42. --disable-gtk \
  43. --without-libpaper \
  44. --with-system-libtiff
  45. ifeq ($(BR2_PACKAGE_JBIG2DEC),y)
  46. GHOSTSCRIPT_DEPENDENCIES += jbig2dec
  47. GHOSTSCRIPT_CONF_OPTS += --with-jbig2dec
  48. else
  49. GHOSTSCRIPT_CONF_OPTS += --without-jbig2dec
  50. endif
  51. ifeq ($(BR2_PACKAGE_LIBIDN),y)
  52. GHOSTSCRIPT_DEPENDENCIES += libidn
  53. GHOSTSCRIPT_CONF_OPTS += --with-libidn
  54. else
  55. GHOSTSCRIPT_CONF_OPTS += --without-libidn
  56. endif
  57. ifeq ($(BR2_PACKAGE_OPENJPEG),y)
  58. GHOSTSCRIPT_DEPENDENCIES += openjpeg
  59. GHOSTSCRIPT_CONF_OPTS += --enable-openjpeg
  60. else
  61. GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
  62. endif
  63. ifeq ($(BR2_PACKAGE_CUPS),y)
  64. GHOSTSCRIPT_DEPENDENCIES += cups
  65. GHOSTSCRIPT_CONF_OPTS += \
  66. CUPSCONFIG=$(STAGING_DIR)/usr/bin/cups-config \
  67. --enable-cups
  68. else
  69. GHOSTSCRIPT_CONF_OPTS += --disable-cups
  70. endif
  71. ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
  72. GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
  73. GHOSTSCRIPT_CONF_OPTS += --with-x
  74. else
  75. GHOSTSCRIPT_CONF_OPTS += --without-x
  76. endif
  77. $(eval $(autotools-package))