Subject: qt4-libs and fontconfig
To: None <adam@NetBSD.org, pkgsrc-users@NetBSD.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: pkgsrc-users
Date: 10/12/2007 12:51:28
I installed qt4-libs-4.3.1 from a binary package. It has no direct 
dependency on fontconfig.

Another program I was building failed with:

/usr/pkg/qt4/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'

libQtGui.so needs libfontconfig.so.1 directly.

So I research fontconfig and that was added in fontconfig 2.4.2:

	    Add FcFreeTypeQueryFace external API. Bug #7311.

The qt4-libs (qt-x11-opensource-src-4.3.1)  source checks for it with:

#if FC_VERSION < 20402
...
#else
...
        pattern = FcFreeTypeQueryFace(face, file, id, blanks);
...
#endif

So I did a "make replace" in fontconfig to upgrade to get 
FcFreeTypeQueryFace.

From a pkgsrc perspective: should qt4-libs be forced to use fontconfig 
2.4.2 at least?
BUILDLINK_API_DEPENDS.fontconfig+=	fontconfig>=2.4.2

If not don't allow open-ended fontconfig dependency (which it doesn't have 
any yet).

Also okay to do the following? (But this is untested by me.)

Index: x11/qt4-libs/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt4-libs/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- x11/qt4-libs/Makefile	4 Oct 2007 20:43:52 -0000	1.13
+++ x11/qt4-libs/Makefile	12 Oct 2007 17:48:24 -0000
@@ -59,6 +59,7 @@
 SUBST_SED.socklen=	-e 's/QT_SOCKLEN_T.*/QT_SOCKLEN_T socklen_t/'
 .endif
 
+.include "../../fonts/fontconfig/buildlink3.mk"
 .include "../../graphics/freetype2/buildlink3.mk"
 .include "../../graphics/jpeg/buildlink3.mk"
 .include "../../graphics/glu/buildlink3.mk"
Index: x11/qt4-libs/buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt4-libs/buildlink3.mk,v
retrieving revision 1.10
diff -u -r1.10 buildlink3.mk
--- x11/qt4-libs/buildlink3.mk	15 Jan 2007 19:16:36 -0000	1.10
+++ x11/qt4-libs/buildlink3.mk	12 Oct 2007 17:48:24 -0000
@@ -27,6 +27,7 @@
 
 .include "../../mk/bsd.fast.prefs.mk"
 
+.include "../../fonts/fontconfig/buildlink3.mk"
 .include "../../graphics/jpeg/buildlink3.mk"
 .include "../../graphics/glu/buildlink3.mk"
 .include "../../graphics/mng/buildlink3.mk"



  Jeremy C. Reed