Update x11-drivers/xf86-input-wacom to version 0.34.0_1
[dports.git] / graphics / libGL / Makefile.common
1 # Makefile.common - shared code between MesaLib ports.
2 #
3 # !!! Here be dragons !!! (they seem to be everywhere these days)
4 #
5 # Remember to upgrade the following ports everytime you bump MESAVERSION:
6 #
7 #    - graphics/dri
8 #    - graphics/gbm
9 #    - graphics/libEGL
10 #    - graphics/libGL
11 #    - graphics/libglapi
12 #    - graphics/libglesv2
13 #    - graphics/libosmesa
14 #    - lang/clover
15 #
16 # $FreeBSD$
17
18 MESAVERSION=    ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
19 MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
20
21 MESABASEVERSION=        11.2.2
22 # if there is a subversion, don't include the '-' between 7.11-rc2.
23 MESASUBVERSION=
24
25 MASTER_SITES=   ftp://ftp.freedesktop.org/pub/mesa/older-versions/11.x/${MESABASEVERSION}/
26
27 DISTFILES=      mesa-${MESADISTVERSION}${EXTRACT_SUFX}
28
29 MAINTAINER=     x11@FreeBSD.org
30
31 BUILD_DEPENDS+= makedepend:devel/makedepend
32 LIB_DEPENDS+=   libdevq.so:devel/libdevq
33
34 USES+=          compiler:c++11-lib bison gettext-tools gmake libtool \
35                 pathfix pkgconfig python:2,build shebangfix tar:xz
36 USE_LDCONFIG=   yes
37 GNU_CONFIGURE=  yes
38 CPPFLAGS+=      -isystem${LOCALBASE}/include
39 LDFLAGS+=       -Wl,-Y/usr/lib:${LOCALBASE}/lib
40
41 PKGINSTALL=     ${.CURDIR}/pkg-install
42 PKGDEINSTALL=   ${.CURDIR}/pkg-deinstall
43
44 # only have one port to check with portscout.
45 .if ${PORTNAME} != libGL
46 PORTSCOUT=      ignore:1
47 .endif
48
49 python_OLD_CMD= "/usr/bin/env[[:space:]]python"
50 python_CMD=     ${LOCALBASE}/bin/python2
51 SHEBANG_FILES=  src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
52                 src/gallium/drivers/svga/svgadump/svga_dump.py \
53                 src/mapi/glapi/gen/*.py
54 SHEBANG_FILES+= src/mapi/mapi_abi.py
55
56 MASTERDIR=              ${.CURDIR}/../../graphics/libGL
57 PATCHDIR=               ${MASTERDIR}/files
58 DFLY_PATCHDIR=          ${MASTERDIR}/dragonfly
59 WRKSRC=                 ${WRKDIR}/mesa-${MESADISTVERSION}
60 DESCR=                  ${.CURDIR}/pkg-descr
61 PLIST=                  ${.CURDIR}/pkg-plist
62 INSTALL_TARGET=         install-strip
63
64 COMPONENT=              ${PORTNAME:tl:C/^lib//:C/mesa-//}
65
66 MESA_LLVM_VER=37
67
68 CONFIGURE_ARGS+=        --with-sha1=libcrypto
69
70 # DRI3 needs PRIME support in the kernel to work
71 CONFIGURE_ARGS+=        --disable-dri3
72
73 CONFIGURE_ARGS+=        --enable-gbm
74
75 # There are issues that need to be fixed to use TLS model "initial-exec"
76 # So stick with "global-dynamic"'s model for now. kan@ is working on a
77 # patch for rtld. We might want to backport global-dynamic or
78 # pthread_setspecific which it uses now by default. But since this
79 # configure switch is going away ...
80 # https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
81 #CONFIGURE_ARGS+=       --enable-glx-tls
82
83 # libEGL, dri and clover need gallium enabled.
84 # the third option in --with-egl-platforms is wayland.
85 CONFIGURE_ARGS+=        --enable-egl --with-egl-platforms=x11,drm
86
87 # we don't care about GLes v1
88 CONFIGURE_ARGS+=        --disable-gles1
89
90 CONFIGURE_ARGS+=        --enable-gles2
91
92 # Clover (OpenCL).
93 .if ${OPSYS} == DragonFly || \
94         (${OPSYS} == FreeBSD && \
95                 (${ARCH} == x86_64 || \
96                 ${ARCH} == i386))
97
98 BUILD_DEPENDS+= libclc>=0.0.r222830:devel/libclc
99
100 # We need the clang port too even if it is not used to compile because
101 # Clover needs some of the clang includes to build.
102 .if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Mosmesa} != ""
103 _USES_pre_configure+=   290:clover-pre-configure
104
105 # .if !exists() evaluates too early before cairo has a chance to be installed
106 clover-pre-configure:
107         @if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \
108                 ! [ -e ${LOCALBASE}/bin/clang${MESA_LLVM_VER} ]; then \
109                 ${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not build with clang support, which is required."; \
110                 ${FALSE}; \
111         fi
112 .endif
113
114 CONFIGURE_ARGS+=        --enable-opencl \
115                         --enable-opencl-icd
116 .else
117 CONFIGURE_ARGS+=        --disable-opencl
118 .endif
119
120 CONFIGURE_ARGS+=        --enable-osmesa
121
122 # gallium
123 BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.7.1_1:devel/llvm${MESA_LLVM_VER}
124 .if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != ""
125 RUN_DEPENDS+=   llvm${MESA_LLVM_VER}>=3.7.1_1:devel/llvm${MESA_LLVM_VER}
126 .endif
127
128 CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
129
130 CONFIGURE_ARGS+=--enable-gallium-llvm \
131                 --enable-xvmc
132
133 .if ${PORT_OPTIONS:MTEXTURE}
134 CONFIGURE_ARGS+=--enable-texture-float
135 .endif
136
137 # only support on DragonFly. FreeBSD's drm doesn't support it.
138 .if ${OPSYS} == DragonFly && ${COMPONENT:Mdri} != ""
139 CONFIGURE_ARGS+=--enable-vdpau
140 LIB_DEPENDS+=   libvdpau.so:multimedia/libvdpau
141 PLIST_SUB+=     VDPAU=""
142 .else
143 CONFIGURE_ARGS+=--disable-vdpau
144 PLIST_SUB+=     VDPAU="@comment "
145 .endif
146
147 # VAAPI support?
148 CONFIGURE_ARGS+=--disable-va
149
150 ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
151 ALL_GALLIUM_DRIVERS=R300 R600 RADEONSI SVGA SWRAST
152
153 .if ${ARCH} == x86_64 || ${ARCH} == i386 || ${ARCH} == ia64
154 DRI_DRIVERS=    ${ALL_DRI_DRIVERS}
155 GALLIUM_DRIVERS=        ${ALL_GALLIUM_DRIVERS}
156 .endif
157
158 .if ${ARCH} == powerpc || ${ARCH} == powerpc64
159 DRI_DRIVERS=    RADEON SWRAST
160 GALLIUM_DRIVERS=        RADEONSI SWRAST
161 .endif
162
163 .if ${ARCH} == sparc64 || ${ARCH} == armv6
164 DRI_DRIVERS=    SWRAST
165 GALLIUM_DRIVERS=        SWRAST
166 .endif
167
168 # empty for unsupported arches
169 DRI_DRIVERS+=
170 GALLIUM_DRIVERS+=
171
172 .for _d in ${ALL_DRI_DRIVERS}
173 . if ${DRI_DRIVERS:M${_d}}
174 PLIST_SUB+=     ${_d}_DRIVER=""
175 . else
176 PLIST_SUB+=     ${_d}_DRIVER="@comment "
177 . endif
178 .endfor
179
180 CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
181
182 .for _gd in ${ALL_GALLIUM_DRIVERS}
183 . if ${GALLIUM_DRIVERS:M${_gd}}
184 PLIST_SUB+=     ${_gd}_GDRIVER=""
185 . else
186 PLIST_SUB+=     ${_gd}_GDRIVER="@comment "
187 . endif
188 .endfor
189
190 CONFIGURE_ARGS+=--with-gallium-drivers="${GALLIUM_DRIVERS:tl}"
191
192 .if ${OPSYS} == DragonFly
193 LIB_DEPENDS+= libelf.so:devel/libelf
194 .endif
195