summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorjlam <jlam>2002-10-08 09:32:33 +0000
committerjlam <jlam>2002-10-08 09:32:33 +0000
commitc2cb66aca1a66b62cad41bcf8a733e90187f0ba4 (patch)
treee3a73a7bb13a21df1dc0b1cdb3d666a3b3c27eb8 /graphics
parentb9041c9b93a54b9c20cbb164a5efd13b5bf43e04 (diff)
downloadpkgsrc-c2cb66aca1a66b62cad41bcf8a733e90187f0ba4.tar.gz
Create an appropriate freetype2 package name for the built-in freetype2
distributed with XFree86 4.x. This package name is used to check against BUILDLINK_DEPENDS.freetype2 to see if we need to install the pkgsrc freetype2 or if the built-in one is sufficient.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/freetype2/buildlink2.mk40
1 files changed, 34 insertions, 6 deletions
diff --git a/graphics/freetype2/buildlink2.mk b/graphics/freetype2/buildlink2.mk
index 36dd4292ffd..1a47b17b38b 100644
--- a/graphics/freetype2/buildlink2.mk
+++ b/graphics/freetype2/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.4 2002/09/26 20:24:08 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.5 2002/10/08 09:32:33 jlam Exp $
.if !defined(FREETYPE2_BUILDLINK2_MK)
FREETYPE2_BUILDLINK2_MK= # defined
@@ -12,15 +12,43 @@ BUILDLINK_PKGSRCDIR.freetype2?= ../../graphics/freetype2
# depend on the freetype2 package.
#
_REQUIRE_BUILTIN_FREETYPE2?= NO
-.if exists(${X11BASE}/include/freetype2/freetype/freetype.h)
-_IS_BUILTIN_FREETYPE2!= ${EGREP} -c BuildFreetype2Library ${X11BASE}/lib/X11/config/X11.tmpl || ${TRUE}
+
+_FREETYPE_H= ${X11BASE}/include/freetype2/freetype/freetype.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+.if exists(${_FREETYPE_H}) && exists(${_X11_TMPL})
+_IS_BUILTIN_FREETYPE2!= ${GREP} -c BuildFreetype2Library ${_X11_TMPL} || ${TRUE}
.else
_IS_BUILTIN_FREETYPE2= 0
.endif
-.if (${_IS_BUILTIN_FREETYPE2} == "0") && (${_REQUIRE_BUILTIN_FREETYPE2} == "NO")
-_NEED_FREETYPE2= YES
-.else
+
+.if !empty(_REQUIRE_BUILTIN_FREETYPE2:M[yY][eE][sS])
_NEED_FREETYPE2= NO
+.else
+. if ${_IS_BUILTIN_FREETYPE2} == "0"
+_NEED_FREETYPE2= YES
+. else
+#
+# Create an appropriate freetype2 package name for the built-in freetype2
+# distributed with XFree86 4.x. This package name can be used to check
+# against BUILDLINK_DEPENDS.freetype2 to see if we need to install the
+# pkgsrc freetype2 or if the built-in one is sufficient.
+#
+_FREETYPE_MAJOR!= \
+ ${AWK} '/.*\#define.*FREETYPE_MAJOR/ { print $$3 }' ${_FREETYPE_H}
+_FREETYPE_MINOR!= \
+ ${AWK} '/.*\#define.*FREETYPE_MINOR/ { print "."$$3 }' ${_FREETYPE_H}
+_FREETYPE_PATCH!= \
+ ${AWK} '/.*\#define.*FREETYPE_PATCH/ { print "."$$3 }' ${_FREETYPE_H}
+_FREETYPE_VERSION= ${_FREETYPE_MAJOR}${_FREETYPE_MINOR}${_FREETYPE_PATCH}
+_FREETYPE_PKG= freetype2-${_FREETYPE_VERSION}
+_FREETYPE_DEPENDS= ${BUILDLINK_DEPENDS.freetype2}
+_NEED_FREETYPE2!= \
+ if ${PKG_ADMIN} pmatch '${_FREETYPE_DEPENDS}' ${_FREETYPE_PKG}; then \
+ ${ECHO} "NO"; \
+ else \
+ ${ECHO} "YES"; \
+ fi
+. endif
.endif
.if ${_NEED_FREETYPE2} == "YES"