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 | d0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /x11/Xrandr-mixedcase | |
parent | 9d61fef8537aed11013bf556e319b2d8e398a11b (diff) | |
download | pkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.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/Xrandr-mixedcase')
-rw-r--r-- | x11/Xrandr-mixedcase/buildlink3.mk | 140 | ||||
-rw-r--r-- | x11/Xrandr-mixedcase/builtin.mk | 99 |
2 files changed, 109 insertions, 130 deletions
diff --git a/x11/Xrandr-mixedcase/buildlink3.mk b/x11/Xrandr-mixedcase/buildlink3.mk index 2e43737119c..571c9671547 100644 --- a/x11/Xrandr-mixedcase/buildlink3.mk +++ b/x11/Xrandr-mixedcase/buildlink3.mk @@ -1,144 +1,24 @@ -# $NetBSD: buildlink3.mk,v 1.12 2004/02/19 19:12:26 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.13 2004/03/10 17:57:15 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ XRANDR_BUILDLINK3_MK:= ${XRANDR_BUILDLINK3_MK}+ -.include "../../mk/bsd.prefs.mk" +.if !empty(BUILDLINK_DEPTH:M+) +BUILDLINK_DEPENDS+= Xrandr +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:NXrandr} +BUILDLINK_PACKAGES+= Xrandr .if !empty(XRANDR_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= Xrandr BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0 BUILDLINK_PKGSRCDIR.Xrandr?= ../../x11/Xrandr -.endif # XRANDR_BUILDLINK3_MK - -BUILDLINK_CHECK_BUILTIN.Xrandr?= NO - -_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl - -.if !defined(BUILDLINK_IS_BUILTIN.Xrandr) -BUILDLINK_IS_BUILTIN.Xrandr= NO -. if exists(${_X11_TMPL}) -_IS_BUILTIN.Xrandr!= \ - if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -BUILDLINK_IS_BUILTIN.Xrandr= ${_IS_BUILTIN.Xrandr} -. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO]) && \ - !empty(_IS_BUILTIN.Xrandr:M[yY][eE][sS]) -# -# Create an appropriate package name for the built-in Xrandr 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. -# -# Xrandr doesn't provide a method of discovering the version number of -# the software. Match up Xrandr versions with XFree86 versions for an -# approximate determination of the Xrandr version. -# -_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0 -_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]* -. if !defined(_XF86_VERSION) -_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def -. if !exists(${_X11_CONFIG_VERSION_DEF}) -_XF86_VERSION= 3.3 -. else -_XF86_MAJOR!= \ - ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \ - ${_X11_CONFIG_VERSION_DEF} -_XF86_MINOR!= \ - ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \ - ${_X11_CONFIG_VERSION_DEF} -_XF86_PATCH!= \ - ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \ - ${_X11_CONFIG_VERSION_DEF} -_XF86_SNAP!= \ - ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \ - ${_X11_CONFIG_VERSION_DEF} -_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP} -. if !empty(_XF86_TEENY:M0.0) -_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR} -. else -_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY} -. endif -. endif -. endif -. for _xrender_version_ in ${_XRANDR_VERSIONS} -. for _pattern_ in ${_XRANDR_${_xrender_version_}} -. if !empty(_XF86_VERSION:M${_pattern_}) -_XRANDR_VERSION?= ${_xrender_version_} -. endif -. endfor -. endfor -_XRANDR_VERSION?= 1.0 -_XRANDR_PKG= Xrandr-${_XRANDR_VERSION} - -BUILDLINK_IS_BUILTIN.Xrandr?= YES -. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr} -. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_IS_BUILTIN.Xrandr!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRANDR_PKG}; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. endif -. endif -MAKEFLAGS+= BUILDLINK_IS_BUILTIN.Xrandr=${BUILDLINK_IS_BUILTIN.Xrandr} -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrandr= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.Xrandr) -. if !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrandr= YES -. else -BUILDLINK_USE_BUILTIN.Xrandr= NO -. endif -. if !empty(PREFER_NATIVE:M[yY][eE][sS]) && \ - !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrandr= YES -. endif -. if !empty(PREFER_PKGSRC:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrandr= NO -. endif -. if !empty(PREFER_NATIVE:MXrandr) && \ - !empty(BUILDLINK_IS_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.Xrandr= YES -. endif -. if !empty(PREFER_PKGSRC:MXrandr) -BUILDLINK_USE_BUILTIN.Xrandr= NO -. endif -.endif - -.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[nN][oO]) -BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1 -BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8 -. if !empty(BUILDLINK_DEPTH:M+) -BUILDLINK_DEPENDS+= Xrandr -. endif -.endif +USE_X11= yes -.if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.randrext= yes -BUILDLINK_USE_BUILTIN.Xrender= yes -.endif +.include "../../x11/randrext/buildlink3.mk" +.include "../../x11/Xrender/buildlink3.mk" -.if !empty(XRANDR_BUILDLINK3_MK:M+) -. if !empty(BUILDLINK_USE_BUILTIN.Xrandr:M[yY][eE][sS]) -BUILDLINK_PREFIX.Xrandr= ${X11BASE} -. endif -USE_X11= yes -. if !empty(BUILDLINK_CHECK_BUILTIN.Xrandr:M[nN][oO]) -. include "../../x11/randrext/buildlink3.mk" -. include "../../x11/Xrender/buildlink3.mk" -. endif .endif # XRANDR_BUILDLINK3_MK BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/x11/Xrandr-mixedcase/builtin.mk b/x11/Xrandr-mixedcase/builtin.mk new file mode 100644 index 00000000000..26eeb68d4d2 --- /dev/null +++ b/x11/Xrandr-mixedcase/builtin.mk @@ -0,0 +1,99 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:15 jlam Exp $ + +_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl + +.if !defined(IS_BUILTIN.Xrandr) +IS_BUILTIN.Xrandr= no +. if exists(${_X11_TMPL}) +IS_BUILTIN.Xrandr!= \ + if ${GREP} -q BuildRandRLibrary ${_X11_TMPL}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. if !empty(IS_BUILTIN.Xrandr:M[yY][eE][sS]) +# +# Create an appropriate package name for the built-in Xrandr 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. +# +# Xrandr doesn't provide a method of discovering the version number of +# the software. Match up Xrandr versions with XFree86 versions for an +# approximate determination of the Xrandr version. +# +_XRANDR_VERSIONS= 1.0.2 1.0.1 1.0 +_XRANDR_1.0= 4.2 4.2.* 4.3 4.3.[0-9] 4.3.[0-9].* 4.3.[1-8][0-9]* 4.3.9[0-8]* +. if !defined(_XF86_VERSION) +_X11_CONFIG_VERSION_DEF= ${X11BASE}/lib/X11/config/version.def +_XF86_VERSION= 3.3 +. if exists(${_X11_CONFIG_VERSION_DEF}) +_XF86_MAJOR!= \ + ${AWK} '/\#define[ ]*XF86_VERSION_MAJOR/ { print $$3 }' \ + ${_X11_CONFIG_VERSION_DEF} +_XF86_MINOR!= \ + ${AWK} '/\#define[ ]*XF86_VERSION_MINOR/ { print $$3 }' \ + ${_X11_CONFIG_VERSION_DEF} +_XF86_PATCH!= \ + ${AWK} '/\#define[ ]*XF86_VERSION_PATCH/ { print $$3 }' \ + ${_X11_CONFIG_VERSION_DEF} +_XF86_SNAP!= \ + ${AWK} '/\#define[ ]*XF86_VERSION_SNAP/ { print $$3 }' \ + ${_X11_CONFIG_VERSION_DEF} +_XF86_TEENY= ${_XF86_PATCH}.${_XF86_SNAP} +. if !empty(_XF86_TEENY:M0.0) +_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR} +. else +_XF86_VERSION= ${_XF86_MAJOR}.${_XF86_MINOR}.${_XF86_TEENY} +. endif +. endif +MAKEFLAGS+= _XF86_VERSION=${_XF86_VERSION} +. endif +. for _xrandr_version_ in ${_XRANDR_VERSIONS} +. for _pattern_ in ${_XRANDR_${_xrandr_version_}} +. if !empty(_XF86_VERSION:M${_pattern_}) +_XRANDR_VERSION?= ${_xrandr_version_} +. endif +. endfor +. endfor +_XRANDR_VERSION?= 1.0 +BUILTIN_PKG.Xrandr= Xrandr-${_XRANDR_VERSION} +MAKEFLAGS+= BUILTIN_PKG.Xrandr=${BUILTIN_PKG.Xrandr} +. endif +. endif +MAKEFLAGS+= IS_BUILTIN.Xrandr=${IS_BUILTIN.Xrandr} +.endif + +CHECK_BUILTIN.Xrandr?= no +.if !empty(CHECK_BUILTIN.Xrandr:M[yY][eE][sS]) +USE_BUILTIN.Xrandr= yes +.endif + +.if !defined(USE_BUILTIN.Xrandr) +USE_BUILTIN.Xrandr?= ${IS_BUILTIN.Xrandr} + +. if defined(BUILTIN_PKG.Xrandr) +USE_BUILTIN.Xrandr= yes +. for _depend_ in ${BUILDLINK_DEPENDS.Xrandr} +. if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS]) +USE_BUILTIN.Xrandr!= \ + if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.Xrandr}; then \ + ${ECHO} "yes"; \ + else \ + ${ECHO} "no"; \ + fi +. endif +. endfor +. endif +.endif # USE_BUILTIN.Xrandr + +.if !empty(USE_BUILTIN.Xrandr:M[nN][oO]) +BUILDLINK_DEPENDS.Xrandr+= Xrandr>=1.0.1 +BUILDLINK_DEPENDS.Xrender+= Xrender>=0.8 +.endif + +.if !empty(USE_BUILTIN.Xrandr:M[yY][eE][sS]) +BUILDLINK_PREFIX.Xrandr= ${X11BASE} +USE_BUILTIN.randrext= yes +USE_BUILTIN.Xrender= yes +.endif |