diff options
author | jlam <jlam@pkgsrc.org> | 2004-02-16 12:39:00 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-02-16 12:39:00 +0000 |
commit | a1b57b2ee42abbac0181e06faac7baa90152d01e (patch) | |
tree | 4b5c8219c04ff27d09b0fcc461421c0ce443902e /x11 | |
parent | 5cbed6f96bb7c2cbcf87a597550db6394b990ed2 (diff) | |
download | pkgsrc-a1b57b2ee42abbac0181e06faac7baa90152d01e.tar.gz |
Add checks to see whether the XFree86-provided render headers satisfy the
dependency requirements.
Diffstat (limited to 'x11')
-rw-r--r-- | x11/render/buildlink2.mk | 92 | ||||
-rw-r--r-- | x11/render/buildlink3.mk | 89 |
2 files changed, 161 insertions, 20 deletions
diff --git a/x11/render/buildlink2.mk b/x11/render/buildlink2.mk index 482bae0b3e4..ceb583b3481 100644 --- a/x11/render/buildlink2.mk +++ b/x11/render/buildlink2.mk @@ -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 -BUILDLINK_PACKAGES+= render -BUILDLINK_DEPENDS.render?= render>=0.8 -BUILDLINK_PKGSRCDIR.render?= ../../x11/render -# header files only -BUILDLINK_DEPMETHOD.render= build +.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 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 --git a/x11/render/buildlink3.mk b/x11/render/buildlink3.mk index 58f9b04cbe3..8bde52730bc 100644 --- a/x11/render/buildlink3.mk +++ b/x11/render/buildlink3.mk @@ -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 + +.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/+$//} +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} |