diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
commit | d68193d4743931877544a7e52ed44171707b858d (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /graphics/xpm | |
parent | 55bd3391bd2b274e284613fb1e70cd0190dd4ed8 (diff) | |
download | pkgsrc-d68193d4743931877544a7e52ed44171707b858d.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 'graphics/xpm')
-rw-r--r-- | graphics/xpm/buildlink3.mk | 92 | ||||
-rw-r--r-- | graphics/xpm/builtin.mk | 72 |
2 files changed, 81 insertions, 83 deletions
diff --git a/graphics/xpm/buildlink3.mk b/graphics/xpm/buildlink3.mk index e556f1fcd2c..9d4e6e41549 100644 --- a/graphics/xpm/buildlink3.mk +++ b/graphics/xpm/buildlink3.mk @@ -1,95 +1,21 @@ -# $NetBSD: buildlink3.mk,v 1.14 2004/02/06 19:04:25 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.15 2004/03/10 17:57:14 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ XPM_BUILDLINK3_MK:= ${XPM_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= xpm +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nxpm} +BUILDLINK_PACKAGES+= xpm .if !empty(XPM_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= xpm BUILDLINK_DEPENDS.xpm+= xpm>=3.4k BUILDLINK_PKGSRCDIR.xpm?= ../../graphics/xpm -.endif # XPM_BUILDLINK3_MK - -BUILDLINK_CHECK_BUILTIN.xpm?= NO - -_X11_XPM_H= ${X11BASE}/include/X11/xpm.h -_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl - -.if !defined(BUILDLINK_IS_BUILTIN.xpm) -BUILDLINK_IS_BUILTIN.xpm= NO -. if exists(${_X11_XPM_H}) -. if !empty(X11BASE:M*openwin) -BUILDLINK_IS_BUILTIN.xpm!= \ - if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. elif ${OPSYS} == "IRIX" -BUILDLINK_IS_BUILTIN.xpm= YES -. elif exists(${_X11_TMPL}) -BUILDLINK_IS_BUILTIN.xpm!= \ - if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. else -BUILDLINK_IS_BUILTIN.xpm= NO -. endif -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.xpm=${BUILDLINK_IS_BUILTIN.xpm} -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.xpm:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.xpm= YES -.endif -.if !defined(BUILDLINK_USE_BUILTIN.xpm) -. if !empty(BUILDLINK_IS_BUILTIN.xpm:M[nN][oO]) -BUILDLINK_USE_BUILTIN.xpm= NO -. else -# -# Create an appropriate package name for the built-in xpm 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. -# -_XPM_MAJOR!= \ - ${AWK} '/\#define[ ]*XpmFormat/ { print $$3 }' ${_X11_XPM_H} -_XPM_MINOR!= \ - ${AWK} '/\#define[ ]*XpmVersion/ { print "."$$3 }' ${_X11_XPM_H} -_XPM_PATCH!= \ - ${AWK} 'BEGIN { split("abcdefghijklmnopqrstuvwxyz", alpha, "") } /\#define[ ]*XpmRevision/ { print alpha[$$3] }' ${_X11_XPM_H} -_XPM_VERSION= ${_XPM_MAJOR}${_XPM_MINOR}${_XPM_PATCH} -_XPM_PKG= xpm-${_XPM_VERSION} -BUILDLINK_USE_BUILTIN.xpm?= YES -. for _depend_ in ${BUILDLINK_DEPENDS.xpm} -. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.xpm!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${_XPM_PKG}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. endif -MAKEFLAGS+= BUILDLINK_USE_BUILTIN.xpm=${BUILDLINK_USE_BUILTIN.xpm} -.endif # BUILDLINK_USE_BUILTIN.xpm +USE_X11= yes -.if !empty(BUILDLINK_USE_BUILTIN.xpm:M[nN][oO]) -. if !empty(BUILDLINK_DEPTH:M+) -BUILDLINK_DEPENDS+= xpm -. endif -.endif - -.if !empty(XPM_BUILDLINK3_MK:M+) -. if !empty(BUILDLINK_USE_BUILTIN.xpm:M[yY][eE][sS]) -BUILDLINK_PREFIX.xpm= ${X11BASE} -. endif -USE_X11= yes .endif # XPM_BUILDLINK3_MK -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/graphics/xpm/builtin.mk b/graphics/xpm/builtin.mk new file mode 100644 index 00000000000..1a2c59b7166 --- /dev/null +++ b/graphics/xpm/builtin.mk @@ -0,0 +1,72 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $ + +.include "../../mk/bsd.prefs.mk" + +_X11_XPM_H= ${X11BASE}/include/X11/xpm.h +_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl + +.if !defined(IS_BUILTIN.xpm) +IS_BUILTIN.xpm= no +. if exists(${_X11_XPM_H}) +. if !empty(X11BASE:M*openwin) +IS_BUILTIN.xpm!= \ + if /usr/sbin/pkgchk -l SUNWxwinc | ${GREP} -q xpm.h; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. elif ${OPSYS} == "IRIX" +IS_BUILTIN.xpm= yes +. elif exists(${_X11_TMPL}) +IS_BUILTIN.xpm!= \ + if ${GREP} -q NormalLibXpm ${_X11_TMPL}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. else +IS_BUILTIN.xpm= no +. endif +. endif +. if !empty(IS_BUILTIN.xpm:M[yY][eE][sS]) +# +# Create an appropriate package name for the built-in xpm 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. +# +_XPM_MAJOR!= \ + ${AWK} '/\#define[ ]*XpmFormat/ { print $$3 }' ${_X11_XPM_H} +_XPM_MINOR!= \ + ${AWK} '/\#define[ ]*XpmVersion/ { print "."$$3 }' ${_X11_XPM_H} +_XPM_PATCH!= \ + ${AWK} 'BEGIN { split("abcdefghijklmnopqrstuvwxyz", alpha, "") } /\#define[ ]*XpmRevision/ { print alpha[$$3] }' ${_X11_XPM_H} +_XPM_VERSION= ${_XPM_MAJOR}${_XPM_MINOR}${_XPM_PATCH} +BUILTIN_PKG.xpm= xpm-${_XPM_VERSION} +MAKEFLAGS+= BUILTIN_PKG.xpm=${BUILTIN_PKG.xpm} +. endif +MAKEFLAGS+= IS_BUILTIN.xpm=${IS_BUILTIN.xpm} +.endif # USE_BUILTIN.xpm + +CHECK_BUILTIN.xpm?= no +.if !empty(CHECK_BUILTIN.xpm:M[yY][eE][sS]) +USE_BUILTIN.xpm= yes +.endif + +.if !defined(USE_BUILTIN.xpm) +USE_BUILTIN.xpm?= ${IS_BUILTIN.xpm} + +. if defined(BUILTIN_PKG.xpm) +USE_BUILTIN.xpm= yes +. for _depend_ in ${BUILDLINK_DEPENDS.xpm} +. if !empty(USE_BUILTIN.xpm:M[yY][eE][sS]) +USE_BUILTIN.xpm!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.xpm}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +.endif # USE_BUILTIN.xpm |