pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/fonts/dejavu-ttf Registering the fonts via FONTS_DIRS....



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f99a92caa312
branches:  trunk
changeset: 456247:f99a92caa312
user:      hauke <hauke%pkgsrc.org@localhost>
date:      Fri Jul 23 10:20:30 2021 +0000

description:
Registering the fonts via FONTS_DIRS.ttf incurs a dependency on
mkfontdir, which means X11.

Since there are legitimate uses for fonts on sans-X machines
(rrdtool), control the dependency with a (default) x11 option.

diffstat:

 fonts/dejavu-ttf/Makefile |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r b8c2673eaec9 -r f99a92caa312 fonts/dejavu-ttf/Makefile
--- a/fonts/dejavu-ttf/Makefile Fri Jul 23 09:39:34 2021 +0000
+++ b/fonts/dejavu-ttf/Makefile Fri Jul 23 10:20:30 2021 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.24 2017/08/01 17:40:11 wiz Exp $
+# $NetBSD: Makefile,v 1.25 2021/07/23 10:20:30 hauke Exp $
 
 DISTNAME=      dejavu-fonts-ttf-2.37
+PKGREVISION=   1
 PKGNAME=       ${DISTNAME:S/fonts-//}
 CATEGORIES=    fonts
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=dejavu/}
@@ -14,13 +15,23 @@
 NO_CONFIGURE=  yes
 NO_BUILD=      yes
 
-FONTS_DIRS.ttf=        ${PREFIX}/share/fonts/X11/TTF
-
 EGDIR=         ${PREFIX}/share/examples/${PKGBASE}
+TTFDIR=                ${PREFIX}/share/fonts/X11/TTF
 FCEGDIR=       ${EGDIR}/fontconfig-conf.d
 FCCFDIR=       ${PKG_SYSCONFDIR}/fontconfig/conf.d
 DOCSDIR=       ${PREFIX}/share/doc/${PKGBASE}
 
+PKG_OPTIONS_VAR=       PKG_OPTIONS.dejavu-fonts-ttf
+PKG_SUPPORTED_OPTIONS+=        x11
+PKG_SUGGESTED_OPTIONS+=        x11
+
+.include "../../mk/bsd.options.mk"
+
+# Only attempt to register fonts if we have X11 support (mkfontdir)
+.if !empty(PKG_OPTIONS:Mx11)
+FONTS_DIRS.ttf=        ${TTFDIR}
+.endif
+
 MAKE_DIRS+=    ${FCCFDIR}
 
 CONF_FILES=    ${FCEGDIR}/20-unhint-small-dejavu-sans-mono.conf \
@@ -43,7 +54,7 @@
 INSTALLATION_DIRS=     share/fonts/X11/TTF ${DOCSDIR} ${FCEGDIR}
 
 do-install:
-       ${INSTALL_DATA} ${WRKSRC}/ttf/*.ttf ${DESTDIR}${FONTS_DIRS.ttf}
+       ${INSTALL_DATA} ${WRKSRC}/ttf/*.ttf ${DESTDIR}${TTFDIR}
        ${INSTALL_DATA} ${WRKSRC}/fontconfig/*.conf ${DESTDIR}${FCEGDIR}
 .for docfile in AUTHORS BUGS LICENSE NEWS README.md
        ${INSTALL_DATA} ${WRKSRC}/${docfile} ${DESTDIR}${DOCSDIR}



Home | Main Index | Thread Index | Old Index