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