Merge pull request #4180 from michael-dev/features/libpq-pkgconfig-files
[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.2.4
12 PKG_RELEASE:=2
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:=137f13a7eb93ce72e32ccd7cebdab6874f8cf7ddf31d3a455a68e016ecd9e4e6
17 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
18 PKG_LICENSE:=MIT
19
20 PKG_FIXUP:=autoreconf
21
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/libgd
28 SECTION:=libs
29 CATEGORY:=Libraries
30 DEPENDS:=+libjpeg +libpng +LIBGD_TIFF:libtiff +LIBGD_FREETYPE:libfreetype
31 TITLE:=The GD graphics library
32 URL:=http://www.libgd.org/
33 MENU:=1
34 endef
35
36 define Package/libgd/description
37 GD is an open source code library for the dynamic creation of images by
38 programmers. GD creates PNG, JPEG and GIF images, among other formats.
39 endef
40
41 define Package/libgd/config
42 if PACKAGE_libgd
43 config LIBGD_TIFF
44 bool "TIFF image support"
45 default n
46 help
47 Enable TIFF image support through libtiff
48 endif
49 if PACKAGE_libgd
50 config LIBGD_FREETYPE
51 bool "Freetype 2.x library support"
52 default n
53 help
54 Enable Freetype 2.x font engine support through libfreetype
55 endif
56 endef
57
58 TARGET_CFLAGS += $(FPIC)
59
60 CONFIGURE_ARGS += \
61 --enable-shared \
62 --enable-static \
63 --disable-rpath \
64 --without-x \
65 --without-fontconfig \
66 --with-jpeg=$(STAGING_DIR)/usr \
67 --with-png=$(STAGING_DIR)/usr \
68 --without-xpm
69
70 ifdef CONFIG_LIBGD_TIFF
71 CONFIGURE_ARGS+= \
72 --with-tiff=$(STAGING_DIR)/usr
73 else
74 CONFIGURE_ARGS+= \
75 --without-tiff
76 endif
77
78 ifdef CONFIG_LIBGD_FREETYPE
79 CONFIGURE_ARGS+= \
80 --with-freetype=$(STAGING_DIR)/usr
81 else
82 CONFIGURE_ARGS+= \
83 --without-freetype
84 endif
85
86 CONFIGURE_VARS += \
87 ac_cv_header_iconv_h=no
88
89 define Build/InstallDev
90 $(INSTALL_DIR) $(1)/usr/bin
91 $(CP) $(PKG_INSTALL_DIR)/usr/bin/gdlib-config $(1)/usr/bin/
92 $(SED) \
93 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
94 $(1)/usr/bin/gdlib-config
95 $(INSTALL_DIR) $(1)/usr/include
96 $(CP) $(PKG_INSTALL_DIR)/usr/include/entities.h $(1)/usr/include/
97 $(CP) $(PKG_INSTALL_DIR)/usr/include/gd{,_color_map,_errors,_io,cache,fontg,fontl,fontmb,fonts,fontt,fx,pp}.h \
98 $(1)/usr/include/
99 $(INSTALL_DIR) $(1)/usr/lib
100 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.{a,la,so*} $(1)/usr/lib/
101 $(INSTALL_DIR) $(2)/bin
102 $(LN) ../../usr/bin/gdlib-config $(2)/bin/
103 endef
104
105 define Package/libgd/install
106 $(INSTALL_DIR) $(1)/usr/lib
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgd.so.* $(1)/usr/lib/
108 endef
109
110 $(eval $(call BuildPackage,libgd))