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.

121 lines
2.8 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.3.0
  10. PKG_RELEASE:=1
  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:=ecd9155b9a417fb3f837f29e5966323796de247789163761dd72dbf83bfcac58
  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:libgd
  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_TIFF=$(if $(CONFIG_LIBGD_TIFF),ON,OFF) \
  75. -DENABLE_WEBP=ON \
  76. -DENABLE_XPM=OFF \
  77. -DZLIB_INCLUDE_DIR="$(STAGING_DIR)/usr"
  78. ifeq ($(BUILD_VARIANT),full)
  79. CMAKE_OPTIONS += \
  80. -DENABLE_TIFF=ON \
  81. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  82. -DENABLE_FREETYPE=ON
  83. else
  84. ifdef CONFIG_LIBGD_FREETYPE
  85. CMAKE_OPTIONS += \
  86. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  87. -DENABLE_FREETYPE=ON
  88. else
  89. CMAKE_OPTIONS += \
  90. -DENABLE_FREETYPE=OFF
  91. endif
  92. endif
  93. define Package/libgd/install
  94. $(INSTALL_DIR) $(1)/usr/lib
  95. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so* $(1)/usr/lib/
  96. endef
  97. Package/libgd-full/install=$(Package/libgd/install)
  98. $(eval $(call BuildPackage,libgd))
  99. $(eval $(call BuildPackage,libgd-full))