aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/libGL/bsd.mesalib.mk
blob: 78245755aa90df4f238f8f3f792fc1992b275d82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#-*- 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