ghostscript.mk 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. # 0002-Bug-702582-CVE-2020-15900-Memory-Corruption-in-Ghostscript-9-52.patch
  25. GHOSTSCRIPT_IGNORE_CVES += CVE-2020-15900
  26. # Ghostscript includes (old) copies of several libraries, delete them.
  27. # Inspired by linuxfromscratch:
  28. # http://www.linuxfromscratch.org/blfs/view/svn/pst/gs.html
  29. define GHOSTSCRIPT_REMOVE_LIBS
  30. rm -rf $(@D)/freetype $(@D)/ijs $(@D)/jbig2dec $(@D)/jpeg \
  31. $(@D)/lcms2mt $(@D)/libpng $(@D)/openjpeg $(@D)/tiff \
  32. $(@D)/zlib
  33. endef
  34. GHOSTSCRIPT_POST_PATCH_HOOKS += GHOSTSCRIPT_REMOVE_LIBS
  35. GHOSTSCRIPT_CONF_ENV = \
  36. CCAUX="$(HOSTCC)" \
  37. CFLAGSAUX="$(HOST_CFLAGS) $(HOST_LDFLAGS)"
  38. GHOSTSCRIPT_CONF_OPTS = \
  39. --disable-compile-inits \
  40. --enable-fontconfig \
  41. --with-fontpath=/usr/share/fonts \
  42. --enable-freetype \
  43. --disable-gtk \
  44. --without-libpaper \
  45. --with-system-libtiff
  46. ifeq ($(BR2_PACKAGE_JBIG2DEC),y)
  47. GHOSTSCRIPT_DEPENDENCIES += jbig2dec
  48. GHOSTSCRIPT_CONF_OPTS += --with-jbig2dec
  49. else
  50. GHOSTSCRIPT_CONF_OPTS += --without-jbig2dec
  51. endif
  52. ifeq ($(BR2_PACKAGE_LIBIDN),y)
  53. GHOSTSCRIPT_DEPENDENCIES += libidn
  54. GHOSTSCRIPT_CONF_OPTS += --with-libidn
  55. else
  56. GHOSTSCRIPT_CONF_OPTS += --without-libidn
  57. endif
  58. ifeq ($(BR2_PACKAGE_OPENJPEG),y)
  59. GHOSTSCRIPT_DEPENDENCIES += openjpeg
  60. GHOSTSCRIPT_CONF_OPTS += --enable-openjpeg
  61. else
  62. GHOSTSCRIPT_CONF_OPTS += --disable-openjpeg
  63. endif
  64. ifeq ($(BR2_PACKAGE_CUPS),y)
  65. GHOSTSCRIPT_DEPENDENCIES += cups
  66. GHOSTSCRIPT_CONF_OPTS += \
  67. CUPSCONFIG=$(STAGING_DIR)/usr/bin/cups-config \
  68. --enable-cups
  69. else
  70. GHOSTSCRIPT_CONF_OPTS += --disable-cups
  71. endif
  72. ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
  73. GHOSTSCRIPT_DEPENDENCIES += xlib_libX11
  74. GHOSTSCRIPT_CONF_OPTS += --with-x
  75. else
  76. GHOSTSCRIPT_CONF_OPTS += --without-x
  77. endif
  78. $(eval $(autotools-package))