Commit de6c3348 authored by kwm's avatar kwm
Browse files

Update Mesa port to 10.6.6 and add Clover.

Add beignet 1.1.0.
Add clinfo, clblas, clfft and clrng.

The major change is that all Mesa ports are now configured the same way.
This fixes several problems and enables new features.  The details
are described in this blog post:
http://blogs.freebsdish.org/graphics/2015/03/18/unifying-mesa-ports-configure/

The second important change is the OpenCL support.  Mesa's
implementation, Clover, is enabled as well as Beignet.  Clover
targets all Gallium drivers, only Radeon GPUs in our case.  Beignet
is for Intel GPUs starting with Ivy Bridge.  Thanks to Johannes
Dieterich, O. Hartman, and Koop Mast for their work on OpenCL!  As a
bonus, there are several OpenCL-based math ports added (clblas,
clfft and clrng). For more information and known issues, please see
https://wiki.freebsd.org/Graphics/OpenCL

The third change is the removal of Mesa 9.1.7 which was installed on
FreeBSD 9.3-RELEASE.  There is now only one version of Mesa in the Ports
tree (10.6.6) for all supported versions of FreeBSD.

Other, smaller changes:

* Include libosmesa into the Mesa framework; this changes libOSMesa
  shlib version.

* bsd.mesalib.mk was renamed and split up in two files namely
  Makefile.common and Makefile.targets.  So ports can overwrite variables
  set by Makefile.common and are used by Makefile.targets.

* Some text in the pkg-descr files was wrong, clean it up.  While here,
  update the WWW to the main mesa3d.org upstream page.

* devel/clinfo was added, a glxinfo like program but for OpenCL.

Non-x86 hardware reports are very welcome since we changed the framework
quite a bit.

Obtained from:	Graphics team development repo.
parent 668ef943
......@@ -252,6 +252,7 @@
SUBDIR += cld2
SUBDIR += clewn
SUBDIR += clig
SUBDIR += clinfo
SUBDIR += clisp-hyperspec
SUBDIR += clojure-cider
SUBDIR += cloudabi-binutils
......
# Created by: Koop Mast <kwm@FreeBSD.org>
# $FreeBSD$
PORTNAME= clinfo
PORTVERSION= 2.0.15.04.28
CATEGORIES= devel
MAINTAINER= kwm@FreeBSD.org
COMMENT= OpenCL info program like glxinfo is for libGL
BUILD_DEPENDS= ${LOCALBASE}/include/CL/opencl.h:${PORTSDIR}/devel/opencl
LIB_DEPENDS= libOpenCL.so:${PORTSDIR}/devel/ocl-icd
USE_GITHUB= yes
GH_ACCOUNT= Oblomov
GH_TAGNAME= b953d226b7
USES= gmake
NO_CONFIGURE= yes
ALL_TARGET= #
PLIST_FILES= bin/clinfo \
man/man1/clinfo.1.gz
post-patch:
@${REINPLACE_CMD} -e 's|-Wall|-Wall -I${LOCALBASE}/include|g; \
s|-lOpenCL|-lOpenCL -L${LOCALBASE}/lib|g' \
${WRKSRC}/Makefile
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/clinfo ${STAGEDIR}${PREFIX}/bin/
@${INSTALL_MAN} ${WRKSRC}/man/clinfo.1 ${STAGEDIR}${PREFIX}/man/man1/
.include <bsd.port.mk>
SHA256 (Oblomov-clinfo-2.0.15.04.28-b953d226b7_GH0.tar.gz) = 547cd53e656a787bffaab7308a4ac5f6bbd9dab23aaf723a820b86ff3f8122d4
SIZE (Oblomov-clinfo-2.0.15.04.28-b953d226b7_GH0.tar.gz) = 25230
A simple OpenCL application that enumerates all possible platform and
device properties. Inspired by AMD's program of the same name, it is
coded in pure C99 and it tries to output all possible information,
including that provided by platform-specific extensions, and not to
crash on platform-unsupported properties (e.g. 1.2 properties on 1.1
platforms).
WWW: https://github.com/Oblomov/clinfo
......@@ -3,7 +3,7 @@
PORTNAME= dri
PORTVERSION= ${MESAVERSION}
PORTREVISION= ${DRIREVISION}
PORTREVISION= 0
PORTEPOCH= 2
CATEGORIES= graphics
......@@ -18,12 +18,6 @@ USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto \
OPTIONS_DEFINE= TEXTURE
OPTIONS_DEFAULT=TEXTURE
OPTIONS_DEFINE_i386= GALLIUM
OPTIONS_DEFAULT_i386= GALLIUM
OPTIONS_DEFINE_amd64= GALLIUM
OPTIONS_DEFAULT_amd64= GALLIUM
GALLIUM_DESC= Gallium (llvm backed) dri drivers
TEXTURE_DESC= Enable texture-float support (patent encumbered)
VDPAU_DESC= VDPAU (GPU video acceleration) support (needs Gallium)
......@@ -31,20 +25,13 @@ PKGHELP= ${.CURDIR}/pkg-help
.include <bsd.port.options.mk>
# gcc from base can't handle some code in mesa 9.1+
# We only care for 9.x and 8.x. clang in 10.x is new enough.
# This is for 0b0000 binary which gcc 4.3+ understands and is in the i965 driver.
. if (${OSVERSION} >= 901500 && ${OSVERSION} < 1000000)
CC=clang
CXX=clang++
CPP=clang-cpp
. elif ${OSVERSION} < 901500
USE_GCC=yes
. endif
ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
#src/mesa/libmesagallium.la
#MESA_BUILD_WRKSRC= src/util src/gallium
#MESA_INSTALL_WRKSRC= src/gallium
PLIST_SUB+= VERSION=${MESADISTVERSION}
......@@ -52,29 +39,6 @@ PLIST_SUB+= VERSION=${MESADISTVERSION}
DRI_DRIVERS= ${ALL_DRI_DRIVERS}
.endif
.if defined(WITH_NEW_MESA)
DRIREVISION= 0
PLIST= ${.CURDIR}/pkg-plist
.else
DRIREVISION= 6
PLIST= ${.CURDIR}/pkg-plist-old
.endif
.if ${PORT_OPTIONS:MGALLIUM}
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=0:${PORTSDIR}/devel/llvm${MESA_LLVM_VER}
RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=0:${PORTSDIR}/devel/llvm${MESA_LLVM_VER}
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
CONFIGURE_ARGS+=--enable-gallium-llvm \
--enable-xvmc \
--with-gallium-drivers=r300,r600,radeonsi,svga,swrast
PLIST_SUB+= GALLIUM=""
.else
CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers \
--disable-gallium-egl
PLIST_SUB+= GALLIUM="@comment "
.endif
.if ${PORT_OPTIONS:MTEXTURE}
CONFIGURE_ARGS+=--enable-texture-float
.endif
......@@ -109,9 +73,11 @@ PLIST_SUB+= ${_d}_DRIVER="@comment "
. endif
.endfor
.if !(${ARCH} == amd64 || ${ARCH} == i386)
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
post-install:
@${RM} -rf ${STAGEDIR}/etc/OpenCL
.include <bsd.port.mk>
......@@ -4,7 +4,6 @@
@comment include/EGL/eglextchromium.h
@comment include/EGL/eglmesaext.h
@comment include/EGL/eglplatform.h
include/GL/internal/dri_interface.h
@comment include/GL/gl.h
@comment include/GL/gl_mangle.h
@comment include/GL/glcorearb.h
......@@ -12,31 +11,53 @@ include/GL/internal/dri_interface.h
@comment include/GL/glx.h
@comment include/GL/glx_mangle.h
@comment include/GL/glxext.h
include/GL/internal/dri_interface.h
@comment include/GL/osmesa.h
@comment include/GL/wglext.h
@comment include/GL/wmesa.h
@comment include/GLES2/gl2.h
@comment include/GLES2/gl2ext.h
@comment include/GLES2/gl2platform.h
@comment include/GLES3/gl3.h
@comment include/GLES3/gl31.h
@comment include/GLES3/gl3ext.h
@comment include/GLES3/gl3platform.h
@comment include/KHR/khrplatform.h
@comment include/gbm.h
%%GALLIUM%%lib/dri/kms_swrast_dri.so
%%I915_DRIVER%%lib/dri/i915_dri.so
%%I965_DRIVER%%lib/dri/i965_dri.so
lib/dri/kms_swrast_dri.so
%%R200_DRIVER%%lib/dri/r200_dri.so
%%GALLIUM%%lib/dri/r300_dri.so
%%GALLIUM%%lib/dri/r600_dri.so
lib/dri/r300_dri.so
lib/dri/r600_dri.so
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
%%GALLIUM%%lib/dri/radeonsi_dri.so
lib/dri/radeonsi_dri.so
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
%%GALLIUM%%lib/dri/vmwgfx_dri.so
%%GALLIUM%%lib/libXvMCr600.so
%%GALLIUM%%lib/libXvMCr600.so.1
%%GALLIUM%%lib/libXvMCr600.so.1.0
%%GALLIUM%%lib/libXvMCr600.so.1.0.0
lib/dri/vmwgfx_dri.so
@comment lib/gallium-pipe/pipe_r300.so
@comment lib/gallium-pipe/pipe_r600.so
@comment lib/gallium-pipe/pipe_radeonsi.so
@comment lib/gallium-pipe/pipe_swrast.so
@comment lib/gallium-pipe/pipe_vmwgfx.so
@comment lib/libEGL.so
@comment lib/libEGL.so.1
@comment lib/libEGL.so.1.0.0
@comment lib/libGL.so
@comment lib/libGL.so.1
@comment lib/libGL.so.1.2.0
@comment lib/libGLESv2.so
@comment lib/libGLESv2.so.2
@comment lib/libGLESv2.so.2.0.0
@comment lib/libMesaOpenCL.so
@comment lib/libMesaOpenCL.so.1
@comment lib/libMesaOpenCL.so.1.0.0
@comment lib/libOSMesa.so
@comment lib/libOSMesa.so.8
@comment lib/libOSMesa.so.8.0.0
lib/libXvMCr600.so
lib/libXvMCr600.so.1
lib/libXvMCr600.so.1.0
lib/libXvMCr600.so.1.0.0
@comment lib/libgbm.so
@comment lib/libgbm.so.1
@comment lib/libgbm.so.1.0.0
......@@ -55,7 +76,9 @@ include/GL/internal/dri_interface.h
%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so.1
%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so.1.0
%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
@comment libdata/pkgconfig/egl.pc
libdata/pkgconfig/dri.pc
@comment libdata/pkgconfig/egl.pc
@comment libdata/pkgconfig/gbm.pc
@comment libdata/pkgconfig/gl.pc
@comment libdata/pkgconfig/glesv2.pc
@comment libdata/pkgconfig/osmesa.pc
%%I965_DRIVER%%etc/drirc
@comment include/EGL/egl.h
@comment include/EGL/eglext.h
@comment include/EGL/eglmesaext.h
@comment include/EGL/eglplatform.h
@comment include/GL/gl.h
@comment include/GL/gl_mangle.h
@comment include/GL/glext.h
@comment include/GL/glx.h
@comment include/GL/glx_mangle.h
@comment include/GL/glxext.h
include/GL/internal/dri_interface.h
@comment include/GL/osmesa.h
@comment include/GL/wglext.h
@comment include/GL/wmesa.h
@comment include/KHR/khrplatform.h
@comment include/gbm.h
%%I915_DRIVER%%lib/dri/i915_dri.so
%%I965_DRIVER%%lib/dri/i965_dri.so
%%R200_DRIVER%%lib/dri/r200_dri.so
%%GALLIUM%%lib/dri/r300_dri.so
%%GALLIUM%%lib/dri/r600_dri.so
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
%%GALLIUM%%lib/dri/radeonsi_dri.so
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
%%GALLIUM%%lib/dri/vmwgfx_dri.so
%%GALLIUM%%lib/libXvMCr300.so
%%GALLIUM%%lib/libXvMCr300.so.1
%%GALLIUM%%lib/libXvMCr300.so.1.0.0
%%GALLIUM%%lib/libXvMCr600.so
%%GALLIUM%%lib/libXvMCr600.so.1
%%GALLIUM%%lib/libXvMCr600.so.1.0.0
%%GALLIUM%%lib/libXvMCsoftpipe.so
%%GALLIUM%%lib/libXvMCsoftpipe.so.1
%%GALLIUM%%lib/libXvMCsoftpipe.so.1.0.0
@comment lib/libEGL.so
@comment lib/libEGL.so.1
@comment lib/libEGL.so.1.0.0
@comment lib/libGL.so
@comment lib/libGL.so.1
@comment lib/libGL.so.1.2.0
lib/libdricore9.1.7.so
lib/libdricore9.1.7.so.1
lib/libdricore9.1.7.so.1.0.0
@comment lib/libgbm.so
@comment lib/libgbm.so.1
@comment lib/libgbm.so.1.0.0
@comment lib/libglapi.so
@comment lib/libglapi.so.0
@comment lib/libglapi.so.0.0.0
%%GALLIUM%%lib/libllvmradeon%%VERSION%%.so
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r300.so
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r300.so.1
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r300.so.1.0.0
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r600.so
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r600.so.1
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_r600.so.1.0.0
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so.1
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_softpipe.so
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_softpipe.so.1
%%GALLIUM%%%%VDPAU%%lib/vdpau/libvdpau_softpipe.so.1.0.0
libdata/pkgconfig/dri.pc
@comment libdata/pkgconfig/egl.pc
@comment libdata/pkgconfig/gbm.pc
@comment libdata/pkgconfig/gl.pc
......@@ -3,7 +3,7 @@
PORTNAME= gbm
PORTVERSION= ${MESAVERSION}
PORTREVISION= ${GBM_REVISION}
PORTREVISION= 0
CATEGORIES= graphics
COMMENT= gbm library
......@@ -19,23 +19,12 @@ USE_XORG= x11 xau xcb xdmcp
USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \
xshmfence
BUILD_WRKSRC= ${WRKSRC}/src/gbm
INSTALL_WRKSRC= ${WRKSRC}/src/gbm
.include <bsd.port.options.mk>
.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
.if defined(WITH_NEW_MESA)
GBM_REVISION= 0
.else
GBM_REVISION= 0
.endif
pre-build:
.if defined(WITH_NEW_MESA)
@cd ${WRKSRC}/src/mapi/ && ${MAKE_CMD} ${_MAKE_JOBS}
.else
@cd ${WRKSRC}/src/mapi/shared-glapi && ${MAKE_CMD} ${_MAKE_JOBS}
.endif
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
MESA_BUILD_WRKSRC= src/mapi src/gbm
MESA_INSTALL_WRKSRC= src/gbm
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
.include <bsd.port.mk>
This package contains the EGL utility library.
This package contains the gbm utility library.
WWW: http://www.freedesktop.org/Software/xorg
WWW: http://mesa3d.org/
......@@ -3,7 +3,7 @@
PORTNAME= libEGL
PORTVERSION= ${MESAVERSION}
PORTREVISION= ${LIBEGL_REVISION}
PORTREVISION= 0
CATEGORIES= graphics
COMMENT= OpenEGL library
......@@ -11,7 +11,8 @@ COMMENT= OpenEGL library
LIB_DEPENDS+= libpthread-stubs.so:${PORTSDIR}/devel/libpthread-stubs \
libexpat.so:${PORTSDIR}/textproc/expat2 \
libdevq.so:${PORTSDIR}/devel/libdevq \
libdrm.so:${PORTSDIR}/graphics/libdrm
libdrm.so:${PORTSDIR}/graphics/libdrm \
libgbm.so:${PORTSDIR}/graphics/gbm
USE_XORG= x11 xau xcb xdmcp
......@@ -20,38 +21,12 @@ USE_XORG+= glproto dri2proto xext xdamage xfixes presentproto \
xshmfence
.include <bsd.port.options.mk>
.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
.if defined(WITH_NEW_MESA)
BUILD_WRKSRC= src/egl/drivers/dri2 src/egl/main
INSTALL_WRKSRC= src/egl/drivers/dri2 src/egl/main
.else
BUILD_WRKSRC= ${WRKSRC}/src/egl
INSTALL_WRKSRC= ${WRKSRC}/src/egl
.endif
.if defined(WITH_NEW_MESA)
LIBEGL_REVISION= 0
.else
LIBEGL_REVISION= 5
.endif
.if defined(WITH_NEW_MESA)
do-build: egl-do-build
do-install: egl-do-install
egl-do-build:
. for dir in ${BUILD_WRKSRC}
@(cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};)
. endfor
egl-do-install:
. for dir in ${INSTALL_WRKSRC}
@(cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
. endfor
.endif
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
MESA_BUILD_WRKSRC= src/mapi src/gbm src/egl/drivers/dri2 src/egl/main
MESA_INSTALL_WRKSRC= src/egl/drivers/dri2 src/egl/main
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/.mesa
......
This package contains the EGL utility library.
WWW: http://www.freedesktop.org/Software/xorg
WWW: http://mesa3d.org/
include/EGL/egl.h
include/EGL/eglext.h
%%NEW%%include/EGL/eglextchromium.h
include/EGL/eglextchromium.h
include/EGL/eglmesaext.h
include/EGL/eglplatform.h
include/KHR/khrplatform.h
......
......@@ -3,7 +3,7 @@
PORTNAME= libGL
PORTVERSION= ${MESAVERSION}
PORTREVISION= ${LIBGLREVISION}
PORTREVISION= 0
CATEGORIES= graphics
COMMENT= OpenGL library that renders using GLX or DRI
......@@ -16,21 +16,18 @@ USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto:both \
presentproto xshmfence
.include <bsd.port.options.mk>
.include "${.CURDIR}/bsd.mesalib.mk"
.include "${.CURDIR}/Makefile.common"
.if defined(WITH_NEW_MESA)
LIBGLREVISION= 0
.else
LIBGLREVISION= 4
.endif
MESA_BUILD_WRKSRC= src/mapi src/glx
MESA_INSTALL_WRKSRC= src/glx
.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
.include "${.CURDIR}/Makefile.targets"
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/.mesa
@${MV} ${STAGEDIR}${PREFIX}/lib/libGL* \
${STAGEDIR}${PREFIX}/lib/.mesa/
@cd ${WRKSRC}/src/mesa && ${SETENV} DESTDIR=${STAGEDIR} \
${MAKE_CMD} install-pkgconfigDATA install-glHEADERS
.include <bsd.port.mk>
# bsd.mesalib.mk - shared code between MesaLib ports.
# Makefile.common - shared code between MesaLib ports.
#
# !!! Here be dragons !!! (they seem to be everywhere these days)
#
......@@ -15,58 +15,37 @@
#
# $FreeBSD$
# hw context support in the i915kms driver
.if ${OPSYS} == FreeBSD && \
(${OSVERSION} >= 1000717 && ${OSVERSION} < 1100000 || \
${OSVERSION} >= 1100035)
WITH_NEW_MESA=1
.endif
.if ${OPSYS} == DragonFly && ${DFLYVERSION} >= 300901
WITH_NEW_MESA=1
.endif
MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
.if defined(WITH_NEW_MESA)
MESABASEVERSION= 10.4.6
MESABASEVERSION= 10.6.6
# if there is a subversion, don't include the '-' between 7.11-rc2.
MESASUBVERSION=
MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
PLIST_SUB+= OLD="@comment " NEW=""
# work around libarchive bug?
EXTRACT_CMD= ${LOCALBASE}/bin/gtar
EXTRACT_DEPENDS+= gtar:${PORTSDIR}/archivers/gtar
.else
MESABASEVERSION= 9.1.7
MESASUBVERSION=
MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/older-versions/${MESABASEVERSION:R:R}.x/${MESABASEVERSION}/
PLIST_SUB+= OLD="" NEW="@comment "
.endif
DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX}
DISTFILES= MesaLib-${MESADISTVERSION}${EXTRACT_SUFX}
MAINTAINER= x11@FreeBSD.org
BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend \
${PYTHON_SITELIBDIR}/libxml2.py:${PORTSDIR}/textproc/py-libxml2
BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend
LIB_DEPENDS+= libdevq.so:${PORTSDIR}/devel/libdevq
USES+= bison gettext-tools gmake libtool pathfix pkgconfig \
python:2,build shebangfix tar:bzip2
USES+= compiler:c++11-lib gettext-tools gmake libtool \
pathfix pkgconfig shebangfix tar:xz
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CPPFLAGS+= -isystem${LOCALBASE}/include
LDFLAGS+= -Wl,-Y${LOCALBASE}/lib
PKGINSTALL= ${.CURDIR}/pkg-install
PKGDEINSTALL= ${.CURDIR}/pkg-deinstall
# only have one port to check with portscout.
.if ${PORTNAME} != libGL
PORTSCOUT= ignore:1
.endif
.if ${OSVERSION} < 1000033
BUILD_DEPENDS+= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
CONFIGURE_ENV+= ac_cv_prog_LEX=${LOCALBASE}/bin/flex
......@@ -77,89 +56,66 @@ python_CMD= ${LOCALBASE}/bin/python2
SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
src/gallium/drivers/svga/svgadump/svga_dump.py \
src/glsl/tests/compare_ir src/mapi/glapi/gen/*.py
.if defined(WITH_NEW_MESA)
SHEBANG_FILES+= src/mapi/mapi_abi.py
.endif
MASTERDIR= ${.CURDIR}/../../graphics/libGL
.if defined(WITH_NEW_MESA)
PATCHDIR= ${MASTERDIR}/files
CONFIGURE_ARGS+= --disable-dri3
.else
PATCHDIR= ${MASTERDIR}/files-old
.endif
WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION}
DESCR= ${.CURDIR}/pkg-descr
PLIST= ${.CURDIR}/pkg-plist
WRKSRC= ${WRKDIR}/Mesa-${MESADISTVERSION}
INSTALL_TARGET= install-strip
COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//}
.if defined(WITH_NEW_MESA)
MESA_LLVM_VER=35
.else
MESA_LLVM_VER=33
.endif
MESA_LLVM_VER=36
# DRI3 needs PRIME support in the kernel to work
CONFIGURE_ARGS+= --disable-dri3
CONFIGURE_ARGS+= --enable-gbm
# libEGL, dri and clover need gallium enabled.
# the third option in --with-egl-platforms is wayland.
CONFIGURE_ARGS+= --enable-egl --with-egl-platforms=x11,drm
.if ${COMPONENT:Mglesv2} == ""
CONFIGURE_ARGS+= --disable-gles2
.else
CONFIGURE_ARGS+= --enable-gles2
# Clover (OpenCL).
.if ${OPSYS} == DragonFly || (${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000)
BUILD_DEPENDS+= libclc>=0.0.r222830:${PORTSDIR}/devel/libclc
# We need the clang port too even if it is not used to compile because
# Clover needs some of the clang includes to build.
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Mosmesa} != ""
BUILD_DEPENDS+= clang${MESA_LLVM_VER}>=0:${PORTSDIR}/lang/clang${MESA_LLVM_VER}
.endif
.if ${COMPONENT:Megl} == ""
CONFIGURE_ARGS+= --disable-egl
CONFIGURE_ARGS+= --enable-opencl \
--enable-opencl-icd
.else
CONFIGURE_ARGS+= --enable-egl
CONFIGURE_ARGS+= --disable-opencl
.endif
.if ${COMPONENT:Mclover} == ""
CONFIGURE_ARGS+= --disable-opencl
.else
CONFIGURE_ARGS+= --enable-opencl
CONFIGURE_ARGS+= --enable-osmesa
# gallium
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=0:${PORTSDIR}/devel/llvm${MESA_LLVM_VER}
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != ""
RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=0:${PORTSDIR}/devel/llvm${MESA_LLVM_VER}
.endif
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
.if ${COMPONENT:Mdri} == "" && ${COMPONENT:Mclover} == ""
CONFIGURE_ARGS+=--with-dri-drivers=no
CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers
.else
# done in the dri port
# need to enable this globaly because it also used in dri ..
# the third possible option is wayland.
CONFIGURE_ARGS+= --enable-egl --with-egl-platforms=x11,drm
CONFIGURE_ARGS+=--enable-gallium-llvm \
--enable-xvmc \
--with-gallium-drivers=r300,r600,radeonsi,svga,swrast
.if !(${ARCH} == amd64 || ${ARCH} == i386)
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
# what to do with this one? Currently disabled in dri.
.if ${COMPONENT:Mvdpau} == ""
CONFIGURE_ARGS+=--disable-vdpau
.else
CONFIGURE_ARGS+=--enable-vdpau
.endif
post-patch:
@${REINPLACE_CMD} -e 's|-ffast-math|${FAST_MATH}|' -e 's|x86_64|amd64|' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c