pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/Xrender Modify checks for the version number of XF...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1eac40b1d8fb
branches:  trunk
changeset: 468724:1eac40b1d8fb
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Feb 16 12:43:06 2004 +0000

description:
Modify checks for the version number of XFree86-provided Xrender library
so that they will be more accurate.  Also properly include the buildlink.mk
files for render.

diffstat:

 x11/Xrender/buildlink2.mk |  99 ++++++++++++++++++++++++++++++++++------------
 x11/Xrender/buildlink3.mk |  56 ++++++++++++++++++++++----
 2 files changed, 120 insertions(+), 35 deletions(-)

diffs (228 lines):

diff -r 345e9943522e -r 1eac40b1d8fb x11/Xrender/buildlink2.mk
--- a/x11/Xrender/buildlink2.mk Mon Feb 16 12:39:55 2004 +0000
+++ b/x11/Xrender/buildlink2.mk Mon Feb 16 12:43:06 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.10 2004/02/12 02:35:07 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.11 2004/02/16 12:43:06 jlam Exp $
 
 .if !defined(XRENDER_BUILDLINK2_MK)
 XRENDER_BUILDLINK2_MK= # defined
@@ -13,34 +13,80 @@
 #
 _REQUIRE_BUILTIN_XRENDER?=     NO
 
-_RENDER_H=             ${X11BASE}/include/X11/extensions/render.h
-_X11_TMPL=             ${X11BASE}/lib/X11/config/X11.tmpl
+_X11_TMPL=     ${X11BASE}/lib/X11/config/X11.tmpl
 
 .if !defined(_BUILTIN_XRENDER)
 _BUILTIN_XRENDER=      NO
-.  if exists(${_RENDER_H}) && exists(${_X11_TMPL})
-# Create an appropriate Xrender package name for the built-in Xrender
-# distributed with XFree86 4.x.  This package name can be used to check
-# against BUILDLINK_DEPENDS.Xrender to see if we need to install the
-# pkgsrc Xrender or if the built-in one is sufficient.
-#
-_XRENDER_MAJOR!= \
-       ${AWK} '/.*\#define.*RENDER_MAJOR/ { print $$3 }' ${_RENDER_H}
-_XRENDER_MINOR!= \
-       ${AWK} '/.*\#define.*RENDER_MINOR/ { print "."$$3 }' ${_RENDER_H}
-_XRENDER_VERSION=      ${_XRENDER_MAJOR}${_XRENDER_MINOR}
-_XRENDER_PKG=          Xrender-${_XRENDER_VERSION}
-_XRENDER_DEPENDS=      ${BUILDLINK_DEPENDS.Xrender}
-_BUILTIN_XRENDER!= \
-       if ${PKG_ADMIN} pmatch '${_XRENDER_DEPENDS}' ${_XRENDER_PKG}; then \
-               if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then     \
-                       ${ECHO} "YES";                                  \
-               else                                                    \
-                       ${ECHO} "NO";                                   \
-               fi;                                                     \
+.  if exists(${_X11_TMPL})
+_IS_BUILTIN.Xrender!=                                                  \
+       if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then             \
+               ${ECHO} "YES";                                          \
        else                                                            \
                ${ECHO} "NO";                                           \
        fi
+_BUILTIN_XRENDER= ${_IS_BUILTIN.Xrender}
+.    if !empty(_IS_BUILTIN.Xrender:M[yY][eE][sS])
+#
+# Create an appropriate package name for the built-in Xrender 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.
+#
+# Xrender doesn't provide a method of discovering the version number of
+# the software.  Match up Xrender versions with XFree86 versions for an
+# approximate determination of the Xrender version.
+#
+_XRENDER_VERSIONS=     0.8.3  0.8.2  0.8.1  0.8  0.2  0.1
+_XRENDER_0.1=          4.0 4.0.* 4.1 4.1.[0-8][0-9]* 4.1.9[0-8]*
+_XRENDER_0.2=          4.1.99.* 4.2 4.2.[0-8][0-9]* 4.2.9[0-8]*
+_XRENDER_0.8=          4.2.99.* 4.3 4.3.[0-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 ${_XRENDER_VERSIONS}
+.        for _pattern_ in ${_XRENDER_${_xrender_version_}}
+.          if !empty(_XF86_VERSION:M${_pattern_})
+_XRENDER_VERSION?=     ${_xrender_version_}
+.          endif
+.        endfor
+.      endfor
+_XRENDER_VERSION?=     0.1
+_XRENDER_PKG=          Xrender-${_XRENDER_VERSION}
+
+_BUILTIN_XRENDER?=     YES
+.      for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
+.        if !empty(_BUILTIN_XRENDER:M[yY][eE][sS])
+_BUILTIN_XRENDER!=                                                     \
+       if ${PKG_ADMIN} pmatch '${_depend_}' ${_XRENDER_PKG}; then      \
+               ${ECHO} "YES";                                          \
+       else                                                            \
+               ${ECHO} "NO";                                           \
+       fi
+.        endif
+.      endfor
+.    endif
 .  endif
 MAKEFLAGS+=    _BUILTIN_XRENDER=${_BUILTIN_XRENDER}
 .endif
@@ -82,8 +128,7 @@
 # with a library minor bump.
 #
 BUILDLINK_DEPENDS.Xrender=     Xrender>=0.8.2
-
-.include "../../x11/render/buildlink2.mk"
+BUILDLINK_DEPENDS.render=      render>=0.8
 .else
 BUILDLINK_PREFIX.Xrender=      ${X11BASE}
 BUILDLINK_FILES.Xrender+=      include/X11/extensions/extutil.h
@@ -92,7 +137,9 @@
 BUILDLINK_FILES.Xrender+=      include/X11/extensions/renderproto.h
 .endif
 
-USE_X11=                       # defined
+USE_X11=       yes
+
+.include "../../x11/render/buildlink2.mk"
 
 BUILDLINK_TARGETS+=            Xrender-buildlink
 
diff -r 345e9943522e -r 1eac40b1d8fb x11/Xrender/buildlink3.mk
--- a/x11/Xrender/buildlink3.mk Mon Feb 16 12:39:55 2004 +0000
+++ b/x11/Xrender/buildlink3.mk Mon Feb 16 12:43:06 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.19 2004/02/12 02:35:07 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.20 2004/02/16 12:43:06 jlam Exp $
 
 BUILDLINK_DEPTH:=      ${BUILDLINK_DEPTH}+
 XRENDER_BUILDLINK3_MK:=        ${XRENDER_BUILDLINK3_MK}+
@@ -13,12 +13,11 @@
 
 BUILDLINK_CHECK_BUILTIN.Xrender?=      NO
 
-_X11_EXTENSIONS_RENDER_H=      ${X11BASE}/include/X11/extensions/render.h
-_X11_TMPL=                     ${X11BASE}/lib/X11/config/X11.tmpl
+_X11_TMPL=     ${X11BASE}/lib/X11/config/X11.tmpl
 
 .if !defined(BUILDLINK_IS_BUILTIN.Xrender)
 BUILDLINK_IS_BUILTIN.Xrender=  NO
-.  if exists(${_X11_EXTENSIONS_RENDER_H}) && exists(${_X11_TMPL})
+.  if exists(${_X11_TMPL})
 _IS_BUILTIN.Xrender!=                                                  \
        if ${GREP} -q BuildRenderLibrary ${_X11_TMPL}; then             \
                ${ECHO} "YES";                                          \
@@ -34,12 +33,49 @@
 # BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc version
 # or if the built-in one is sufficient.
 #
-_XRENDER_MAJOR!=       \
-       ${AWK} '/\#define[      ]*RENDER_MAJOR/ { print $$3 }' ${_X11_EXTENSIONS_RENDER_H}
-_XRENDER_MINOR!=       \
-       ${AWK} '/\#define[      ]*RENDER_MINOR/ { print "."$$3 }' ${_X11_EXTENSIONS_RENDER_H}
-_XRENDER_VERSION=      ${_XRENDER_MAJOR}${_XRENDER_MINOR}
+# Xrender doesn't provide a method of discovering the version number of
+# the software.  Match up Xrender versions with XFree86 versions for an
+# approximate determination of the Xrender version.
+#
+_XRENDER_VERSIONS=     0.8.3  0.8.2  0.8.1  0.8  0.2  0.1
+_XRENDER_0.1=          4.0 4.0.* 4.1 4.1.[0-8][0-9]* 4.1.9[0-8]*
+_XRENDER_0.2=          4.1.99.* 4.2 4.2.[0-8][0-9]* 4.2.9[0-8]*
+_XRENDER_0.8=          4.2.99.* 4.3 4.3.[0-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 ${_XRENDER_VERSIONS}
+.        for _pattern_ in ${_XRENDER_${_xrender_version_}}
+.          if !empty(_XF86_VERSION:M${_pattern_})
+_XRENDER_VERSION?=     ${_xrender_version_}
+.          endif
+.        endfor
+.      endfor
+_XRENDER_VERSION?=     0.1
 _XRENDER_PKG=          Xrender-${_XRENDER_VERSION}
+
 BUILDLINK_IS_BUILTIN.Xrender?= YES
 .      for _depend_ in ${BUILDLINK_DEPENDS.Xrender}
 .        if !empty(BUILDLINK_IS_BUILTIN.Xrender:M[yY][eE][sS])
@@ -87,6 +123,7 @@
 # minor number bump.
 #
 BUILDLINK_DEPENDS.Xrender+=    Xrender>=0.8.2
+BUILDLINK_DEPENDS.render+=     render>=0.8
 .  if !empty(BUILDLINK_DEPTH:M+)
 BUILDLINK_DEPENDS+=            Xrender
 .  endif
@@ -97,6 +134,7 @@
 BUILDLINK_PREFIX.Xrender=      ${X11BASE}
 .  endif
 USE_X11=       yes
+.  include "../../x11/render/buildlink3.mk"
 .endif # XRENDER_BUILDLINK3_MK
 
 BUILDLINK_DEPTH:=      ${BUILDLINK_DEPTH:S/+$//}



Home | Main Index | Thread Index | Old Index