Subject: pkg/22927: fontconfig's fc-cache has missing directories
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 09/24/2003 00:51:05
>Number:         22927
>Category:       pkg
>Synopsis:       fontconfig's fc-cache has missing directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 24 07:52:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6.1_STABLE
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
System: NetBSD rainier.reedmedia.net 1.6.1_STABLE NetBSD 1.6.1_STABLE (GENERIC) #0: Tue Aug 12 02:52:57 PDT 2003 reed@rainier.reedmedia.net:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
I have fontconfig-2.2.1nb1 (and freetype2-2.1.5).

My fc-cache does:

$ fc-cache -v
fc-cache: "/usr/lib/X11/fonts": skipping, no such directory
fc-cache: "/root/.fonts": skipping, no such directory
fc-cache: succeeded

Notice it doesn't check my /usr/X11R6/lib/X11/fonts/ directories.

My /etc/fonts/fonts.conf has:

        <dir>/usr/lib/X11/fonts</dir>

        <dir>~/.fonts</dir>

It says "DO NOT EDIT THIS FILE."

I was guessing this is because of:
CONFIGURE_ARGS+=        --with-default-fonts=${LOCALBASE}/lib/X11/fonts
but configure says "Use fonts from DIR when config is busted".
>How-To-Repeat:
	
>Fix:
I see that the configure script tests each directory at build time. This
will cause different packages to be built with identical version number
but different behaviour :(   

The configure script only does that if --with-add-fonts is not given. So
please consider adding it.

It would also look at
/usr/X11R6/lib/X11 /usr/X11/lib/X11 /usr/lib/X11 and subdirectories
containing .pf*, .tt* and .ot* files. But I think /usr/X11R6/lib/X11
directories is fine.

The following patch doesn't increase PKG_REVISION. Most likely in
most cases it will be the same.

diff -b -u -r1.16 Makefile
--- fonts/fontconfig/Makefile	2003/09/22 21:55:56	1.16
+++ fonts/fontconfig/Makefile	2003/09/24 07:42:47
@@ -32,6 +32,7 @@
 CONFIGURE_ARGS+=	--with-expat-lib=${BUILDLINK_PREFIX.expat}/lib
 CONFIGURE_ARGS+=	--with-confdir=${PKG_SYSCONFDIR}
 CONFIGURE_ARGS+=	--with-x
+CONFIGURE_ARGS+=	--with-add-fonts=${LOCALBASE}/lib/X11/fonts,/usr/X11R6/lib/X11/fonts/TTF,/usr/X11R6/lib/X11/fonts/TrueType,/usr/X11R6/lib/X11/fonts/Type1,/usr/X11R6/lib/X11/fonts/freefont
 
 EGDIR=		${PREFIX}/share/examples/fontconfig
 CONF_FILES=	${EGDIR}/fonts.conf ${PKG_SYSCONFDIR}/fonts.conf
>Release-Note:
>Audit-Trail:
>Unformatted: