summaryrefslogtreecommitdiff
path: root/x11/xorg-libs
diff options
context:
space:
mode:
Diffstat (limited to 'x11/xorg-libs')
-rw-r--r--x11/xorg-libs/builtin.mk81
-rw-r--r--x11/xorg-libs/version.mk44
2 files changed, 125 insertions, 0 deletions
diff --git a/x11/xorg-libs/builtin.mk b/x11/xorg-libs/builtin.mk
new file mode 100644
index 00000000000..f600b89da58
--- /dev/null
+++ b/x11/xorg-libs/builtin.mk
@@ -0,0 +1,81 @@
+# $NetBSD: builtin.mk,v 1.1 2005/06/01 18:03:33 jlam Exp $
+
+BUILTIN_PKG:= xorg-libs
+
+BUILTIN_FIND_FILES_VAR:= CF_XORG
+BUILTIN_FIND_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+###
+### Determine if there is a built-in implementation of the package and
+### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
+###
+.if !defined(IS_BUILTIN.xorg-libs)
+IS_BUILTIN.xorg-libs= no
+. if exists(${CF_XORG})
+IS_BUILTIN.xorg-libs= yes
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.xorg-libs
+
+###
+### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
+### a package name to represent the built-in package.
+###
+.if !defined(BUILTIN_PKG.xorg-libs) && \
+ !empty(IS_BUILTIN.xorg-libs:M[yY][eE][sS]) && \
+ exists(${CF_XORG})
+. include "${BUILDLINK_PKGSRCDIR.xorg-libs}/version.mk"
+BUILTIN_PKG.xorg-libs= xorg-libs-${BUILTIN_X11_VERSION.xorg}
+.endif
+MAKEVARS+= BUILTIN_PKG.xorg-libs
+
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.xorg-libs)
+. if ${PREFER.xorg-libs} == "pkgsrc"
+USE_BUILTIN.xorg-libs= no
+. else
+USE_BUILTIN.xorg-libs= ${IS_BUILTIN.xorg-libs}
+. if defined(BUILTIN_PKG.xorg-libs) && \
+ !empty(IS_BUILTIN.xorg-libs:M[yY][eE][sS])
+USE_BUILTIN.xorg-libs= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.xorg-libs}
+. if !empty(USE_BUILTIN.xorg-libs:M[yY][eE][sS])
+USE_BUILTIN.xorg-libs!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.xorg-libs:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.xorg-libs
+.endif
+MAKEVARS+= USE_BUILTIN.xorg-libs
+
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
+CHECK_BUILTIN.xorg-libs?= no
+.if !empty(CHECK_BUILTIN.xorg-libs:M[nN][oO])
+
+. if !empty(USE_BUILTIN.xorg-libs:M[yY][eE][sS])
+BUILDLINK_PREFIX.xorg-libs= ${X11BASE}
+BUILDLINK_FILES.xorg-libs+= lib/pkgconfig/xorg-libs.pc
+. endif
+
+# XXX
+# XXX xorg-libs provides some X11 pieces that pkgsrc should currently
+# XXX treat as "built-in" so that extra dependencies on the pkgsrc
+# XXX versions aren't pulled in.
+# XXX
+USE_BUILTIN.Xfixes= yes
+USE_BUILTIN.Xcomposite= yes
+
+.endif # CHECK_BUILTIN.xorg-libs
diff --git a/x11/xorg-libs/version.mk b/x11/xorg-libs/version.mk
new file mode 100644
index 00000000000..0ee5141cb8f
--- /dev/null
+++ b/x11/xorg-libs/version.mk
@@ -0,0 +1,44 @@
+# $NetBSD: version.mk,v 1.1 2005/06/01 18:03:33 jlam Exp $
+#
+# This Makefile fragment is included by Makefiles that need to access
+# the X11_TYPE and version number of an X.org distribution.
+#
+# The following variables are provided by this file:
+#
+# BUILTIN_X11_TYPE.xorg is the X11_TYPE of the X.org distribution
+# and is simply "xorg".
+#
+# BUILTIN_X11_VERSION.xorg is the version number of the X.org
+# distribution detected on the system.
+#
+
+BUILTIN_X11_TYPE.xorg= xorg
+
+BUILTIN_FILES_VAR:= CF_XORGVERSION CF_XORG
+BUILTIN_FILES.CF_XORGVERSION= ${X11BASE}/lib/X11/config/xorgversion.def
+BUILTIN_FILES.CF_XORG= ${X11BASE}/lib/X11/config/xorg.cf
+.include "../../mk/buildlink3/find-files.mk"
+
+.if !defined(BUILTIN_XORG_VERSION_FILE)
+BUILTIN_XORG_VERSION_FILE= __nonexistent__
+. if exists(${BUILTIN_X11_CONFIG_XORGVERSION_DEF})
+BUILTIN_XORG_VERSION_FILE= ${BUILTIN_X11_CONFIG_XORGVERSION_DEF}
+. elif exists(${BUILTIN_X11_CONFIG_XORG_CF})
+BUILTIN_XORG_VERSION_FILE= ${BUILTIN_X11_CONFIG_XORG_CF}
+. endif
+.endif
+MAKEVARS+= BUILTIN_XORG_VERSION_FILE
+
+.if !defined(BUILTIN_X11_VERSION.xorg) && \
+ exists(${BUILTIN_XORG_VERSION_FILE})
+BUILTIN_X11_VERSION.xorg!= \
+ ${AWK} '/\#define[ ]*XORG_VERSION_MAJOR/ { M = $$3 } \
+ /\#define[ ]*XORG_VERSION_MINOR/ { m = "."$$3 } \
+ /\#define[ ]*XORG_VERSION_PATCH/ { p = "."$$3 } \
+ /\#define[ ]*XORG_VERSION_SNAP/ { s = "."$$3 } \
+ END { if (s == ".0") s = ""; \
+ if (p == ".0" && s == "") p = ""; \
+ printf "%s%s%s%s\n", M, m, p, s }' \
+ ${BUILTIN_XORG_VERSION_FILE}
+.endif
+MAKEVARS+= BUILTIN_X11_VERSION.xorg