1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00
freebsd-ports/graphics/libGL/bsd.mesalib.mk

92 lines
2.2 KiB
Makefile

#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
#
# bsd.mesa.mk - an attempt to refactor MesaLib ports.
#
# Created by: Florent Thoumie <flz@FreeBSD.org>
#
# !!! 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.3
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
USE_BZIP2= yes
USE_GMAKE= yes
USE_LDCONFIG= yes
MAKE_ARGS= SHELL=${SH}
CFLAGS+= -DUSE_XSHM -DHZ=100
PREFIX= ${LOCALBASE}
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
.if ${ARCH} == alpha
FAST_MATH=
.else
FAST_MATH= -ffast-math
.endif
pre-patch:
@${REINPLACE_CMD} \
-e '/^CC =/d' -e '/^CXX =/d' \
-e 's|/usr/X11R6|${LOCALBASE}|g' \
-e 's|/usr/local|${LOCALBASE}|g' \
-e 's|-lpthread|${PTHREAD_LIBS}|g' \
-e 's|-ffast-math|${FAST_MATH}|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${LOCALBASE}/include|' \
-e 's|^\(MKLIB_OPTIONS.*\)|\1 -L${LOCALBASE}/lib|' \
-e 's|^DRI_DRIVER_INSTALL_DIR.*|DRI_DRIVER_INSTALL_DIR = ${LOCALBASE}/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