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.

126 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
  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. CONFLICTS:=libgd-full
  33. endef
  34. define Package/libgd-full
  35. $(call Package/libgd/default)
  36. DEPENDS+=+libtiff +libfreetype
  37. TITLE+=(full)
  38. VARIANT:=full
  39. PROVIDES:=libgd
  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 Build/InstallDev
  94. $(call Build/InstallDev/cmake,$(1))
  95. $(SED) 's,/usr/lib,$(STAGING_DIR)/usr/lib,g' $(1)/usr/lib/pkgconfig/gdlib.pc
  96. $(SED) 's,/usr/include,$(STAGING_DIR)/include,g' $(1)/usr/lib/pkgconfig/gdlib.pc
  97. endef
  98. define Package/libgd/install
  99. $(INSTALL_DIR) $(1)/usr/lib
  100. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so* $(1)/usr/lib/
  101. endef
  102. Package/libgd-full/install=$(Package/libgd/install)
  103. $(eval $(call BuildPackage,libgd))
  104. $(eval $(call BuildPackage,libgd-full))