aboutsummaryrefslogtreecommitdiff
path: root/graphics/mesa-dri/Makefile.common
blob: e78e90e59f1257b36daad19b2896427fc39acba9 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Makefile.common - shared code between MesaLib ports.
#
# !!! Here be dragons !!! (they seem to be everywhere these days)
#
# Remember to upgrade the following ports everytime you bump MESAVERSION:
#
#    - graphics/libosmesa
#    - graphics/mesa-dri
#    - graphics/mesa-libs
#    - lang/clover
#
# $FreeBSD$

MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}

MESABASEVERSION=	17.1.7
# if there is a subversion, don't include the '-' between 7.11-rc2.
MESASUBVERSION=

MASTER_SITES=	https://mesa.freedesktop.org/archive/ \
		https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
		ftp://ftp.freedesktop.org/pub/mesa/ \
		ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/

DISTFILES=	mesa-${MESADISTVERSION}${EXTRACT_SUFX}

MAINTAINER=	x11@FreeBSD.org

COMPONENT=	${PORTNAME:tl:C/^lib//:C/mesa-//}

BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
LIB_DEPENDS+=	libexpat.so:textproc/expat2
.if ${COMPONENT} != osmesa
LIB_DEPENDS+=	libdrm.so:graphics/libdrm
.endif
.if ${COMPONENT} != libs
LIB_DEPENDS+=	libglapi.so:graphics/mesa-libs
.endif
.if ${ARCH} == amd64 || ${ARCH} == i386
LIB_DEPENDS+=	libunwind.so:devel/libunwind
.endif
.if ${OPSYS} == DragonFly
LIB_DEPENDS+=	libelf.so:devel/libelf
.endif

USES+=		compiler:c++11-lib bison gettext-tools gmake libtool \
		localbase pathfix pkgconfig python:2,build shebangfix tar:xz
USE_LDCONFIG=	yes
GNU_CONFIGURE=	yes

# only have one port to check with portscout.
.if ${PORTNAME} != mesa-dri
PORTSCOUT=	ignore:1
.endif

python_OLD_CMD=	/usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python
SHEBANG_FILES=	src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
		src/gallium/drivers/svga/svgadump/svga_dump.py \
		src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \
		src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \
		src/mesa/main/get_*.py src/util/format_srgb.py \
		src/amd/*/*.py src/intel/genxml/gen_pack_header.py

MASTERDIR=	${.CURDIR:H:H}/graphics/mesa-dri
PATCHDIR=	${MASTERDIR}/files
WRKSRC=		${WRKDIR}/mesa-${MESADISTVERSION}
DESCR=		${.CURDIR}/pkg-descr
PLIST=		${.CURDIR}/pkg-plist
PKGHELP=	${.CURDIR}/pkg-help
PKGINSTALL=	${.CURDIR}/pkg-install
PKGDEINSTALL=	${.CURDIR}/pkg-deinstall
INSTALL_TARGET=	install-strip

.include <bsd.port.pre.mk>

# need LLVM for libEGL wherever possible, but mixing GCC and LLVM breaks Gallium
.if ${CHOSEN_COMPILER_TYPE} == clang \
 || (${COMPONENT} == libs && ${ARCH} != sparc64)	# no working LLVM
MESA_LLVM_VER?=	40
.endif

.if "${MESA_LLVM_VER}" != ""
BUILD_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
.if ${COMPONENT} != libs
RUN_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
.endif
CONFIGURE_ENV+=	LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib
CONFIGURE_ARGS+=	--enable-llvm
.else
CONFIGURE_ARGS+=	--disable-llvm
.endif

# There are issues that need to be fixed to use TLS model "initial-exec"
# So stick with "global-dynamic"'s model for now. kan@ is working on a
# patch for rtld. We might want to backport global-dynamic or
# pthread_setspecific which it uses now by default. But since this
# configure switch is going away ...
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
CONFIGURE_ARGS+=	--disable-glx-tls

# we don't care about GLes v1
CONFIGURE_ARGS+=	--disable-gles1