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.

124 lines
3.0 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.2
  10. PKG_RELEASE:=$(AUTORELEASE)
  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:=478a047084e0d89b83616e4c2cf3c9438175fb0cc55d8c8967f06e0427f7d7fb
  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. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/cmake.mk
  20. define Package/libgd/default
  21. SECTION:=libs
  22. CATEGORY:=Libraries
  23. DEPENDS:=+libjpeg +libpng +libwebp +LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
  24. TITLE:=The GD graphics library
  25. URL:=https://libgd.github.io/
  26. endef
  27. define Package/libgd
  28. $(call Package/libgd/default)
  29. MENU:=1
  30. DEPENDS+=+LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
  31. VARIANT:=default
  32. endef
  33. define Package/libgd-full
  34. $(call Package/libgd/default)
  35. DEPENDS+=+libtiff +libfreetype
  36. TITLE+=(full)
  37. VARIANT:=full
  38. endef
  39. define Package/libgd/description/default
  40. GD is an open source code library for the dynamic creation of images by
  41. programmers. GD creates PNG, JPEG and GIF images, among other formats.
  42. endef
  43. Package/libgd/description=$(Package/libgd/description/default)
  44. define Package/libgd-full/description
  45. $(call Package/libgd/description/default)
  46. .
  47. This variant of the libgd package is compiled will all features enabled.
  48. endef
  49. define Package/libgd/config
  50. if PACKAGE_libgd
  51. config LIBGD_TIFF
  52. bool "TIFF image support"
  53. default n
  54. help
  55. Enable TIFF image support through libtiff
  56. endif
  57. if PACKAGE_libgd
  58. config LIBGD_FREETYPE
  59. bool "Freetype 2.x library support"
  60. default n
  61. help
  62. Enable Freetype 2.x font engine support through libfreetype
  63. endif
  64. endef
  65. TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
  66. CMAKE_OPTIONS += \
  67. -DENABLE_FONTCONFIG=OFF \
  68. -DENABLE_ICONV=OFF \
  69. -DENABLE_JPEG=ON \
  70. -DENABLE_LIQ=OFF \
  71. -DENABLE_PNG=ON \
  72. -DENABLE_TIFF=$(if $(CONFIG_LIBGD_TIFF),ON,OFF) \
  73. -DENABLE_WEBP=ON \
  74. -DENABLE_XPM=OFF \
  75. -DZLIB_INCLUDE_DIR="$(STAGING_DIR)/usr"
  76. ifeq ($(BUILD_VARIANT),full)
  77. CMAKE_OPTIONS += \
  78. -DENABLE_TIFF=ON \
  79. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  80. -DENABLE_FREETYPE=ON
  81. else
  82. ifdef CONFIG_LIBGD_FREETYPE
  83. CMAKE_OPTIONS += \
  84. -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
  85. -DENABLE_FREETYPE=ON
  86. else
  87. CMAKE_OPTIONS += \
  88. -DENABLE_FREETYPE=OFF
  89. endif
  90. endif
  91. define Build/InstallDev
  92. $(call Build/InstallDev/cmake,$(1))
  93. $(SED) 's,/usr/lib,$(STAGING_DIR)/usr/lib,g' $(1)/usr/lib/pkgconfig/gdlib.pc
  94. $(SED) 's,/usr/include,$(STAGING_DIR)/include,g' $(1)/usr/lib/pkgconfig/gdlib.pc
  95. endef
  96. define Package/libgd/install
  97. $(INSTALL_DIR) $(1)/usr/lib
  98. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so* $(1)/usr/lib/
  99. endef
  100. Package/libgd-full/install=$(Package/libgd/install)
  101. $(eval $(call BuildPackage,libgd))
  102. $(eval $(call BuildPackage,libgd-full))