2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2005-04-26 08:26:14 +02:00
|
|
|
#
|
|
|
|
# freetype
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2011-10-21 14:19:59 +02:00
|
|
|
|
2014-12-31 14:40:43 +01:00
|
|
|
FREETYPE_VERSION = 2.5.5
|
2008-10-09 14:50:56 +02:00
|
|
|
FREETYPE_SOURCE = freetype-$(FREETYPE_VERSION).tar.bz2
|
2013-12-05 15:04:47 +01:00
|
|
|
FREETYPE_SITE = http://downloads.sourceforge.net/project/freetype/freetype2/$(FREETYPE_VERSION)
|
2008-10-09 14:50:56 +02:00
|
|
|
FREETYPE_INSTALL_STAGING = YES
|
2014-09-27 21:32:38 +02:00
|
|
|
FREETYPE_MAKE_OPTS = CCexe="$(HOSTCC)"
|
2012-12-27 06:39:10 +01:00
|
|
|
FREETYPE_LICENSE = Dual FTL/GPLv2+
|
2012-12-28 01:34:17 +01:00
|
|
|
FREETYPE_LICENSE_FILES = docs/FTL.TXT docs/GPLv2.TXT
|
2013-10-27 00:44:54 +02:00
|
|
|
FREETYPE_DEPENDENCIES = host-pkgconf
|
2013-02-07 13:35:06 +01:00
|
|
|
FREETYPE_CONFIG_SCRIPTS = freetype-config
|
2008-10-09 14:50:56 +02:00
|
|
|
|
2012-10-22 17:47:52 +02:00
|
|
|
HOST_FREETYPE_DEPENDENCIES = host-pkgconf
|
2014-09-27 21:32:44 +02:00
|
|
|
HOST_FREETYPE_CONF_OPTS = --without-zlib --without-bzip2 --without-png
|
2013-10-27 00:44:54 +02:00
|
|
|
|
2014-04-22 19:12:40 +02:00
|
|
|
# Regen required because the tarball ships with an experimental ltmain.sh
|
|
|
|
# that can't be patched by our infra.
|
|
|
|
# autogen.sh is because autotools stuff lives in other directories and
|
2014-09-27 21:32:50 +02:00
|
|
|
# even AUTORECONF with _OPTS doesn't do it properly.
|
2014-04-22 19:12:40 +02:00
|
|
|
# POST_PATCH is because we still need to patch libtool after the regen.
|
|
|
|
define FREETYPE_RUN_AUTOGEN
|
|
|
|
cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
|
|
|
|
endef
|
|
|
|
FREETYPE_POST_PATCH_HOOKS += FREETYPE_RUN_AUTOGEN
|
2014-04-23 03:10:21 +02:00
|
|
|
HOST_FREETYPE_POST_PATCH_HOOKS += FREETYPE_RUN_AUTOGEN
|
2014-04-22 19:12:40 +02:00
|
|
|
FREETYPE_DEPENDENCIES += host-automake host-autoconf host-libtool
|
|
|
|
HOST_FREETYPE_DEPENDENCIES += host-automake host-autoconf host-libtool
|
|
|
|
|
2013-10-27 00:44:54 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
|
|
|
FREETYPE_DEPENDENCIES += zlib
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += --with-zlib
|
2013-10-27 00:44:54 +02:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += --without-zlib
|
2013-10-27 00:44:54 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_BZIP2),y)
|
|
|
|
FREETYPE_DEPENDENCIES += bzip2
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += --with-bzip2
|
2013-10-27 00:44:54 +02:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += --without-bzip2
|
2013-10-27 00:44:54 +02:00
|
|
|
endif
|
2009-11-03 00:10:08 +01:00
|
|
|
|
2013-10-25 13:34:38 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBPNG),y)
|
|
|
|
FREETYPE_DEPENDENCIES += libpng
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += LIBPNG_CFLAGS="`$(STAGING_DIR)/usr/bin/libpng-config --cflags`" \
|
2013-10-25 13:34:38 +02:00
|
|
|
LIBPNG_LDFLAGS="`$(STAGING_DIR)/usr/bin/libpng-config --ldflags`"
|
2013-11-10 15:03:09 +01:00
|
|
|
FREETYPE_LIBPNG_LIBS = "`$(STAGING_DIR)/usr/bin/libpng-config --libs`"
|
2013-10-25 13:34:38 +02:00
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
FREETYPE_CONF_OPTS += --without-png
|
2013-10-25 13:34:38 +02:00
|
|
|
endif
|
|
|
|
|
2013-06-13 15:00:23 +02:00
|
|
|
# Extra fixing since includedir and libdir are expanded from configure values
|
|
|
|
define FREETYPE_FIX_CONFIG_FILE
|
|
|
|
$(SED) 's:^includedir=.*:includedir="$${prefix}/include":' \
|
|
|
|
-e 's:^libdir=.*:libdir="$${exec_prefix}/lib":' \
|
|
|
|
$(STAGING_DIR)/usr/bin/freetype-config
|
|
|
|
endef
|
|
|
|
FREETYPE_POST_INSTALL_STAGING_HOOKS += FREETYPE_FIX_CONFIG_FILE
|
|
|
|
|
2013-11-10 15:03:09 +01:00
|
|
|
# libpng isn't included in freetype-config & freetype2.pc :-/
|
|
|
|
define FREETYPE_FIX_CONFIG_FILE_LIBS
|
|
|
|
$(SED) "s,^Libs.private:,& $(FREETYPE_LIBPNG_LIBS)," \
|
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/freetype2.pc
|
|
|
|
$(SED) "s,-lfreetype,& $(FREETYPE_LIBPNG_LIBS)," \
|
|
|
|
$(STAGING_DIR)/usr/bin/freetype-config
|
|
|
|
endef
|
|
|
|
FREETYPE_POST_INSTALL_STAGING_HOOKS += FREETYPE_FIX_CONFIG_FILE_LIBS
|
|
|
|
|
freetype: fix double installation
Eric_L on IRC reported that the following strange behavior: the first
installation of freetype works, and then each time you do "make
freetype-dirclean freetype", it fails and works alternatively, in a
fully reproducible manner.
After some investigation, it turns out that the problem is caused by
the creation of the symbolic link /usr/include/freetype2/freetype ->
/usr/include/freetype2 for backward compatibility reasons by
freetype.mk, in a post-staging installation hook. As the symbolic link
is created *after* the installation, the first installation works
fine. However, the second installation fails because the freetype
build system does:
./builds/unix/mkinstalldirs \
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/config
[...]
rm -f /home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config/*
rmdir /home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config
[...]
/usr/bin/install -c -m 644 ./builds/unix/ftconfig.h \
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/config/ftconfig.h
This last line fails, because due to the symbolic link mentioned above, the
command 'rmdir
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config'
has in fact the consequence of deleting the 'config' directory created
by the mkinstalldirs command.
The proposed solution to solve this problem is to remove the symbolic link
in a pre-install hook, run the installation, and restore the symbolic link.
[Peter: minor tweaks to commit message / comment]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-03 22:19:24 +02:00
|
|
|
# Version 2.5.1 reorganized headers out of freetype2/freetype.
|
|
|
|
# It is unexpected for some packages so symlink it until it spreads
|
|
|
|
# upstream. Note that we also have to remove the symlink prior to the
|
|
|
|
# installation process, because the installation process of freetype
|
|
|
|
# removes usr/include/Freetype2/freetype/config, before installing
|
|
|
|
# something in usr/include/Freetype2/config/ which no longer exists
|
|
|
|
# due to the symbolic link.
|
|
|
|
define FREETYPE_REMOVE_FREETYPE_INCLUDE_SYMLINK
|
|
|
|
$(RM) -f $(STAGING_DIR)/usr/include/freetype2/freetype
|
|
|
|
endef
|
|
|
|
FREETYPE_PRE_INSTALL_STAGING_HOOKS += FREETYPE_REMOVE_FREETYPE_INCLUDE_SYMLINK
|
2013-12-06 03:15:34 +01:00
|
|
|
define FREETYPE_FIX_FREETYPE_INCLUDE
|
|
|
|
ln -sf . $(STAGING_DIR)/usr/include/freetype2/freetype
|
|
|
|
endef
|
|
|
|
FREETYPE_POST_INSTALL_STAGING_HOOKS += FREETYPE_FIX_FREETYPE_INCLUDE
|
freetype: fix double installation
Eric_L on IRC reported that the following strange behavior: the first
installation of freetype works, and then each time you do "make
freetype-dirclean freetype", it fails and works alternatively, in a
fully reproducible manner.
After some investigation, it turns out that the problem is caused by
the creation of the symbolic link /usr/include/freetype2/freetype ->
/usr/include/freetype2 for backward compatibility reasons by
freetype.mk, in a post-staging installation hook. As the symbolic link
is created *after* the installation, the first installation works
fine. However, the second installation fails because the freetype
build system does:
./builds/unix/mkinstalldirs \
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/config
[...]
rm -f /home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config/*
rmdir /home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config
[...]
/usr/bin/install -c -m 644 ./builds/unix/ftconfig.h \
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/config/ftconfig.h
This last line fails, because due to the symbolic link mentioned above, the
command 'rmdir
/home/thomas/projets/buildroot/output/target/usr/include/freetype2/freetype/config'
has in fact the consequence of deleting the 'config' directory created
by the mkinstalldirs command.
The proposed solution to solve this problem is to remove the symbolic link
in a pre-install hook, run the installation, and restore the symbolic link.
[Peter: minor tweaks to commit message / comment]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-03 22:19:24 +02:00
|
|
|
|
|
|
|
define HOST_FREETYPE_REMOVE_FREETYPE_INCLUDE_SYMLINK
|
|
|
|
$(RM) -f $(HOST_DIR)/usr/include/freetype2/freetype
|
|
|
|
endef
|
2014-07-05 12:02:22 +02:00
|
|
|
HOST_FREETYPE_PRE_INSTALL_HOOKS += HOST_FREETYPE_REMOVE_FREETYPE_INCLUDE_SYMLINK
|
2013-12-06 11:13:28 +01:00
|
|
|
define HOST_FREETYPE_FIX_FREETYPE_INCLUDE
|
|
|
|
ln -sf . $(HOST_DIR)/usr/include/freetype2/freetype
|
|
|
|
endef
|
|
|
|
HOST_FREETYPE_POST_INSTALL_HOOKS += HOST_FREETYPE_FIX_FREETYPE_INCLUDE
|
2013-12-06 03:15:34 +01:00
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-autotools-package))
|
2014-05-05 16:08:22 +02:00
|
|
|
|
|
|
|
# freetype-patch uses autogen.sh so add it as a order-only-prerequisite
|
|
|
|
# because it is a phony target.
|
|
|
|
$(FREETYPE_TARGET_PATCH): | host-automake
|