Subject: XFree86-4.0.x needs USE_FREETYPE2
To: None <tech-pkg@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 04/19/2001 11:12:54
I just did a "make build" of XFree86 4.0.3 in /usr/xsrc/xfree/xc.  It
turns out that the default build includes the FreeType2 2.0.1 library
and headers.  Should this be handled like XPM?  The following diff is
one possibility.

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/

--- graphics/freetype2/Makefile.orig	Sun Feb 25 21:31:15 2001
+++ graphics/freetype2/Makefile	Thu Apr 19 10:24:06 2001
@@ -21,6 +21,13 @@
 
 LTCONFIG_OVERRIDE=	${WRKSRC}/builds/unix/ltconfig
 
+.if !defined(CHECK_FREETYPE2)
+IS_BUILTIN_FREETYPE2!=	${MAKE} CHECK_FREETYPE2=YES USE_FREETYPE2=YES VARNAME=IS_BUILTIN_FREETYPE2 show-var
+.if (${IS_BUILTIN_FREETYPE2} != "0")
+IGNORE=		"The FreeType2 library is included in your X11 distribution."
+.endif
+.endif
+
 post-patch:
 	${RM} -f ${LTCONFIG_OVERRIDE} ;				\
 	${ECHO} "${RM} -f libtool; ${LN} -s ${LIBTOOL} libtool"	\
--- mk/bsd.pkg.mk.orig	Wed Apr 18 18:52:16 2001
+++ mk/bsd.pkg.mk	Thu Apr 19 10:30:09 2001
@@ -846,6 +846,25 @@
 .endif
 .endif	# USE_XPM
 
+# Check if we got FreeType2 distributed with XFree86 4.0 or newer or if we
+# need to use the package.
+.if defined(USE_FREETYPE2)
+.if !defined(IS_BUILTIN_FREETYPE2)
+.if exists(${X11BASE}/include/freetype2/freetype/freetype.h)
+IS_BUILTIN_FREETYPE2=	1
+MAKEFLAGS+=		IS_BUILTIN_FREETYPE2=${IS_BUILTIN_FREETYPE2}
+.else
+IS_BUILTIN_FREETYPE2=	0
+.endif
+.endif
+.if (${IS_BUILTIN_FREETYPE2} == "0")
+DEPENDS+=		freetype2>=2.0.1:../../graphics/freetype2
+FREETYPE2DIR_DEFAULT=	${X11PREFIX}
+.else
+FREETYPE2DIR_DEFAULT=	${X11BASE}
+.endif
+.endif	# USE_FREETYPE2
+
 # If USE_MESA is set, depend on Mesa (or Mesa-glx if USE_GLX is defined and
 # Mesa/GLX is not included in XFree86)
 .if defined(USE_MESA)