You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libgd
  9. PKG_VERSION:=2.2.5
  10. PKG_RELEASE:=6
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/gd-$(PKG_VERSION)/
  13. PKG_HASH:=8c302ccbf467faec732f0741a859eef4ecae22fea2d2ab87467be940842bde51
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  15. PKG_LICENSE:=MIT
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:libgd:gd_graphics_library
  18. CMAKE_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/libgd/default
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. DEPENDS:=+libjpeg +libpng +libwebp +LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
  26. TITLE:=The GD graphics library
  27. URL:=https://libgd.github.io/
  28. endef
  29. define Package/libgd
  30. $(call Package/libgd/default)
  31. MENU:=1
  32. DEPENDS+=+LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
  33. VARIANT:=default
  34. endef
  35. define Package/libgd-full
  36. $(call Package/libgd/default)
  37. DEPENDS+=+libtiff +libfreetype
  38. TITLE+=(full)
  39. VARIANT:=full
  40. endef
  41. define Package/libgd/description/default
  42. GD is an open source code library for the dynamic creation of images by
  43. programmers. GD creates PNG, JPEG and GIF images, among other formats.
  44. endef
  45. Package/libgd/description=$(Package/libgd/description/default)
  46. define Package/libgd-full/description
  47. $(call Package/libgd/description/default)
  48. .
  49. This variant of the libgd package is compiled will all features enabled.
  50. endef
  51. define Package/libgd/config
  52. if PACKAGE_libgd
  53. config LIBGD_TIFF
  54. bool "TIFF image support"
  55. default n
  56. help
  57. Enable TIFF image support through libtiff
  58. endif
  59. if PACKAGE_libgd
  60. config LIBGD_FREETYPE
  61. bool "Freetype 2.x library support"
  62. default n
  63. help
  64. Enable Freetype 2.x font engine support through libfreetype
  65. endif
  66. endef
  67. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
  68. CMAKE_OPTIONS += \
  69. -DENABLE_FONTCONFIG=OFF \
  70. -DENABLE_ICONV=OFF \
  71. -DENABLE_JPEG=ON \
  72. -DENABLE_LIQ=OFF \
  73. -DENABLE_PNG=ON \
  74. -DENABLE_WEBP=ON \
  75. -DENABLE_XPM=OFF \
  76. -DZLIB_INCLUDE_DIR="$(STAGING_DIR)/usr"
  77. ifeq ($(BUILD_VARIANT),full)
  78. CMAKE_OPTIONS += \
  79. -DENABLE_TIFF=ON \
  80. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  81. -DENABLE_FREETYPE=ON
  82. else
  83. ifdef CONFIG_LIBGD_TIFF
  84. CMAKE_OPTIONS += \
  85. -DENABLE_TIFF=ON
  86. else
  87. CMAKE_OPTIONS += \
  88. -DENABLE_TIFF=OFF
  89. endif
  90. ifdef CONFIG_LIBGD_FREETYPE
  91. CMAKE_OPTIONS += \
  92. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  93. -DENABLE_FREETYPE=ON
  94. else
  95. CMAKE_OPTIONS += \
  96. -DENABLE_FREETYPE=OFF
  97. endif
  98. endif
  99. define Package/libgd/install
  100. $(INSTALL_DIR) $(1)/usr/lib
  101. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so* $(1)/usr/lib/
  102. endef
  103. Package/libgd-full/install=$(Package/libgd/install)
  104. $(eval $(call BuildPackage,libgd))
  105. $(eval $(call BuildPackage,libgd-full))