Subject: pkg/22749: fontconfig's fc-cache looks in /etc/fonts instead of ${PREFIX}/etc/fontconfig
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jschauma@netmeister.org>
List: netbsd-bugs
Date: 09/11/2003 13:20:00
>Number:         22749
>Category:       pkg
>Synopsis:       fontconfig's fc-cache looks in /etc/fonts instead of ${PREFIX}/etc/fontconfig
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 11 17:21:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jan Schaumann
>Release:        NetBSD 1.6W
>Organization:
	
>Environment:
	
	
System: NetBSD dogfish-head.cs.stevens-tech.edu 1.6W NetBSD 1.6W (BOCK) #1: Fri Sep 5 09:50:25 EDT 2003 jschauma@dogfish-head.cs.stevens-tech.edu:/sys/arch/i386/compile/BOCK i386
Architecture: i386
Machine: i386
>Description:
	On a regular NetBSD-current system using XFree86 4.3.0, building
	fonts/fontconfig creates binaries that are linked against /usr/X11R6
	libraries, and as a result, fc-cache tries to look in /etc/fonts instead
	of /usr/pkg/etc/fontconfig (or whatever PKG_SYSCONFDIR you have).

	amstel# pkg_info -e freetype2
	freetype2-2.1.4
	amstel# pkg_info -e expat
	expat-1.95.6nb1
	amstel# pkg_info -e fontconfig
	fontconfig-2.2.1

	amstel# ldd /usr/pkg/bin/fc-cache
	/usr/pkg/bin/fc-cache:
		-lfreetype.9 => /usr/X11R6/lib/libfreetype.so.9
		-lexpat.1 => /usr/X11R6/lib/libexpat.so.1
		-lfontconfig.1 => /usr/X11R6/lib/libfontconfig.so.1
		-lz.0 => /usr/lib/libz.so.0
		-lexpat.4 => /usr/pkg/lib/libexpat.so.4
		-lc.12 => /usr/lib/libc.so.12

	amstel# ktrace /usr/pkg/bin/fc-cache
	Fontconfig error: Cannot load default config file

	 22729 fc-cache CALL  access(0x804b080,0x4)  
	 22729 fc-cache NAMI  "/etc/fonts/fonts.conf" 
	 22729 fc-cache RET   access -1 errno 2 No such file or directory
	 22729 fc-cache CALL  write(0x2,0xbfbff0ec,0x12)
	 22729 fc-cache GIO   fd 2 wrote 18 bytes
		"Fontconfig error: "
	 22729 fc-cache RET   write 18/0x12
	 22729 fc-cache CALL  write(0x2,0xbfbff11c,0x1f)
	 22729 fc-cache GIO   fd 2 wrote 31 bytes
		"Cannot load default config file"
	 22729 fc-cache RET   write 31/0x1f

>How-To-Repeat:
	install freetype2
	install fontconfig
	run /usr/pkg/bin/fc-cache
>Fix:
	No idea.  I don't even know why it's linking against X11's libraries,
	when the pkg-libraries are installed.

	Workaround (undesirable, but fixes the immediate problem, for those
	who also see this): ln -s /usr/pkg/etc/fontconfig /etc/fonts

	Blah.
>Release-Note:
>Audit-Trail:
>Unformatted: