port freetype to buildroot-ng
[packages.git] / libs / freetype / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libfreetype
12 PKG_VERSION:=2.1.9
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/freetype-$(PKG_VERSION)
16 PKG_SOURCE:=freetype-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=@SF/freetype
18 PKG_MD5SUM:=ec1b903e4be5f073caa72458ea58c29c
19 PKG_CAT:=bzcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libfreetype
26   SECTION:=libs
27   CATEGORY:=Libraries
28   DEPENDS:=+zlib
29   TITLE:=A free, high-quality and portable font engine
30   DESCRIPTION:=A free, high-quality and portable font engine.\\\
31     The FreeType project is a team of volunteers who develop free, \\\
32     portable and high-quality software solutions for digital typography.\\\
33     They specifically target embedded systems and focus on bringing small, \\\
34     efficient and ubiquitous products.
35   URL:=http://www.freetype.org/
36 endef
37
38 define Build/Configure
39         (cd $(PKG_BUILD_DIR); rm -f config.cache; \
40                 CFLAGS="$(TARGET_CFLAGS)" \
41                 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
42                 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
43                 $(TARGET_CONFIGURE_OPTS) \
44                 ./configure \
45                         --target=$(GNU_TARGET_NAME) \
46                         --host=$(GNU_TARGET_NAME) \
47                         --build=$(GNU_HOST_NAME) \
48                         --program-prefix="" \
49                         --program-suffix="" \
50                         --prefix=/usr \
51                         --exec-prefix=/usr \
52                         --bindir=/usr/bin \
53                         --sbindir=/usr/sbin \
54                         --libexecdir=/usr/lib \
55                         --sysconfdir=/etc \
56                         --datadir=/usr/share \
57                         --localstatedir=/var \
58                         --mandir=/usr/man \
59                         --infodir=/usr/info \
60                         $(DISABLE_NLS) \
61                         $(DISABLE_LARGEFILE) \
62                         --enable-shared=yes \
63                         --enable-static=yes \
64                         --disable-rpath \
65         );
66 endef
67
68 define Build/Compile
69         rm -rf $(PKG_INSTALL_DIR)
70         mkdir -p $(PKG_INSTALL_DIR)
71         $(MAKE) -C $(PKG_BUILD_DIR) \
72                 DESTDIR="$(PKG_INSTALL_DIR)" \
73                 all install
74 endef
75
76 define Package/libfreetype/install
77         install -d -m0755 $(1)/usr/lib
78         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreetype.so.* $(1)/usr/lib/
79 endef
80
81 define Build/InstallDev
82         mkdir -p $(STAGING_DIR)/usr/bin
83         $(CP) $(PKG_INSTALL_DIR)/usr/bin/freetype-config $(STAGING_DIR)/usr/bin/
84         mkdir -p $(STAGING_DIR)/usr/include
85         $(CP) $(PKG_INSTALL_DIR)/usr/include/freetype2 $(STAGING_DIR)/usr/include/
86         $(CP) $(PKG_INSTALL_DIR)/usr/include/ft2build.h $(STAGING_DIR)/usr/include/
87         mkdir -p $(STAGING_DIR)/usr/lib
88         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfreetype.{a,so*} $(STAGING_DIR)/usr/lib/
89         mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
90         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/freetype2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
91 endef
92
93 define Build/UninstallDev
94         rm -rf \
95                 $(STAGING_DIR)/usr/bin/freetype-config \
96                 $(STAGING_DIR)/usr/include/freetype2 \
97                 $(STAGING_DIR)/usr/include/ft2build.h \
98                 $(STAGING_DIR)/usr/lib/libfreetype.{a,so*} \
99                 $(STAGING_DIR)/usr/lib/pkgconfig/freetype2.pc
100 endef
101
102 $(eval $(call BuildPackage,libfreetype))