1 # Makefile.common - shared code between MesaLib ports.
3 # !!! Here be dragons !!! (they seem to be everywhere these days)
5 # Remember to upgrade the following ports everytime you bump MESAVERSION:
12 # - graphics/libglesv2
13 # - graphics/libosmesa
18 MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
19 MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
21 MESABASEVERSION= 11.2.2
22 # if there is a subversion, don't include the '-' between 7.11-rc2.
25 MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/older-versions/11.x/${MESABASEVERSION}/
27 DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX}
29 MAINTAINER= x11@FreeBSD.org
31 BUILD_DEPENDS+= makedepend:devel/makedepend
32 LIB_DEPENDS+= libdevq.so:devel/libdevq
34 USES+= compiler:c++11-lib bison gettext-tools gmake libtool \
35 pathfix pkgconfig python:2,build shebangfix tar:xz
38 CPPFLAGS+= -isystem${LOCALBASE}/include
39 LDFLAGS+= -Wl,-Y/usr/lib:${LOCALBASE}/lib
41 PKGINSTALL= ${.CURDIR}/pkg-install
42 PKGDEINSTALL= ${.CURDIR}/pkg-deinstall
44 # only have one port to check with portscout.
45 .if ${PORTNAME} != libGL
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
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
64 COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//}
68 CONFIGURE_ARGS+= --with-sha1=libcrypto
70 # DRI3 needs PRIME support in the kernel to work
71 CONFIGURE_ARGS+= --disable-dri3
73 CONFIGURE_ARGS+= --enable-gbm
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
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
87 # we don't care about GLes v1
88 CONFIGURE_ARGS+= --disable-gles1
90 CONFIGURE_ARGS+= --enable-gles2
93 .if ${OPSYS} == DragonFly || \
94 (${OPSYS} == FreeBSD && \
95 (${ARCH} == x86_64 || \
98 BUILD_DEPENDS+= libclc>=0.0.r222830:devel/libclc
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
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."; \
114 CONFIGURE_ARGS+= --enable-opencl \
117 CONFIGURE_ARGS+= --disable-opencl
120 CONFIGURE_ARGS+= --enable-osmesa
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}
128 CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
130 CONFIGURE_ARGS+=--enable-gallium-llvm \
133 .if ${PORT_OPTIONS:MTEXTURE}
134 CONFIGURE_ARGS+=--enable-texture-float
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
143 CONFIGURE_ARGS+=--disable-vdpau
144 PLIST_SUB+= VDPAU="@comment "
148 CONFIGURE_ARGS+=--disable-va
150 ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
151 ALL_GALLIUM_DRIVERS=R300 R600 RADEONSI SVGA SWRAST
153 .if ${ARCH} == x86_64 || ${ARCH} == i386 || ${ARCH} == ia64
154 DRI_DRIVERS= ${ALL_DRI_DRIVERS}
155 GALLIUM_DRIVERS= ${ALL_GALLIUM_DRIVERS}
158 .if ${ARCH} == powerpc || ${ARCH} == powerpc64
159 DRI_DRIVERS= RADEON SWRAST
160 GALLIUM_DRIVERS= RADEONSI SWRAST
163 .if ${ARCH} == sparc64 || ${ARCH} == armv6
165 GALLIUM_DRIVERS= SWRAST
168 # empty for unsupported arches
172 .for _d in ${ALL_DRI_DRIVERS}
173 . if ${DRI_DRIVERS:M${_d}}
174 PLIST_SUB+= ${_d}_DRIVER=""
176 PLIST_SUB+= ${_d}_DRIVER="@comment "
180 CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
182 .for _gd in ${ALL_GALLIUM_DRIVERS}
183 . if ${GALLIUM_DRIVERS:M${_gd}}
184 PLIST_SUB+= ${_gd}_GDRIVER=""
186 PLIST_SUB+= ${_gd}_GDRIVER="@comment "
190 CONFIGURE_ARGS+=--with-gallium-drivers="${GALLIUM_DRIVERS:tl}"
192 .if ${OPSYS} == DragonFly
193 LIB_DEPENDS+= libelf.so:devel/libelf