summaryrefslogtreecommitdiff
path: root/graphics/MesaLib/buildlink2.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-11-18 07:49:24 +0000
committerjlam <jlam@pkgsrc.org>2002-11-18 07:49:24 +0000
commitdb3a779c2dd868f2ee22183d0931287cb71a9f51 (patch)
tree6aece24589ba3e309c575e03c5f19cb4d45fd2d2 /graphics/MesaLib/buildlink2.mk
parent39b20fc8a42330a52c95a2cf15c226ba31a8ec52 (diff)
downloadpkgsrc-db3a779c2dd868f2ee22183d0931287cb71a9f51.tar.gz
Alter Mesa/GL packages so that they may always be installed if
X11PREFIX != X11BASE (xpkgwedge is installed). Introduce a new variable MESA_REQD that defaults to "3.4.2" and represents the version of Mesa/GL needed by a package. MESA_REQD is intended to be used by package Makefiles or by buildlink2.mk files. It should now be possible to update this package to the latest release (5.0), and have it work on: * XF86-3.x with or without xpkgwedge * XF86-4.x with xpkgwedge
Diffstat (limited to 'graphics/MesaLib/buildlink2.mk')
-rw-r--r--graphics/MesaLib/buildlink2.mk47
1 files changed, 39 insertions, 8 deletions
diff --git a/graphics/MesaLib/buildlink2.mk b/graphics/MesaLib/buildlink2.mk
index 3023491900a..713f26e0e26 100644
--- a/graphics/MesaLib/buildlink2.mk
+++ b/graphics/MesaLib/buildlink2.mk
@@ -1,31 +1,60 @@
-# $NetBSD: buildlink2.mk,v 1.4 2002/10/27 13:50:09 bouyer Exp $
+# $NetBSD: buildlink2.mk,v 1.5 2002/11/18 07:49:25 jlam Exp $
.if !defined(MESALIB_BUILDLINK2_MK)
MESALIB_BUILDLINK2_MK= # defined
.include "../../mk/bsd.prefs.mk"
-BUILDLINK_DEPENDS.MesaLib?= MesaLib>=3.4.2
+MESA_REQD?= 3.4.2
+BUILDLINK_DEPENDS.MesaLib?= MesaLib>=${MESA_REQD}
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
# Check if we got Mesa distributed with XFree86 4.x or if we need to
# depend on the Mesa package.
#
_REQUIRE_BUILTIN_MESALIB?= NO
-.if exists(${X11BASE}/include/GL/glx.h)
-_IS_BUILTIN_MESALIB!= ${EGREP} -c BuildGLXLibrary ${X11BASE}/lib/X11/config/X11.tmpl || ${TRUE}
+
+_GL_GLX_H= ${X11BASE}/include/GL/glx.h
+_X11_TMPL= ${X11BASE}/lib/X11/config/X11.tmpl
+.if exists(${_GL_GLX_H}) && exists(${_X11_TMPL})
+_IS_BUILTIN_MESALIB!= ${EGREP} -c BuildGLXLibrary ${_X11_TMPL} || ${TRUE}
.else
_IS_BUILTIN_MESALIB= 0
.endif
-.if (${_IS_BUILTIN_MESALIB} == "0") && (${_REQUIRE_BUILTIN_MESALIB} == "NO")
-_NEED_MESALIB= YES
-.else
+
+.if !empty(_REQUIRE_BUILTIN_MESALIB:M[yY][eE][sS])
_NEED_MESALIB= NO
+.else
+. if ${_IS_BUILTIN_MESALIB} == "0"
+_NEED_MESALIB= YES
+. else
+#
+# Create an appropriate package name for the built-in MesaLib distributed
+# with XFree86 4.x. This package name can be used to check against
+# BUILDLINK_DEPENDS.MesaLib to see if we need to install the pkgsrc
+# Mesa or if the built-in one is sufficient.
+#
+. if exists(${X11BASE}/bin/glxinfo)
+_MESALIB_VERSION!= \
+ ${X11BASE}/bin/glxinfo | \
+ ${SED} -n "/OpenGL version string/s/.*Mesa *//p"
+. else
+_MESALIB_VERSION?= 3.4
+. endif
+_MESALIB_PKG= MesaLib-${_MESALIB_VERSION}
+_MESALIB_DEPENDS= ${BUILDLINK_DEPENDS.MesaLib}
+_NEED_MESALIB!= \
+ if ${PKG_ADMIN} pmatch '${_MESALIB_DEPENDS}' ${_MESALIB_PKG}; then \
+ ${ECHO} "NO"; \
+ else \
+ ${ECHO} "YES"; \
+ fi
+. endif
.endif
.if ${_NEED_MESALIB} == "YES"
BUILDLINK_PACKAGES+= MesaLib
-EVAL_PREFIX+= BUILDLINK_PREFIX.MesaLib=MesaLib
+EVAL_PREFIX+= BUILDLINK_PREFIX.MesaLib=MesaLib
BUILDLINK_PREFIX.MesaLib_DEFAULT= ${X11PREFIX}
.else
BUILDLINK_PREFIX.MesaLib= ${X11BASE}
@@ -42,6 +71,8 @@ BUILDLINK_FILES.MesaLib+= include/GL/xmesa_x.h
BUILDLINK_FILES.MesaLib+= include/GL/xmesa_xf86.h
BUILDLINK_FILES.MesaLib+= lib/libGL.*
+USE_X11= # defined
+
BUILDLINK_TARGETS+= MesaLib-buildlink
MesaLib-buildlink: _BUILDLINK_USE