summaryrefslogtreecommitdiff
path: root/fonts/fontconfig/builtin.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-03-10 17:57:14 +0000
committerjlam <jlam>2004-03-10 17:57:14 +0000
commita4a404710484a43484fac5e3044019381d4494a9 (patch)
tree1226d07b8f66083168895189decc88848b70903f /fonts/fontconfig/builtin.mk
parentfde46d1aaca113dcdf8fc5effa3c04ddd5cd37a5 (diff)
downloadpkgsrc-a4a404710484a43484fac5e3044019381d4494a9.tar.gz
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal checking for built-in software is much simpler to deal with in pkgsrc. The buildlink3.mk file for a package will be of the usual format regardless of the package, which makes it simpler for packagers to update a package. The builtin.mk file for a package must define a single yes/no variable USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'fonts/fontconfig/builtin.mk')
-rw-r--r--fonts/fontconfig/builtin.mk75
1 files changed, 75 insertions, 0 deletions
diff --git a/fonts/fontconfig/builtin.mk b/fonts/fontconfig/builtin.mk
new file mode 100644
index 00000000000..3a832e349bd
--- /dev/null
+++ b/fonts/fontconfig/builtin.mk
@@ -0,0 +1,75 @@
+# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $
+
+_FONTCONFIG_FONTCONFIG_H= ${X11BASE}/include/fontconfig/fontconfig.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+
+.if !defined(IS_BUILTIN.fontconfig)
+IS_BUILTIN.fontconfig= no
+. if exists(${_FONTCONFIG_FONTCONFIG_H}) && exists(${_X11_TMPL})
+IS_BUILTIN.fontconfig!= \
+ if ${GREP} -q BuildFontconfigLibrary ${_X11_TMPL}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. if !empty(IS_BUILTIN.fontconfig:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in fontconfig distributed
+# with the system. This package name can be used to check against
+# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
+# or if the built-in one is sufficient.
+#
+_FONTCONFIG_MAJOR!= \
+ ${AWK} '/\#define[ ]*FC_MAJOR/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_MINOR!= \
+ ${AWK} '/\#define[ ]*FC_MINOR/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_REVISION!= \
+ ${AWK} '/\#define[ ]*FC_REVISION/ { print $$3 }' \
+ ${_FONTCONFIG_FONTCONFIG_H}
+_FONTCONFIG_VERSION= \
+ ${_FONTCONFIG_MAJOR}.${_FONTCONFIG_MINOR}.${_FONTCONFIG_REVISION}
+BUILTIN_PKG.fontconfig= fontconfig-${_FONTCONFIG_VERSION}
+MAKEFLAGS+= BUILTIN_PKG.fontconfig=${BUILTIN_PKG.fontconfig}
+. endif
+. endif
+MAKEFLAGS+= IS_BUILTIN.fontconfig=${IS_BUILTIN.fontconfig}
+.endif
+
+CHECK_BUILTIN.fontconfig?= no
+.if !empty(CHECK_BUILTIN.fontconfig:M[yY][eE][sS])
+USE_BUILTIN.fontconfig= yes
+.endif
+
+.if !defined(USE_BUILTIN.fontconfig)
+USE_BUILTIN.fontconfig?= ${IS_BUILTIN.fontconfig}
+
+. if defined(BUILTIN_PKG.fontconfig)
+USE_BUILTIN.fontconfig= yes
+. for _depend_ in ${BUILDLINK_DEPENDS.fontconfig}
+. if !empty(USE_BUILTIN.fontconfig:M[yY][eE][sS])
+USE_BUILTIN.fontconfig!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.fontconfig}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+. endif
+. endfor
+. endif
+.endif # USE_BUILTIN.fontconfig
+
+.if !empty(USE_BUILTIN.fontconfig:M[nN][oO])
+BUILDLINK_DEPENDS.fontconfig+= fontconfig>=2.1nb2
+BUILDLINK_DEPENDS.freetype2+= freetype2>=2.1.3
+.endif
+
+.if !empty(USE_BUILTIN.fontconfig:M[yY][eE][sS])
+BUILDLINK_PREFIX.fontconfig= ${X11BASE}
+BUILDLINK_FILES.fontconfig+= lib/pkgconfig/fontconfig.pc
+
+USE_BUILTIN.expat= yes
+USE_BUILTIN.freetype2= yes
+USE_BUILTIN.zlib= yes
+.endif