gd.mk 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ################################################################################
  2. #
  3. # gd
  4. #
  5. ################################################################################
  6. GD_VERSION = 2.2.5
  7. GD_SOURCE = libgd-$(GD_VERSION).tar.xz
  8. GD_SITE = https://github.com/libgd/libgd/releases/download/gd-$(GD_VERSION)
  9. GD_INSTALL_STAGING = YES
  10. GD_LICENSE = GD license
  11. GD_LICENSE_FILES = COPYING
  12. GD_CONFIG_SCRIPTS = gdlib-config
  13. GD_CONF_OPTS = --without-x --disable-rpath --disable-werror
  14. GD_DEPENDENCIES = host-pkgconf
  15. # 0001-bmp-check-return-value-in-gdImageBmpPtr.patch
  16. GD_IGNORE_CVES += CVE-2018-1000222
  17. # 0002-Fix-420-Potential-infinite-loop-in-gdImageCreateFrom.patch
  18. GD_IGNORE_CVES += CVE-2018-5711
  19. # 0003-Fix-501-Uninitialized-read-in-gdImageCreateFromXbm-C.patch
  20. GD_IGNORE_CVES += CVE-2019-11038
  21. # 0004-Fix-492-Potential-double-free-in-gdImage-Ptr.patch
  22. GD_IGNORE_CVES += CVE-2019-6978
  23. # 0005-Fix-potential-NULL-pointer-dereference-in-gdImageClone.patch
  24. GD_IGNORE_CVES += CVE-2018-14553
  25. # 0006-Fix-497-gdImageColorMatch-Out-Of-Bounds-Write-on-Heap-CVE-2019-6977.patch
  26. GD_IGNORE_CVES += CVE-2019-6977
  27. # gd forgets to link utilities with -pthread even though it uses
  28. # pthreads, causing linking errors with static linking
  29. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  30. GD_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
  31. endif
  32. ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
  33. GD_DEPENDENCIES += fontconfig
  34. GD_CONF_OPTS += --with-fontconfig
  35. endif
  36. ifeq ($(BR2_PACKAGE_FREETYPE),y)
  37. GD_DEPENDENCIES += freetype
  38. GD_CONF_OPTS += --with-freetype=$(STAGING_DIR)/usr
  39. else
  40. GD_CONF_OPTS += --without-freetype
  41. endif
  42. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  43. GD_DEPENDENCIES += libiconv
  44. # not strictly needed for gd, but ensures -liconv ends up in
  45. # gdlib-config --libs output
  46. GD_CONF_ENV += LIBS="-liconv"
  47. endif
  48. ifeq ($(BR2_PACKAGE_JPEG),y)
  49. GD_DEPENDENCIES += jpeg
  50. GD_CONF_OPTS += --with-jpeg
  51. endif
  52. ifeq ($(BR2_PACKAGE_LIBPNG),y)
  53. GD_DEPENDENCIES += libpng
  54. GD_CONF_OPTS += --with-png
  55. else
  56. GD_CONF_OPTS += --without-png
  57. endif
  58. ifeq ($(BR2_PACKAGE_WEBP),y)
  59. GD_DEPENDENCIES += webp
  60. GD_CONF_OPTS += --with-webp
  61. else
  62. GD_CONF_OPTS += --without-webp
  63. endif
  64. ifeq ($(BR2_PACKAGE_TIFF),y)
  65. GD_DEPENDENCIES += tiff
  66. GD_CONF_OPTS += --with-tiff
  67. else
  68. GD_CONF_OPTS += --without-tiff
  69. endif
  70. ifeq ($(BR2_PACKAGE_XLIB_LIBXPM),y)
  71. GD_DEPENDENCIES += xlib_libXpm
  72. GD_CONF_OPTS += --with-xpm
  73. endif
  74. ifeq ($(BR2_PACKAGE_ZLIB),y)
  75. GD_DEPENDENCIES += zlib
  76. endif
  77. GD_TOOLS_$(BR2_PACKAGE_GD_ANNOTATE) += annotate
  78. GD_TOOLS_$(BR2_PACKAGE_GD_BDFTOGD) += bdftogd
  79. GD_TOOLS_$(BR2_PACKAGE_GD_GD2COPYPAL) += gd2copypal
  80. GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOGIF) += gd2togif
  81. GD_TOOLS_$(BR2_PACKAGE_GD_GD2TOPNG) += gd2topng
  82. GD_TOOLS_$(BR2_PACKAGE_GD_GDCMPGIF) += gdcmpgif
  83. GD_TOOLS_$(BR2_PACKAGE_GD_GDPARTTOPNG) += gdparttopng
  84. GD_TOOLS_$(BR2_PACKAGE_GD_GDTOPNG) += gdtopng
  85. GD_TOOLS_$(BR2_PACKAGE_GD_GIFTOGD2) += giftogd2
  86. GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD) += pngtogd
  87. GD_TOOLS_$(BR2_PACKAGE_GD_PNGTOGD2) += pngtogd2
  88. GD_TOOLS_$(BR2_PACKAGE_GD_WEBPNG) += webpng
  89. define GD_REMOVE_TOOLS
  90. rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(GD_TOOLS_))
  91. endef
  92. GD_POST_INSTALL_TARGET_HOOKS += GD_REMOVE_TOOLS
  93. $(eval $(autotools-package))