diff options
author | jlam <jlam> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam> | 2004-03-10 17:57:14 +0000 |
commit | dcc66b8df5c6733d79956b8b5a9fd3a9c8d948f7 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /x11/render | |
parent | e21a48d5290393121554d500c5350afe393cefba (diff) | |
download | pkgsrc-dcc66b8df5c6733d79956b8b5a9fd3a9c8d948f7.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 'x11/render')
-rw-r--r-- | x11/render/buildlink3.mk | 89 | ||||
-rw-r--r-- | x11/render/builtin.mk | 58 |
2 files changed, 66 insertions, 81 deletions
diff --git a/x11/render/buildlink3.mk b/x11/render/buildlink3.mk index 5ea88adf8ff..4698900316e 100644 --- a/x11/render/buildlink3.mk +++ b/x11/render/buildlink3.mk @@ -1,95 +1,22 @@ -# $NetBSD: buildlink3.mk,v 1.5 2004/02/18 16:35:27 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:15 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ RENDER_BUILDLINK3_MK:= ${RENDER_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= render +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nrender} +BUILDLINK_PACKAGES+= render .if !empty(RENDER_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= render BUILDLINK_DEPENDS.render+= render>=0.2 BUILDLINK_PKGSRCDIR.render?= ../../x11/render 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_CHECK_BUILTIN.render:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.render= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.render) -. 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 -.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/+$//} diff --git a/x11/render/builtin.mk b/x11/render/builtin.mk new file mode 100644 index 00000000000..61bf829dc13 --- /dev/null +++ b/x11/render/builtin.mk @@ -0,0 +1,58 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $ + +_X11_EXTENSIONS_RENDER_H= ${X11BASE}/include/X11/extensions/render.h + +.if !defined(IS_BUILTIN.render) +IS_BUILTIN.render= no +. if exists(${_X11_EXTENSIONS_RENDER_H}) +IS_BUILTIN.render= yes +# +# 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} +BUILTIN_PKG.render= render-${_RENDER_VERSION} +MAKEFLAGS+= BUILTIN_PKG.render=${BUILTIN_PKG.render} +. endif +MAKEFLAGS+= IS_BUILTIN.render=${IS_BUILTIN.render} +.endif + +CHECK_BUILTIN.render?= no +.if !empty(CHECK_BUILTIN.render:M[yY][eE][sS]) +USE_BUILTIN.render= yes +.endif + +.if !defined(USE_BUILTIN.render) +USE_BUILTIN.render?= ${IS_BUILTIN.render} + +. if defined(BUILTIN_PKG.render) +USE_BUILTIN.render= yes +. for _depend_ in ${BUILDLINK_DEPENDS.render} +. if !empty(USE_BUILTIN.render:M[yY][eE][sS]) +USE_BUILTIN.render!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.render}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +.endif # USE_BUILTIN.render + +.if !empty(USE_BUILTIN.render:M[nN][oO]) +BUILDLINK_DEPENDS.render+= render>=0.8 +.endif + +.if !empty(USE_BUILTIN.render:M[yY][eE][sS]) +BUILDLINK_PREFIX.render= ${X11BASE} +USE_X11= yes +.endif |