summaryrefslogtreecommitdiff
path: root/graphics/MesaLib
diff options
context:
space:
mode:
authorjlam <jlam>2002-11-18 07:49:24 +0000
committerjlam <jlam>2002-11-18 07:49:24 +0000
commit64c3a6677f8e22b6703ccccc73e078e71396a402 (patch)
tree6aece24589ba3e309c575e03c5f19cb4d45fd2d2 /graphics/MesaLib
parente7b2b2b2a7516fa60e1b258801dd12a228e7148c (diff)
downloadpkgsrc-64c3a6677f8e22b6703ccccc73e078e71396a402.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')
-rw-r--r--graphics/MesaLib/Makefile16
-rw-r--r--graphics/MesaLib/buildlink2.mk47
2 files changed, 44 insertions, 19 deletions
diff --git a/graphics/MesaLib/Makefile b/graphics/MesaLib/Makefile
index fe2c3a2f7f9..e621e57612d 100644
--- a/graphics/MesaLib/Makefile
+++ b/graphics/MesaLib/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2002/10/27 13:50:09 bouyer Exp $
+# $NetBSD: Makefile,v 1.13 2002/11/18 07:49:25 jlam Exp $
PKGNAME= MesaLib-${MESA_VERSION}
WRKSRC= ${WRKDIR}/${DISTNAME:S/Lib//}
@@ -10,28 +10,22 @@ COMMENT= Graphics library similar to SGI's OpenGL
USE_BUILDLINK2= yes
USE_X11BASE= yes
CONFIGURE_ARGS+= --without-glut
+BUILD_DIRS= ${WRKSRC}/src
.include "../../mk/bsd.prefs.mk"
# Check if we got Mesa distributed with XFree86 4.x.
-.if exists(${X11BASE}/include/GL/glx.h)
+.if exists(${X11BASE}/include/GL/glx.h) && \
+ exists(${X11BASE}/lib/X11/config/X11.tmpl)
_IS_BUILTIN_MESA!= ${EGREP} -c BuildGLXLibrary ${X11BASE}/lib/X11/config/X11.tmpl || ${TRUE}
.else
_IS_BUILTIN_MESA= 0
.endif
-.if ${_IS_BUILTIN_MESA} != "0"
+.if (${X11PREFIX} == ${X11BASE}) && (${_IS_BUILTIN_MESA} != "0")
IGNORE= "MesaLib/GLX has already been installed as part of XFree-4.x"
.endif
-do-build:
- cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} \
- ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} ${ALL_TARGET}
-
-do-install:
- cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} \
- ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} ${INSTALL_TARGET}
-
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/include/GL
cd ${WRKSRC}/include/GL; for hdr in \
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