From 971be6f22592b4ac01a288e4392ebaa3390bfea9 Mon Sep 17 00:00:00 2001 From: Florent Thoumie Date: Wed, 29 Aug 2007 10:33:10 +0000 Subject: [PATCH] - Refactor MesaLib ports. - Update graphics/libGLw to 7.0.1. --- graphics/dri/Makefile | 53 ++++---------- graphics/libGL/Makefile | 66 ++--------------- graphics/libGL/bsd.mesalib.mk | 85 ++++++++++++++++++++++ graphics/libGLU/Makefile | 27 ++----- graphics/libGLU/files/config | 31 -------- graphics/libGLU/files/patch-glu-Makefile | 16 ---- graphics/libGLw/Makefile | 32 ++------ graphics/libGLw/distinfo | 6 +- graphics/libGLw/files/config | 31 -------- graphics/libGLw/files/patch-glw-GLwDrawA.c | 4 +- graphics/libGLw/files/patch-glw-Makefile | 15 ---- 11 files changed, 126 insertions(+), 240 deletions(-) create mode 100644 graphics/libGL/bsd.mesalib.mk delete mode 100644 graphics/libGLU/files/config delete mode 100644 graphics/libGLU/files/patch-glu-Makefile delete mode 100644 graphics/libGLw/files/config delete mode 100644 graphics/libGLw/files/patch-glw-Makefile diff --git a/graphics/dri/Makefile b/graphics/dri/Makefile index fa4858248830..7046f14d2d7c 100644 --- a/graphics/dri/Makefile +++ b/graphics/dri/Makefile @@ -6,14 +6,10 @@ # PORTNAME= dri -PORTVERSION= 7.0.1 +PORTVERSION= ${MESAVERSION} PORTEPOCH= 2 CATEGORIES= graphics -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR=mesa3d -DISTNAME= MesaLib-${PORTVERSION} -MAINTAINER= anholt@FreeBSD.org COMMENT= OpenGL hardware acceleration drivers for the DRI LIB_DEPENDS= drm:${PORTSDIR}/graphics/libdrm \ @@ -22,22 +18,18 @@ BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend CONFLICTS= xfree86-dri-* dri-6.2.2005* dri-6.5.2006* -WRKSRC= ${WRKDIR}/Mesa-${PORTVERSION} -USE_X_PREFIX= yes -USE_BZIP2= yes -USE_GMAKE= yes -MAKE_ARGS= SHELL=${SH} MAKE_ENV+= FBSDCC="${CC}" FBSDCXX="${CXX}" \ FBSDCFLAGS="${CFLAGS}" FBSDCXXFLAGS="${CXXFLAGS}" \ PTHREAD_LIBS=${PTHREAD_LIBS} USE_GCC= 3.4+ +USE_XORG= x11 + DRIMODDIR= ${PREFIX}/lib/dri +SRCDIR= mesa -.include - -.if ${X_WINDOW_SYSTEM:L} != xorg -IGNORE= requires libGL from X.Org +.if !defined(ARCH) +ARCH!= uname -p .endif do-install: @@ -60,6 +52,14 @@ do-install: ${INSTALL_PROGRAM} ${WRKSRC}/lib/savage_dri.so ${DRIMODDIR} ${INSTALL_PROGRAM} ${WRKSRC}/lib/sis_dri.so ${DRIMODDIR} +.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk" + +.include + +.if ${X_WINDOW_SYSTEM:L} != xorg +IGNORE= requires libGL from X.Org +.endif + .if ${OSVERSION} < 500000 pre-patch: @${REINPLACE_CMD} -e 's|stdint.h|sys/types.h|g' \ @@ -67,29 +67,4 @@ pre-patch: ${WRKSRC}/src/mesa/drivers/dri/mga/mgacontext.h .endif -post-patch: - @${REINPLACE_CMD} -e '/^CC =/d' -e '/^CXX =/d' \ - -e 's|/usr/local|$$(LOCALBASE)|g' \ - -e 's|/usr/X11R6|$$(X11BASE)|g' \ - -e 's|-lpthread|$$(PTHREAD_LIBS)|g' \ - -e 's|^\(SRC_DIRS =\).*|\1 mesa|' \ - ${WRKSRC}/configs/freebsd-dri -.if ${OSVERSION} < 700013 - @${REINPLACE_CMD} -e 's|-DHAVE_POSIX_MEMALIGN||' \ - ${WRKSRC}/configs/freebsd-dri -.endif - -.if ${ARCH} == i386 -PLIST_SUB+= I386="" -PLIST_SUB+= I386_AMD64="" -ALL_TARGET= freebsd-dri-x86 -.elif ${ARCH} == amd64 -PLIST_SUB+= I386="@comment " -PLIST_SUB+= I386_AMD64="" -ALL_TARGET= freebsd-dri-amd64 -.else -PLIST_SUB+= I386="@comment " -PLIST_SUB+= I386_AMD64="@comment " -ALL_TARGET= freebsd-dri -.endif .include diff --git a/graphics/libGL/Makefile b/graphics/libGL/Makefile index 76bbfe558c30..78b5f0208d4a 100644 --- a/graphics/libGL/Makefile +++ b/graphics/libGL/Makefile @@ -5,71 +5,21 @@ # $FreeBSD$ # -PORTNAME?= libGL -PORTVERSION?= 7.0.1 +PORTNAME= libGL +PORTVERSION= ${MESAVERSION} CATEGORIES= graphics -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ - ftp://ftp.fu-berlin.de/pub/unix/X11/graphics/Mesa/ -MASTER_SITE_SUBDIR= mesa3d -DISTFILES= MesaLib-${PORTVERSION}${EXTRACT_SUFX} -MAINTAINER= x11@FreeBSD.org -COMMENT?= OpenGL library that renders using GLX or DRI +COMMENT= OpenGL library that renders using GLX or DRI BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend LIB_DEPENDS+= drm:${PORTSDIR}/graphics/libdrm -CONFLICTS= XFree86-libraries-* xorg-libraries-6.* - USE_XORG= glproto xxf86vm xext xfixes xdamage -USE_GMAKE= yes -USE_LDCONFIG= yes CFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/drm -GLHEADERS= gl.h glext.h glx.h glxext.h -MAKE_ARGS= SHELL=${SH} -WRKSRC= ${WRKDIR}/Mesa-${PORTVERSION} -PREFIX?= ${X11BASE} -USE_BZIP2= yes +SRCDIR= glx/x11 +HEADERS= gl.h glext.h glx.h glxext.h +HEADERSDIR= include/GL -pre-patch: - @${REINPLACE_CMD} \ - -e 's|/usr/X11R6|${X11BASE}|g' \ - -e 's|/usr/local|${LOCALBASE}|g' \ - -e 's|gcc|${CC}|g' \ - -e 's|g++|${CXX}|g' \ - -e 's|CFLAGS = |CFLAGS = ${CFLAGS} |g' \ - -e 's|OPT_FLAGS = .*|OPT_FLAGS = ${CFLAGS}|g' \ - -e 's|-lpthread|${PTHREAD_LIBS}|g' \ - -e 's|SRC_DIRS = .*|SRC_DIRS = glx/x11|g' \ - ${WRKSRC}/configs/freebsd-dri - @${REINPLACE_CMD} \ - -e 's|^\(MKDEP_OPTIONS.*\)|\1 --|' \ - -e 's|^DRI_DRIVER_INSTALL_DIR.*|DRI_DRIVER_INSTALL_DIR = ${X11BASE}/lib/dri|' \ - ${WRKSRC}/configs/default - -do-install: - ${MKDIR} ${PREFIX}/include/GL -.for i in ${GLHEADERS} - ${INSTALL_DATA} ${WRKSRC}/include/GL/${i} ${PREFIX}/include/GL -.endfor - ${INSTALL_PROGRAM} ${WRKSRC}/lib/libGL.so.1 ${PREFIX}/lib - ${LN} -sf libGL.so.1 ${PREFIX}/lib/libGL.so - -.include - -.if ${ARCH} == i386 -PLIST_SUB+= I386="" -PLIST_SUB+= I386_AMD64="" -ALL_TARGET= freebsd-dri-x86 -.elif ${ARCH} == amd64 -PLIST_SUB+= I386="@comment " -PLIST_SUB+= I386_AMD64="" -ALL_TARGET= freebsd-dri-amd64 -.else -PLIST_SUB+= I386="@comment " -PLIST_SUB+= I386_AMD64="@comment " -ALL_TARGET= freebsd-dri -.endif - -.include +.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk" +.include diff --git a/graphics/libGL/bsd.mesalib.mk b/graphics/libGL/bsd.mesalib.mk new file mode 100644 index 000000000000..39350c1d2962 --- /dev/null +++ b/graphics/libGL/bsd.mesalib.mk @@ -0,0 +1,85 @@ +#-*- mode: Fundamental; tab-width: 4; -*- +# ex:ts=4 +# +# bsd.mesa.mk - an attempt to refactor MesaLib ports. +# +# Created by: Florent Thoumie +# +# !!! Here be dragons !!! (they seem to be everywhere these days) +# +# Remember to upgrade the following ports everytime you bump MESAVERSION: +# +# - graphics/libGL +# - graphics/libGLU +# - graphics/libGLw +# - graphics/dri +# +# $FreeBSD$ +# + +MESAVERSION= 7.0.1 +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ + ftp://ftp.fu-berlin.de/pub/unix/X11/graphics/Mesa/ +MASTER_SITE_SUBDIR= mesa3d +DISTFILES= MesaLib-${PORTVERSION}${EXTRACT_SUFX} +MAINTAINER= x11@FreeBSD.org +CONFLICTS?= XFree86-libraries-* xorg-libraries-6.* + +USE_BZIP2= yes +USE_GMAKE= yes +USE_LDCONFIG= yes + +MAKE_ARGS= SHELL=${SH} +CFLAGS+= -DUSE_XSHM -DHZ=100 + +PREFIX= ${X11BASE} +FILESDIR= ${.CURDIR}/../../graphics/libGL/files +WRKSRC= ${WRKDIR}/Mesa-${PORTVERSION} +CONFDIR= ${WRKSRC}/configs + +SHVER?= 1 + +.if !defined(ARCH) +ARCH!= uname -p +.endif + +.if ${ARCH} == i386 +PLIST_SUB+= I386="" +PLIST_SUB+= I386_AMD64="" +ALL_TARGET= freebsd-dri-x86 +.elif ${ARCH} == amd64 +PLIST_SUB+= I386="@comment " +PLIST_SUB+= I386_AMD64="" +ALL_TARGET= freebsd-dri-amd64 +.else +PLIST_SUB+= I386="@comment " +PLIST_SUB+= I386_AMD64="@comment " +ALL_TARGET= freebsd-dri +.endif + +pre-patch: + @${REINPLACE_CMD} \ + -e '/^CC =/d' -e '/^CXX =/d' \ + -e 's|/usr/X11R6|${X11BASE}|g' \ + -e 's|/usr/local|${LOCALBASE}|g' \ + -e 's|-lpthread|${PTHREAD_LIBS}|g' \ + -e 's|CFLAGS = |CFLAGS = ${CFLAGS} |g' \ + -e 's|OPT_FLAGS = .*|OPT_FLAGS = ${CFLAGS}|g' \ + -e "s|SRC_DIRS = .*|SRC_DIRS = ${SRCDIR}|g" \ + -e 's|-DHAVE_POSIX_MEMALIGN||' \ + ${CONFDIR}/freebsd-dri + @${REINPLACE_CMD} \ + -e 's|^\(MKDEP_OPTIONS.*\)|\1 -- -I${X11BASE}/include|' \ + -e 's|^\(MKLIB_OPTIONS.*\)|\1 -L${X11BASE}/lib|' \ + -e 's|^DRI_DRIVER_INSTALL_DIR.*|DRI_DRIVER_INSTALL_DIR = ${X11BASE}/lib/dri|' \ + ${CONFDIR}/default + +.if !target(do-install) +do-install: + ${MKDIR} ${PREFIX}/include/GL/ +.for i in ${HEADERS} + ${INSTALL_DATA} ${WRKSRC}/${HEADERSDIR}/${i} ${PREFIX}/include/GL/ +.endfor + ${INSTALL_PROGRAM} ${WRKSRC}/lib/${PORTNAME}.so.${SHVER} ${PREFIX}/lib + ${LN} -sf ${PORTNAME}.so.${SHVER} ${PREFIX}/lib/${PORTNAME}.so +.endif diff --git a/graphics/libGLU/Makefile b/graphics/libGLU/Makefile index 32fd048db7af..e808d6ac3e3e 100644 --- a/graphics/libGLU/Makefile +++ b/graphics/libGLU/Makefile @@ -6,32 +6,17 @@ # PORTNAME= libGLU -PORTVERSION= 7.0.1 +PORTVERSION= ${MESAVERSION} CATEGORIES= graphics -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= mesa3d -DISTNAME= MesaLib-${PORTVERSION} -MAINTAINER= x11@FreeBSD.org COMMENT= OpenGL utility library -CONFLICTS= XFree86-libraries-* xorg-libraries-6.* - -USE_BZIP2= yes -USE_LDCONFIG= yes USE_GL= gl +USE_XORG= xmu xi -USE_X_PREFIX= yes -WRKSRC= ${WRKDIR}/Mesa-${PORTVERSION}/src/glu/sgi - -ALL_TARGET= libGLU.so - -post-patch: - ${CP} ${FILESDIR}/config ${WRKDIR}/Mesa-${PORTVERSION}/configs/current - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/libGLU.so.1 ${PREFIX}/lib - ${LN} -sf libGLU.so.1 ${PREFIX}/lib/libGLU.so - ${INSTALL_DATA} ${WRKDIR}/Mesa-${PORTVERSION}/include/GL/glu.h ${PREFIX}/include/GL +SRCDIR= glu/sgi +HEADERS= glu.h +HEADERSDIR= include/GL +.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk" .include diff --git a/graphics/libGLU/files/config b/graphics/libGLU/files/config deleted file mode 100644 index 2d3520d90dfe..000000000000 --- a/graphics/libGLU/files/config +++ /dev/null @@ -1,31 +0,0 @@ -# Configuration for mesa-demos port for FreeBSD -# Taken from Mesa CVS mesa/Mesa/configs/freebsd Rev 1.2 -# $FreeBSD: /tmp/pcvs/ports/graphics/libGLU/files/Attic/config,v 1.1 2007-05-19 20:09:44 flz Exp $ -# - -# Set and remember $CFLAGS, $CXXFLAGS, $CC and $CXX before they are -# overriden in default include - -_CC := $(CC) -_CXX := $(CXX) -_CFLAGS := -fPIC -pedantic -I$(X11BASE)/include -DUSE_XSHM -DHZ=100 $(CFLAGS) -_CXXFLAGS := -fPIC -pedantic $(CXXFLAGS) - -include $(TOP)/configs/default - -CONFIG_NAME = FreeBSD - -# Now reset compiler and flags -CC = $(_CC) -CXX = $(_CXX) -CFLAGS = $(_CFLAGS) -CXXFLAGS = $(_CXXFLAGS) - -GLUT_CFLAGS = -fexceptions - -LIB_DIR = $(X11BASE)/lib - -GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm - -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm - diff --git a/graphics/libGLU/files/patch-glu-Makefile b/graphics/libGLU/files/patch-glu-Makefile deleted file mode 100644 index 7c8b5ea2120c..000000000000 --- a/graphics/libGLU/files/patch-glu-Makefile +++ /dev/null @@ -1,16 +0,0 @@ ---- Makefile.orig Wed Jul 12 19:43:20 2006 -+++ Makefile Tue Oct 3 00:22:56 2006 -@@ -135,10 +135,10 @@ - -mkdir $(TOP)/$(LIB_DIR) - - # Make the library: --$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) -- $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' \ -+$(GLU_LIB_NAME): $(OBJECTS) -+ ${TOP}/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' \ - -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ -- -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ -+ -cplusplus $(MKLIB_OPTIONS) \ - $(GLU_LIB_DEPS) $(OBJECTS) - - diff --git a/graphics/libGLw/Makefile b/graphics/libGLw/Makefile index 4d613a062ac3..691d6bb4a341 100644 --- a/graphics/libGLw/Makefile +++ b/graphics/libGLw/Makefile @@ -6,38 +6,22 @@ # PORTNAME= libGLw -PORTVERSION= 6.5.3 +PORTVERSION= ${MESAVERSION} CATEGORIES= graphics -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= mesa3d -DISTNAME= MesaLib-${PORTVERSION} -MAINTAINER= x11@FreeBSD.org COMMENT= OpenGL widgets library -CONFLICTS= XFree86-libraries-* xorg-libraries-6.* - +BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend LIB_DEPENDS+= Xm.3:${PORTSDIR}/x11-toolkits/open-motif -USE_BZIP2= yes -USE_LDCONFIG= yes -USE_XORG= xt USE_GL= gl +USE_XORG= xt -USE_X_PREFIX= yes -WRKSRC= ${WRKDIR}/Mesa-${PORTVERSION}/src/glw/ +CFLAGS+= -D__GLX_MOTIF=1 +SRCDIR= glw -ALL_TARGET= libGLw.so -GLWHEADERS= GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h - -post-patch: - ${CP} ${FILESDIR}/config ${WRKDIR}/Mesa-${PORTVERSION}/configs/current - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/libGLw.so.1 ${PREFIX}/lib - ${LN} -sf libGLw.so.1 ${PREFIX}/lib/libGLw.so -.for i in ${GLWHEADERS} - ${INSTALL_DATA} ${WRKDIR}/Mesa-${PORTVERSION}/src/glw/$i ${PREFIX}/include/GL -.endfor +HEADERS= GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h +HEADERSDIR= src/glw +.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk" .include diff --git a/graphics/libGLw/distinfo b/graphics/libGLw/distinfo index 127cae9262ef..e647bcdc7c92 100644 --- a/graphics/libGLw/distinfo +++ b/graphics/libGLw/distinfo @@ -1,3 +1,3 @@ -MD5 (MesaLib-6.5.3.tar.bz2) = 46359457147c469745f24b5074a186f0 -SHA256 (MesaLib-6.5.3.tar.bz2) = f8b09b40b59d6951dcd9889d19a67d1995c5f558bafa1e978f4b0e88035a96b3 -SIZE (MesaLib-6.5.3.tar.bz2) = 3351899 +MD5 (MesaLib-7.0.1.tar.bz2) = c056abd763e899114bf745c9eedbf9ad +SHA256 (MesaLib-7.0.1.tar.bz2) = 5190ffac157882d9129d31f262339512f4a45dcf95ccdad213760a7d54d82de7 +SIZE (MesaLib-7.0.1.tar.bz2) = 3343538 diff --git a/graphics/libGLw/files/config b/graphics/libGLw/files/config deleted file mode 100644 index c586636adcf0..000000000000 --- a/graphics/libGLw/files/config +++ /dev/null @@ -1,31 +0,0 @@ -# Configuration for mesa-demos port for FreeBSD -# Taken from Mesa CVS mesa/Mesa/configs/freebsd Rev 1.2 -# $FreeBSD: /tmp/pcvs/ports/graphics/libGLw/files/Attic/config,v 1.2 2007-07-30 07:49:42 pav Exp $ -# - -# Set and remember $CFLAGS, $CXXFLAGS, $CC and $CXX before they are -# overriden in default include - -_CC := $(CC) -_CXX := $(CXX) -_CFLAGS := -fPIC -pedantic -I$(X11BASE)/include -DUSE_XSHM -DHZ=100 -D__GLX_MOTIF=1 $(CFLAGS) -_CXXFLAGS := -fPIC -pedantic $(CXXFLAGS) - -include $(TOP)/configs/default - -CONFIG_NAME = FreeBSD - -# Now reset compiler and flags -CC = $(_CC) -CXX = $(_CXX) -CFLAGS = $(_CFLAGS) -CXXFLAGS = $(_CXXFLAGS) - -GLUT_CFLAGS = -fexceptions - -LIB_DIR = $(X11BASE)/lib - -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm - -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm - diff --git a/graphics/libGLw/files/patch-glw-GLwDrawA.c b/graphics/libGLw/files/patch-glw-GLwDrawA.c index 3f5db5eb769c..fac6f15b4823 100644 --- a/graphics/libGLw/files/patch-glw-GLwDrawA.c +++ b/graphics/libGLw/files/patch-glw-GLwDrawA.c @@ -1,5 +1,5 @@ ---- GLwDrawA.c.orig Tue Mar 13 21:11:41 2007 -+++ GLwDrawA.c Tue Mar 13 21:12:38 2007 +--- src/glw/GLwDrawA.c.orig Tue Mar 13 21:11:41 2007 ++++ src/glw/GLwDrawA.c Tue Mar 13 21:12:38 2007 @@ -668,7 +668,7 @@ #endif diff --git a/graphics/libGLw/files/patch-glw-Makefile b/graphics/libGLw/files/patch-glw-Makefile deleted file mode 100644 index 03f9d3687549..000000000000 --- a/graphics/libGLw/files/patch-glw-Makefile +++ /dev/null @@ -1,15 +0,0 @@ ---- Makefile.orig Thu Dec 7 19:46:44 2006 -+++ Makefile Thu Dec 7 19:47:07 2006 -@@ -37,10 +37,10 @@ - - - # Make the library --$(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS) -+$(GLW_LIB_NAME): $(OBJECTS) - $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' \ - -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \ -- $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ -+ $(MKLIB_OPTIONS) \ - $(GLW_LIB_DEPS) $(OBJECTS) - -