pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/x11/render Add checks to see whether the XFree86-provi...
details: https://anonhg.NetBSD.org/pkgsrc/rev/696e4b7708b7
branches: trunk
changeset: 468722:696e4b7708b7
user: jlam <jlam%pkgsrc.org@localhost>
date: Mon Feb 16 12:39:00 2004 +0000
description:
Add checks to see whether the XFree86-provided render headers satisfy the
dependency requirements.
diffstat:
x11/render/buildlink2.mk | 92 +++++++++++++++++++++++++++++++++++++++++------
x11/render/buildlink3.mk | 89 ++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 161 insertions(+), 20 deletions(-)
diffs (209 lines):
diff -r c7c7c881a9c7 -r 696e4b7708b7 x11/render/buildlink2.mk
--- a/x11/render/buildlink2.mk Mon Feb 16 12:37:58 2004 +0000
+++ b/x11/render/buildlink2.mk Mon Feb 16 12:39:00 2004 +0000
@@ -1,24 +1,90 @@
-# $NetBSD: buildlink2.mk,v 1.1.1.1 2003/09/19 16:33:57 wiz Exp $
-#
-# This Makefile fragment is included by packages that use render.
-#
+# $NetBSD: buildlink2.mk,v 1.2 2004/02/16 12:39:00 jlam Exp $
.if !defined(RENDER_BUILDLINK2_MK)
RENDER_BUILDLINK2_MK= # defined
+.include "../../mk/bsd.prefs.mk"
+
+BUILDLINK_DEPENDS.render?= render>=0.2
+BUILDLINK_PKGSRCDIR.render?= ../../x11/render
+BUILDLINK_DEPMETHOD.render?= build
+
+# Check if we got render distributed with XFree86 4.x or if we need to
+# depend on the render package.
+#
+_REQUIRE_BUILTIN_RENDER?= NO
+
+_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
+
+.if !defined(_BUILTIN_RENDER)
+_BUILTIN_RENDER= NO
+. if exists(${_RENDER_H})
+# Create an appropriate render package name for the built-in render
+# distributed with XFree86 4.x. This package name can be used to check
+# against BUILDLINK_DEPENDS.render to see if we need to install the
+# pkgsrc render or if the built-in one is sufficient.
+#
+_RENDER_MAJOR!= \
+ ${AWK} '/.*\#define.*RENDER_MAJOR/ { print $$3 }' ${_RENDER_H}
+_RENDER_MINOR!= \
+ ${AWK} '/.*\#define.*RENDER_MINOR/ { print "."$$3 }' ${_RENDER_H}
+_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
+_RENDER_PKG= render-${_RENDER_VERSION}
+_RENDER_DEPENDS= ${BUILDLINK_DEPENDS.render}
+_BUILTIN_RENDER!= \
+ if ${PKG_ADMIN} pmatch '${_RENDER_DEPENDS}' ${_RENDER_PKG}; then \
+ if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi; \
+ else \
+ ${ECHO} "NO"; \
+ fi
+. endif
+MAKEFLAGS+= _BUILTIN_RENDER=${_BUILTIN_RENDER}
+.endif
+
+.if !empty(_BUILTIN_RENDER:M[yY][eE][sS])
+_NEED_RENDER= NO
+.else
+_NEED_RENDER= YES
+.endif
+
+.if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
+ ${_BUILTIN_RENDER} == "YES"
+_NEED_RENDER= NO
+.endif
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS])
+_NEED_RENDER= YES
+.endif
+.if !empty(PREFER_NATIVE:Mrender) && \
+ ${_BUILTIN_RENDER} == "YES"
+_NEED_RENDER= NO
+.endif
+.if !empty(PREFER_PKGSRC:Mrender)
+_NEED_RENDER= YES
+.endif
+
+.if !empty(_REQUIRE_BUILTIN_RENDER:M[yY][eE][sS])
+_NEED_RENDER= NO
+.endif
+
+.if ${_NEED_RENDER} == "YES"
BUILDLINK_PACKAGES+= render
-BUILDLINK_DEPENDS.render?= render>=0.8
-BUILDLINK_PKGSRCDIR.render?= ../../x11/render
-# header files only
-BUILDLINK_DEPMETHOD.render= build
-
EVAL_PREFIX+= BUILDLINK_PREFIX.render=render
-BUILDLINK_PREFIX.render_DEFAULT= ${LOCALBASE}
-BUILDLINK_FILES.render+= include/X11/extensions/render.h
+BUILDLINK_PREFIX.render_DEFAULT= ${X11PREFIX}
+BUILDLINK_DEPENDS.render= render>=0.8
+.else
+BUILDLINK_PREFIX.render= ${X11BASE}
+.endif
+
+BUILDLINK_FILES.render= include/X11/extensions/render.h
BUILDLINK_FILES.render+= include/X11/extensions/renderproto.h
-BUILDLINK_FILES.render+= lib/pkgconfig/render.pc
-BUILDLINK_TARGETS+= render-buildlink
+USE_X11= yes
+
+BUILDLINK_TARGETS+= render-buildlink
render-buildlink: _BUILDLINK_USE
diff -r c7c7c881a9c7 -r 696e4b7708b7 x11/render/buildlink3.mk
--- a/x11/render/buildlink3.mk Mon Feb 16 12:37:58 2004 +0000
+++ b/x11/render/buildlink3.mk Mon Feb 16 12:39:00 2004 +0000
@@ -1,16 +1,91 @@
-# $NetBSD: buildlink3.mk,v 1.2 2004/02/09 23:56:33 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2004/02/16 12:39:00 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
RENDER_BUILDLINK3_MK:= ${RENDER_BUILDLINK3_MK}+
-.if !empty(BUILDLINK_DEPTH:M+)
-BUILDLINK_DEPENDS+= render
-.endif
+.include "../../mk/bsd.prefs.mk"
.if !empty(RENDER_BUILDLINK3_MK:M+)
BUILDLINK_PACKAGES+= render
-BUILDLINK_DEPENDS.render+= render>=0.8
+BUILDLINK_DEPENDS.render+= render>=0.2
BUILDLINK_PKGSRCDIR.render?= ../../x11/render
-.endif # RENDER_BUILDLINK3_MK
+BUILDLINK_DEPMETHOD.render?= build
+.endif # RENDER_BUILDLINK3_MK
+
+BUILDLINK_CHECK_BUILTIN.render?= NO
+
+_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h
+
+.if !defined(BUILDLINK_IS_BUILTIN.render)
+BUILDLINK_IS_BUILTIN.render= NO
+. if exists(${_X11_EXTENSIONS_RENDER_H})
+BUILDLINK_IS_BUILTIN.render= YES
+. if !empty(BUILDLINK_CHECK_BUILTIN.render:M[nN][oO])
+#
+# Create an appropriate package name for the built-in render 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.
+#
+_RENDER_MAJOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MAJOR/ { print $$3 }' ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_MINOR!= \
+ ${AWK} '/\#define[ ]*RENDER_MINOR/ { print "."$$3 }' ${_X11_EXTENSIONS_RENDER_H}
+_RENDER_VERSION= ${_RENDER_MAJOR}${_RENDER_MINOR}
+_RENDER_PKG= render-${_RENDER_VERSION}
+BUILDLINK_IS_BUILTIN.render?= YES
+. for _depend_ in ${BUILDLINK_DEPENDS.render}
+. if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_IS_BUILTIN.render!= \
+ if ${PKG_ADMIN} pmatch '${_depend_}' ${_RENDER_PKG}; then \
+ ${ECHO} "YES"; \
+ else \
+ ${ECHO} "NO"; \
+ fi
+. endif
+. endfor
+. endif
+. endif
+MAKEFLAGS+= BUILDLINK_IS_BUILTIN.render=${BUILDLINK_IS_BUILTIN.render}
+.endif
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+.if !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.render= YES
+.else
+BUILDLINK_USE_BUILTIN.render= NO
+.endif
+
+.if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \
+ !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.render= YES
+.endif
+.if !empty(PREFER_PKGSRC:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.render= NO
+.endif
+.if !empty(PREFER_NATIVE:Mrender) && \
+ !empty(BUILDLINK_IS_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.render= YES
+.endif
+.if !empty(PREFER_PKGSRC:Mrender)
+BUILDLINK_USE_BUILTIN.render= NO
+.endif
+
+.if !empty(BUILDLINK_CHECK_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_USE_BUILTIN.render= YES
+.endif
+
+.if !empty(BUILDLINK_USE_BUILTIN.render:M[nN][oO])
+. if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= render
+. endif
+.endif
+
+.if !empty(RENDER_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.render+= render>=0.8
+. if !empty(BUILDLINK_USE_BUILTIN.render:M[yY][eE][sS])
+BUILDLINK_PREFIX.render= ${X11BASE}
+. endif
+USE_X11= yes
+.endif # RENDER_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
Home |
Main Index |
Thread Index |
Old Index