summaryrefslogtreecommitdiff
path: root/mk/fonts.mk
blob: 3fab68bf1f76c746f54a81681f8a514f1d3062e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# $NetBSD: fonts.mk,v 1.7 2005/12/05 22:07:07 rillig Exp $
#
# This Makefile fragment is intended to be included by packages that install
# fonts (most of them in the fonts category).  It takes care of updating the
# fonts.dir files at install/deinstall time.
#
# The following variables need to be defined by packages using fonts.mk:
#
# FONTS_<TYPE>_DIRS - Whitespaced list of directories where the font database
#                     is updated. If empty, nothing is done for this TYPE.
#
# Supported TYPEs: TTF, TYPE1, X11.
#

.if !defined(FONTS_MK)
FONTS_MK=		# defined

# TrueType fonts
FONTS_TTF_DIRS?=
# Type1 fonts
FONTS_TYPE1_DIRS?=
# Generic X fonts (PCF, SNF, BDF)
FONTS_X11_DIRS?=

.if !empty(FONTS_TTF_DIRS) || !empty(FONTS_TYPE1_DIRS) || !empty(FONTS_X11_DIRS)

USE_PKGINSTALL=		YES
HEADER_EXTRA_TMPL+=	${.CURDIR}/../../mk/install/fonts

.if !empty(FONTS_TTF_DIRS)
EVAL_PREFIX+=			TTMKFDIR_PREFIX=ttmkfdir
TTMKFDIR_PREFIX_DEFAULT=	${LOCALBASE}
FILES_SUBST+=		FONTS_TTF="YES"
FILES_SUBST+=		FONTS_TTF_DIRS=${FONTS_TTF_DIRS:Q}
FILES_SUBST+=		TTMKFDIR="${TTMKFDIR_PREFIX}/bin/ttmkfdir"
DEPENDS+=		ttmkfdir2>=20021109:../../fonts/ttmkfdir2
# also need to run mkfontdir there
FONTS_X11_DIRS+=	${FONTS_TTF_DIRS}
.endif

.if !empty(FONTS_TYPE1_DIRS)
EVAL_PREFIX+=			TYPE1INST_PREFIX=type1inst
TYPE1INST_PREFIX_DEFAULT=	${LOCALBASE}
FILES_SUBST+=		FONTS_TYPE1="YES"
FILES_SUBST+=		FONTS_TYPE1_DIRS=${FONTS_TYPE1_DIRS:Q}
FILES_SUBST+=		TYPE1INST="${TYPE1INST_PREFIX}/bin/type1inst"
DEPENDS+=		type1inst>=0.6.1:../../fonts/type1inst
# also need to run mkfontdir there
FONTS_X11_DIRS+=	${FONTS_TYPE1_DIRS}
.endif

.if !empty(FONTS_X11_DIRS)
FILES_SUBST+=		FONTS_X11="YES"
FILES_SUBST+=		FONTS_X11_DIRS=${FONTS_X11_DIRS:Q}
FILES_SUBST+=		MKFONTDIR="${X11BASE}/bin/mkfontdir"
.endif

.endif

.endif	# FONTS_MK