summaryrefslogtreecommitdiff
path: root/mk/fonts.mk
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2003-02-16 12:14:31 +0000
committerjmmv <jmmv@pkgsrc.org>2003-02-16 12:14:31 +0000
commit62f4d1bb453c4f0aacb2c40241abf7b7ea808dcc (patch)
tree2baada11241b1c1347c695bbb97faee7c44eee2c /mk/fonts.mk
parent159be95476688f0a9af35413c098600129198410 (diff)
downloadpkgsrc-62f4d1bb453c4f0aacb2c40241abf7b7ea808dcc.tar.gz
Implement a simple framework to handle font databases. It regenerates the
fonts.dir, fonts.scale and Fontmap files (depending on the font type) in the right directories at (de)install time. Support included for TrueType, Type1 and standard X11 fonts. Reviewed by jlam.
Diffstat (limited to 'mk/fonts.mk')
-rw-r--r--mk/fonts.mk53
1 files changed, 53 insertions, 0 deletions
diff --git a/mk/fonts.mk b/mk/fonts.mk
new file mode 100644
index 00000000000..a74d6d6411d
--- /dev/null
+++ b/mk/fonts.mk
@@ -0,0 +1,53 @@
+# $NetBSD: fonts.mk,v 1.1 2003/02/16 12:14:31 jmmv 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
+INSTALL_EXTRA_TMPL+= ../../mk/install/fonts
+DEINSTALL_EXTRA_TMPL+= ../../mk/install/fonts
+
+.if !empty(FONTS_TTF_DIRS)
+FILES_SUBST+= FONTS_TTF="YES"
+FILES_SUBST+= FONTS_TTF_DIRS="${FONTS_TTF_DIRS}"
+FILES_SUBST+= TTMKFDIR="${LOCALBASE}/bin/ttmkfdir"
+DEPENDS+= ttmkfdir>=0:../../fonts/ttmkfdir
+.endif
+
+.if !empty(FONTS_TYPE1_DIRS)
+FILES_SUBST+= FONTS_TYPE1="YES"
+FILES_SUBST+= FONTS_TYPE1_DIRS="${FONTS_TYPE1_DIRS}"
+FILES_SUBST+= TYPE1INST="${LOCALBASE}/bin/type1inst"
+DEPENDS+= type1inst>=0.6.1:../../fonts/type1inst
+.endif
+
+.if !empty(FONTS_X11_DIRS)
+FILES_SUBST+= FONTS_X11="YES"
+FILES_SUBST+= FONTS_X11_DIRS="${FONTS_X11_DIRS}"
+FILES_SUBST+= MKFONTDIR="${X11BASE}/bin/mkfontdir"
+.endif
+
+.endif
+
+.endif # FONTS_MK