Contribs: update fontconfig to 2.12.3
[vlc.git] / contrib / src / fontconfig / rules.mak
1 # fontconfig
2
3 FONTCONFIG_VERSION := 2.12.3
4 FONTCONFIG_URL := https://www.freedesktop.org/software/fontconfig/release/fontconfig-$(FONTCONFIG_VERSION).tar.gz
5
6 PKGS += fontconfig
7 ifeq ($(call need_pkg,"fontconfig >= 2.11"),)
8 PKGS_FOUND += fontconfig
9 endif
10
11 $(TARBALLS)/fontconfig-$(FONTCONFIG_VERSION).tar.gz:
12         $(call download_pkg,$(FONTCONFIG_URL),fontconfig)
13
14 .sum-fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz
15
16 fontconfig: fontconfig-$(FONTCONFIG_VERSION).tar.gz .sum-fontconfig
17         $(UNPACK)
18 ifdef HAVE_WIN32
19         $(APPLY) $(SRC)/fontconfig/fontconfig-win32.patch
20         $(APPLY) $(SRC)/fontconfig/fontconfig-noxml2.patch
21 endif
22         $(call pkg_static, "fontconfig.pc.in")
23         $(MOVE)
24
25 FONTCONFIG_CONF := $(HOSTCONF) \
26         --enable-libxml2 \
27         --disable-docs
28 FONTCONFIG_ENV := $(HOSTVARS)
29
30 # FreeType flags
31 ifneq ($(findstring freetype2,$(PKGS)),)
32 FONTCONFIG_CONF += --with-freetype-config="$(PREFIX)/bin/freetype-config"
33 endif
34
35 ifdef HAVE_CROSS_COMPILE
36 FONTCONFIG_CONF += --with-arch=$(ARCH)
37 endif
38
39 ifdef HAVE_MACOSX
40 FONTCONFIG_CONF += \
41         --with-cache-dir=~/Library/Caches/fontconfig \
42         --with-confdir=/usr/X11/lib/X11/fonts \
43         --with-default-fonts=/System/Library/Fonts \
44         --with-add-fonts=/Library/Fonts,~/Library/Fonts
45 # libxml2 without pkg-config...
46 FONTCONFIG_ENV += LIBXML2_CFLAGS=`xml2-config --cflags`
47 FONTCONFIG_ENV += LIBXML2_LIBS=`xml2-config --libs`
48 endif
49
50 DEPS_fontconfig = freetype2 $(DEPS_freetype2) libxml2 $(DEPS_libxml2)
51
52 .fontconfig: fontconfig
53 ifdef HAVE_WIN32
54         $(RECONF)
55 endif
56         cd $< && $(FONTCONFIG_ENV) ./configure $(FONTCONFIG_CONF)
57         cd $< && $(MAKE)
58 ifndef HAVE_MACOSX
59         cd $< && $(MAKE) install
60 else
61         cd $< && $(MAKE) install-exec
62         cd $</fontconfig && $(MAKE) install-data
63         sed -e 's%/usr/lib/libiconv.la%%' -i.orig $(PREFIX)/lib/libfontconfig.la
64         cp $</fontconfig.pc $(PREFIX)/lib/pkgconfig/
65 endif
66         touch $@