ghostscript.mk 2.1 KB

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