exfatprogs: update to 1.2.5
[feed/packages.git] / libs / libgd / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libgd
11 PKG_VERSION:=2.3.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/gd-$(PKG_VERSION)/
16 PKG_HASH:=3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61
17
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=GD
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:libgd:libgd
22
23 PKG_BUILD_FLAGS:=lto
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 define Package/libgd/default
29 SECTION:=libs
30 CATEGORY:=Libraries
31 DEPENDS:=+libjpeg +libpng +libwebp
32 TITLE:=The GD graphics library
33 URL:=https://libgd.github.io/
34 endef
35
36 define Package/libgd
37 $(call Package/libgd/default)
38 MENU:=1
39 DEPENDS+=+LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
40 VARIANT:=default
41 CONFLICTS:=libgd-full
42 endef
43
44 define Package/libgd-full
45 $(call Package/libgd/default)
46 DEPENDS+=+libtiff +libfreetype
47 TITLE+=(full)
48 VARIANT:=full
49 PROVIDES:=libgd
50 endef
51
52 define Package/libgd/description/default
53 GD is an open source code library for the dynamic creation of images by
54 programmers. GD creates PNG, JPEG and GIF images, among other formats.
55 endef
56
57 Package/libgd/description=$(Package/libgd/description/default)
58
59 define Package/libgd-full/description
60 $(call Package/libgd/description/default)
61 .
62 This variant of the libgd package is compiled will all features enabled.
63 endef
64
65 define Package/libgd/config
66 if PACKAGE_libgd
67 config LIBGD_TIFF
68 bool "TIFF image support"
69 default n
70 help
71 Enable TIFF image support through libtiff
72 endif
73 if PACKAGE_libgd
74 config LIBGD_FREETYPE
75 bool "Freetype 2.x library support"
76 default n
77 help
78 Enable Freetype 2.x font engine support through libfreetype
79 endif
80 endef
81
82 TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
83
84 CMAKE_OPTIONS += \
85 -DENABLE_FONTCONFIG=OFF \
86 -DENABLE_ICONV=OFF \
87 -DENABLE_JPEG=ON \
88 -DENABLE_LIQ=OFF \
89 -DENABLE_PNG=ON \
90 -DENABLE_TIFF=$(if $(CONFIG_LIBGD_TIFF),ON,OFF) \
91 -DENABLE_WEBP=ON \
92 -DENABLE_XPM=OFF \
93 -DZLIB_INCLUDE_DIR="$(STAGING_DIR)/usr"
94
95 ifeq ($(BUILD_VARIANT),full)
96 CMAKE_OPTIONS += \
97 -DENABLE_TIFF=ON \
98 -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
99 -DENABLE_FREETYPE=ON
100
101 else
102
103 ifdef CONFIG_LIBGD_FREETYPE
104 CMAKE_OPTIONS += \
105 -DFREETYPE_INCLUDE_DIRS=$(STAGING_DIR)/usr/include/freetype2/ \
106 -DENABLE_FREETYPE=ON
107 else
108 CMAKE_OPTIONS += \
109 -DENABLE_FREETYPE=OFF
110 endif
111
112 endif
113
114 define Build/InstallDev
115 $(call Build/InstallDev/cmake,$(1))
116 $(SED) 's,/usr/lib,$(STAGING_DIR)/usr/lib,g' $(1)/usr/lib/pkgconfig/gdlib.pc
117 $(SED) 's,/usr/include,$(STAGING_DIR)/include,g' $(1)/usr/lib/pkgconfig/gdlib.pc
118 endef
119
120 define Package/libgd/install
121 $(INSTALL_DIR) $(1)/usr/lib
122 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so* $(1)/usr/lib/
123 endef
124
125 Package/libgd-full/install=$(Package/libgd/install)
126
127 $(eval $(call BuildPackage,libgd))
128 $(eval $(call BuildPackage,libgd-full))