3151e908cdddd17b2911360cc0c050e234469993
[vlc.git] / contrib / src / ass / rules.mak
1 # ASS
2 ASS_VERSION := 0.13.4
3 ASS_URL := https://github.com/libass/libass/releases/download/$(ASS_VERSION)/libass-$(ASS_VERSION).tar.gz
4
5 PKGS += ass
6 ifeq ($(call need_pkg,"libass"),)
7 PKGS_FOUND += ass
8 endif
9
10 ifdef HAVE_ANDROID
11 WITH_FONTCONFIG = 0
12 WITH_HARFBUZZ = 0
13 ifeq ($(ANDROID_ABI), x86)
14 WITH_ASS_ASM = 0
15 endif
16 else
17 ifdef HAVE_TIZEN
18 WITH_FONTCONFIG = 0
19 WITH_HARFBUZZ = 0
20 else
21 ifdef HAVE_DARWIN_OS
22 WITH_FONTCONFIG = 0
23 WITH_HARFBUZZ = 1
24 else
25 ifdef HAVE_WINSTORE
26 WITH_FONTCONFIG = 0
27 WITH_HARFBUZZ = 1
28 WITH_DWRITE = 1
29 else
30 WITH_FONTCONFIG = 1
31 WITH_HARFBUZZ = 1
32 endif
33 endif
34 endif
35 endif
36
37 $(TARBALLS)/libass-$(ASS_VERSION).tar.gz:
38         $(call download_pkg,$(ASS_URL),ass)
39
40 .sum-ass: libass-$(ASS_VERSION).tar.gz
41
42 libass: libass-$(ASS_VERSION).tar.gz .sum-ass
43         $(UNPACK)
44         $(APPLY) $(SRC)/ass/ass-macosx.patch
45 ifdef HAVE_WIN32
46         $(APPLY) $(SRC)/ass/use-topendir.patch
47 ifdef HAVE_WINSTORE
48         $(APPLY) $(SRC)/ass/dwrite.patch
49 endif
50 endif
51         $(UPDATE_AUTOCONFIG)
52         $(MOVE)
53
54 DEPS_ass = freetype2 $(DEPS_freetype2) fribidi
55
56 ifneq ($(WITH_FONTCONFIG), 0)
57 DEPS_ass += fontconfig $(DEPS_fontconfig)
58 else
59 ASS_CONF += --disable-fontconfig --disable-require-system-font-provider
60 endif
61
62 ifneq ($(WITH_DWRITE), 0)
63 ASS_CONF += --enable-directwrite
64 endif
65
66 ifneq ($(WITH_HARFBUZZ), 0)
67 DEPS_ass += harfbuzz $(DEPS_harfbuzz)
68 else
69 ASS_CONF += --disable-harfbuzz
70 endif
71
72 ifeq ($(WITH_ASS_ASM), 0)
73 ASS_CONF += --disable-asm
74 endif
75
76 ifdef WITH_OPTIMIZATION
77 ASS_CFLAGS += -O3
78 else
79 ASS_CFLAGS += -g
80 endif
81
82 .ass: libass
83         $(RECONF)
84         cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) $(ASS_CFLAGS)" ./configure $(HOSTCONF) $(ASS_CONF)
85         cd $< && $(MAKE) install
86         touch $@