aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Makefile2
-rw-r--r--graphics/cairo/Makefile2
-rw-r--r--graphics/dri/Makefile112
-rw-r--r--graphics/dri/pkg-plist19
-rw-r--r--graphics/libEGL/Makefile30
-rw-r--r--graphics/libEGL/pkg-descr3
-rw-r--r--graphics/libEGL/pkg-plist11
-rw-r--r--graphics/libGL/Makefile30
-rw-r--r--graphics/libGL/bsd.mesalib.mk117
-rw-r--r--graphics/libGL/distinfo4
-rw-r--r--graphics/libGL/files-old/patch-configure (renamed from graphics/libGL/files/extra-configure-old)0
-rw-r--r--graphics/libGL/files-old/patch-mach64_context.h (renamed from graphics/libGL/files/extra-mach64_context.h-old)0
-rw-r--r--graphics/libGL/files-old/patch-src__mesa__x86-64__glapi_x86-64.S (renamed from graphics/libGL/files/extra-src__mesa__x86-64__glapi_x86-64.S)0
-rw-r--r--graphics/libGL/files-old/patch-src__mesa__x86-64__xform4.S (renamed from graphics/libGL/files/extra-src__mesa__x86-64__xform4.S)0
-rw-r--r--graphics/libGL/files-old/patch-src__mesa__x86__glapi_x86.S (renamed from graphics/libGL/files/extra-src__mesa__x86__glapi_x86.S)0
-rw-r--r--graphics/libGL/files-old/patch-src__mesa__x86__read_rgba_span_x86.S (renamed from graphics/libGL/files/extra-src__mesa__x86__read_rgba_span_x86.S)0
-rw-r--r--graphics/libGL/files-old/patch-src_glx_x11_XF86dri.c (renamed from graphics/libGL/files/extra-src_glx_x11_XF86dri.c)0
-rw-r--r--graphics/libGL/files-old/patch-src_mesa_Makefile (renamed from graphics/libGL/files/patch-src_mesa_Makefile)6
-rw-r--r--graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c99
-rw-r--r--graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c91
-rw-r--r--graphics/libGL/files/extra-src_glx_XF86dri.c38
-rw-r--r--graphics/libGL/files/patch-configure (renamed from graphics/libGL/files/extra-configure)17
-rw-r--r--graphics/libGL/files/patch-src-glsl_ir_constant_expression.cpp (renamed from graphics/libGL/files/extra-src-glsl_ir_constant_expression.cpp)0
-rw-r--r--graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h (renamed from graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h)0
-rw-r--r--graphics/libGL/files/patch-src_egl_main_Makefile.in19
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_r300_r300-chipset.c26
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_r600_r600-asm.c15
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_r600_r600-shader.c15
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_r600_r600_state_common.c15
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_radeon_radeon-llvm-emit.cpp28
-rw-r--r--graphics/libGL/files/patch-src_gallium_drivers_radeonsi_r600-buffer.c16
-rw-r--r--graphics/libGL/files/patch-src_gallium_winsys_svga_drm_vmw-screen-ioctl.c18
-rw-r--r--graphics/libGL/files/patch-src_glx_Makefile.in59
-rw-r--r--graphics/libGL/files/patch-src_mapi_es2api_Makefile.in20
-rw-r--r--graphics/libGL/files/patch-src_mapi_glapi_gen_gl-gentable.py11
-rw-r--r--graphics/libGL/files/patch-src_mapi_shared-glapi_Makefile.in20
-rw-r--r--graphics/libGL/files/patch-src_mesa_drivers_dri_common_Makefile.in17
-rw-r--r--graphics/libGL/files/patch-src_mesa_drivers_dri_common_xmlpool_Makefile.in11
-rw-r--r--graphics/libGL/files/patch-src_mesa_libdricore_Makefile.in19
-rw-r--r--graphics/libGL/files/patch-src_mesa_main_compiler.h12
-rw-r--r--graphics/libGL/pkg-plist3
-rw-r--r--graphics/libGLw/Makefile2
-rw-r--r--graphics/libdrm/Makefile31
-rw-r--r--graphics/libdrm/pkg-plist13
-rw-r--r--graphics/libglesv2/Makefile29
-rw-r--r--graphics/libglesv2/pkg-descr3
-rw-r--r--graphics/libglesv2/pkg-plist12
-rw-r--r--graphics/libreatlas/Makefile5
48 files changed, 650 insertions, 350 deletions
diff --git a/graphics/Makefile b/graphics/Makefile
index bf4dd9b77aff..dde21120b2bd 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -484,6 +484,7 @@
SUBDIR += leptonica
SUBDIR += lfview
SUBDIR += lib3ds
+ SUBDIR += libEGL
SUBDIR += libGL
SUBDIR += libGLU
SUBDIR += libGLw
@@ -505,6 +506,7 @@
SUBDIR += libgeotiff
SUBDIR += libgfx
SUBDIR += libggi
+ SUBDIR += libglesv2
SUBDIR += libgltext
SUBDIR += libgnomecanvas
SUBDIR += libgnomecanvas-reference
diff --git a/graphics/cairo/Makefile b/graphics/cairo/Makefile
index 43e6b7a37315..5470183de2bf 100644
--- a/graphics/cairo/Makefile
+++ b/graphics/cairo/Makefile
@@ -4,7 +4,7 @@
PORTNAME= cairo
PORTVERSION= 1.10.2
-PORTREVISION= 5
+PORTREVISION= 6
PORTEPOCH?= 2
CATEGORIES= graphics
MASTER_SITES= http://cairographics.org/releases/
diff --git a/graphics/dri/Makefile b/graphics/dri/Makefile
index 875907c1cc31..c3b67b99447d 100644
--- a/graphics/dri/Makefile
+++ b/graphics/dri/Makefile
@@ -9,72 +9,108 @@ CATEGORIES= graphics
COMMENT= OpenGL hardware acceleration drivers for the DRI
-LIB_DEPENDS= drm:${PORTSDIR}/graphics/libdrm \
- expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS= libdrm.so:${PORTSDIR}/graphics/libdrm \
+ libexpat.so:${PORTSDIR}/textproc/expat2
USES= pkgconfig
USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto
+.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, not for old pre-clang default current.
+# This is for 0b0000 binary which gcc 4.3+ understands and is in the i965 driver.
+.if defined(WITH_NEW_XORG)
+. if ${OSVERSION} >= 901000 && ${OSVERSION} < 902502 \
+ && (${ARCH} == i386 || ${ARCH} == amd64)
+CC=clang
+CXX=clang++
+CPP=clang-cpp
+. elif ${OSVERSION} < 901500
+USE_GCC=yes
+. endif
+.endif
+
+.if ${ARCH} == ia64
+#BROKEN= does not install on ia64
+.endif
+
ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
-.if ! defined(WITH_NEW_XORG)
+.if !defined(WITH_NEW_XORG)
ALL_DRI_DRIVERS+=I810 MACH64 MGA R128 R300 R600 SAVAGE SIS TDFX UNICHROME
.endif
NO_STAGE= yes
.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
-OPTIONS_DEFINE_i386= ${ALL_DRI_DRIVERS}
-OPTIONS_DEFINE_amd64= ${OPTIONS_DEFINE_i386}
+PLIST_SUB+= VERSION=${MESADISTVERSION}
-.if defined(WITH_NEW_XORG)
-OPTIONS_DEFINE_powerpc= RADEON SWRAST
-OPTIONS_DEFINE_sparc64= RADEON SWRAST
-.else
-OPTIONS_DEFINE_powerpc= MACH64 RADEON SWRAST TDFX
-OPTIONS_DEFINE_sparc64= MACH64 RADEON SWRAST
+.if ${ARCH} == amd64 || ${ARCH} == i386
+DRI_DRIVERS= ${ALL_DRI_DRIVERS}
.endif
-OPTIONS_DEFAULT=${OPTIONS_DEFINE}
-
-I810_DESC= Include DRI support for Intel i810
-I915_DESC= Include DRI support for Intel i915
-I965_DESC= Include DRI support for Intel i965
-MACH64_DESC= Include DRI support for AMD/ATI Mach64
-MGA_DESC= Include DRI support for Matrox
-R128_DESC= Include DRI support for AMD/ATI R128
-R200_DESC= Include DRI support for AMD/ATI R200
-R300_DESC= Include DRI support for AMD/ATI R300
-R600_DESC= Include DRI support for AMD/ATI R600
-RADEON_DESC= Include DRI support for AMD/ATI RADEON
-SAVAGE_DESC= Include DRI support for S3/Via Savage
-SIS_DESC= Include DRI support for SiS 300 and 6326
-SWRAST_DESC= Include generic software DRI support
-TDFX_DESC= Include DRI support for 3dfx Voodoo
-UNICHROME_DESC= Include DRI support for S3/Via Unichrome
-
-.include <bsd.port.options.mk>
+.if defined(WITH_NEW_XORG)
+. if defined(WITH_GALLIUM) && (${ARCH} == i386 || ${ARCH} == amd64)
+BUILD_DEPENDS+= llvm-config33:${PORTSDIR}/devel/llvm33
+RUN_DEPENDS+= llvm-config33:${PORTSDIR}/devel/llvm33
+CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config33
+
+CONFIGURE_ARGS+=--enable-gallium-llvm --disable-gallium-egl
+
+CONFIGURE_ARGS+=--with-gallium-drivers=r300,r600,radeonsi,svga,swrast
+PLIST_SUB+= GALLIUM=""
+. else
+CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers
+PLIST_SUB+= GALLIUM="@comment "
+. endif
+. if ${ARCH} == powerpc || ${ARCH} == ia64
+DRI_DRIVERS= RADEON SWRAST
+. endif
+. if ${ARCH} == sparc64
+DRI_DRIVERS= SWRAST
+. endif
+.else # !defined(WITH_NEW_XORG)
+. if ${ARCH} == powerpc
+DRI_DRIVERS= MACH64 RADEON SWRAST TDFX
+. elif ${ARCH} == sparc64
+DRI_DRIVERS= MACH64 RADEON SWRAST
+. endif
+.endif # defined(WITH_NEW_XORG)
-DRI_DRIVERS=
.for _d in ${ALL_DRI_DRIVERS}
-.if ${PORT_OPTIONS:M${_d}}
-DRI_DRIVERS+= ${_d}
+.if ${DRI_DRIVERS:M${_d}}
PLIST_SUB+= ${_d}_DRIVER=""
.else
PLIST_SUB+= ${_d}_DRIVER="@comment "
.endif
.endfor
-.if ${ARCH} == "ia64"
-BROKEN= does not install on ia64
-.endif
-
-.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
+.if !(${ARCH} == amd64 || ${ARCH} == i386)
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:L}"
+.if defined(WITH_NEW_XORG) && !defined(WITH_GALLIUM) \
+ && (${ARCH} == i386 || ${ARCH} == amd64)
+pre-everything::
+ @${ECHO_MSG} ""
+ @${ECHO_MSG} "For r300, r600, radeonsi and swrast gallium based drivers."
+ @${ECHO_MSG} "Please define WITH_GALLIUM in /etc/make.conf"
+ @${ECHO_MSG} "Note that gallium support is highly experimental."
+ @${ECHO_MSG} ""
+.endif
+
do-install:
+.if !defined(WITH_NEW_XORG)
cd ${WRKSRC}/src/mesa; ${GMAKE} install-dri
+.else
+ cd ${WRKSRC}/src/mesa/libdricore; ${GMAKE} install
+ cd ${WRKSRC}/src/mesa/drivers/dri; ${GMAKE} install
+. if defined(WITH_GALLIUM) && (${ARCH} == i386 || ${ARCH} == amd64)
+ cd ${WRKSRC}/src/gallium/drivers/radeon; ${GMAKE} install
+ cd ${WRKSRC}/src/gallium/targets; ${GMAKE} install
+. endif
+.endif
.include <bsd.port.mk>
diff --git a/graphics/dri/pkg-plist b/graphics/dri/pkg-plist
index 43e5ab1a8ade..d80890bb33d4 100644
--- a/graphics/dri/pkg-plist
+++ b/graphics/dri/pkg-plist
@@ -1,19 +1,38 @@
+%%NEW%%%%I965_DRIVER%%etc/drirc
include/GL/internal/dri_interface.h
%%OLD%%%%I810_DRIVER%%lib/dri/i810_dri.so
+%%NEW%%%%I915_DRIVER%%lib/dri/i915_dri.la
%%I915_DRIVER%%lib/dri/i915_dri.so
+%%NEW%%%%I965_DRIVER%%lib/dri/i965_dri.la
%%I965_DRIVER%%lib/dri/i965_dri.so
%%OLD%%%%MACH64_DRIVER%%lib/dri/mach64_dri.so
%%OLD%%%%MGA_DRIVER%%lib/dri/mga_dri.so
%%OLD%%%%R128_DRIVER%%lib/dri/r128_dri.so
+%%NEW%%%%R200_DRIVER%%lib/dri/r200_dri.la
%%R200_DRIVER%%lib/dri/r200_dri.so
%%OLD%%%%R300_DRIVER%%lib/dri/r300_dri.so
+%%NEW%%%%GALLIUM%%lib/dri/r300_dri.la
+%%NEW%%%%GALLIUM%%lib/dri/r300_dri.so
%%OLD%%%%R600_DRIVER%%lib/dri/r600_dri.so
+%%NEW%%%%GALLIUM%%lib/dri/r600_dri.la
+%%NEW%%%%GALLIUM%%lib/dri/r600_dri.so
+%%NEW%%%%RADEON_DRIVER%%lib/dri/radeon_dri.la
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
+%%NEW%%%%GALLIUM%%lib/dri/radeonsi_dri.la
+%%NEW%%%%GALLIUM%%lib/dri/radeonsi_dri.so
%%OLD%%%%SAVAGE_DRIVER%%lib/dri/savage_dri.so
%%OLD%%%%SIS_DRIVER%%lib/dri/sis_dri.so
+%%NEW%%%%SWRAST_DRIVER%%lib/dri/swrast_dri.la
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
%%OLD%%%%TDFX_DRIVER%%lib/dri/tdfx_dri.so
%%OLD%%%%UNICHROME_DRIVER%%lib/dri/unichrome_dri.so
+%%NEW%%%%GALLIUM%%lib/dri/vmwgfx_dri.la
+%%NEW%%%%GALLIUM%%lib/dri/vmwgfx_dri.so
+%%NEW%%lib/libdricore%%VERSION%%.la
+%%NEW%%lib/libdricore%%VERSION%%.so
+%%NEW%%lib/libdricore%%VERSION%%.so.1
+%%NEW%%%%GALLIUM%%lib/libllvmradeon%%VERSION%%.la
+%%NEW%%%%GALLIUM%%lib/libllvmradeon%%VERSION%%.so
libdata/pkgconfig/dri.pc
@dirrm lib/dri
@dirrmtry include/GL/internal
diff --git a/graphics/libEGL/Makefile b/graphics/libEGL/Makefile
new file mode 100644
index 000000000000..2e023af81038
--- /dev/null
+++ b/graphics/libEGL/Makefile
@@ -0,0 +1,30 @@
+# Created by: kwm@FreeBSD.org
+# $FreeBSD$
+
+PORTNAME= libEGL
+PORTVERSION= ${MESAVERSION}
+CATEGORIES= graphics
+
+COMMENT= OpenEGL library
+
+LIB_DEPENDS+= libpthread-stubs.so:${PORTSDIR}/devel/libpthread-stubs
+
+.if ! defined(WITH_NEW_XORG)
+IGNORE= Please enable WITH_NEW_XORG, libEGL needs libdrm higher then 2.4.24
+.endif
+
+USE_XORG= x11 xau xcb xdmcp
+
+# stuff not needed by libEGL but configure wants it
+USE_XORG+= glproto dri2proto xext xdamage xfixes
+LIB_DEPENDS+= libexpat.so:${PORTSDIR}/textproc/expat2 \
+ libdrm.so:${PORTSDIR}/graphics/libdrm
+
+BUILD_WKRSRC= ${WRKSRC}/src/egl
+INSTALL_WRKSRC= ${WRKSRC}/src/egl
+
+WITH_NEW_XORG= yes
+
+.include <bsd.port.options.mk>
+.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
+.include <bsd.port.mk>
diff --git a/graphics/libEGL/pkg-descr b/graphics/libEGL/pkg-descr
new file mode 100644
index 000000000000..f0ed995240bf
--- /dev/null
+++ b/graphics/libEGL/pkg-descr
@@ -0,0 +1,3 @@
+This package contains the EGL utility library.
+
+WWW: http://www.freedesktop.org/Software/xorg
diff --git a/graphics/libEGL/pkg-plist b/graphics/libEGL/pkg-plist
new file mode 100644
index 000000000000..538d2db43ed8
--- /dev/null
+++ b/graphics/libEGL/pkg-plist
@@ -0,0 +1,11 @@
+include/EGL/egl.h
+include/EGL/eglext.h
+include/EGL/eglmesaext.h
+include/EGL/eglplatform.h
+include/KHR/khrplatform.h
+lib/libEGL.la
+lib/libEGL.so
+lib/libEGL.so.1
+libdata/pkgconfig/egl.pc
+@dirrmtry include/KHR
+@dirrmtry include/EGL
diff --git a/graphics/libGL/Makefile b/graphics/libGL/Makefile
index 110fdcfa728b..3d91cddef0b8 100644
--- a/graphics/libGL/Makefile
+++ b/graphics/libGL/Makefile
@@ -3,14 +3,13 @@
PORTNAME= libGL
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 4
+PORTREVISION= ${LIBGLREVISION}
CATEGORIES= graphics
-MAINTAINER= x11@FreeBSD.org
COMMENT= OpenGL library that renders using GLX or DRI
-LIB_DEPENDS+= drm:${PORTSDIR}/graphics/libdrm \
- expat:${PORTSDIR}/textproc/expat2
+LIB_DEPENDS+= libdrm.so:${PORTSDIR}/graphics/libdrm \
+ libexpat.so:${PORTSDIR}/textproc/expat2
USES= pkgconfig
USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto:both
@@ -18,19 +17,36 @@ USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto:both
SUB_FILES= pkg-install pkg-deinstall
NO_STAGE= yes
+.include <bsd.port.options.mk>
+
+.if defined(WITH_NEW_XORG)
+LIBGLREVISION= 0
+.else
+LIBGLREVISION= 4
+.endif
+
do-install:
+.if ! defined(WITH_NEW_XORG)
${RM} -f ${WRKSRC}/include/GL/glu*.h
+ @${MKDIR} ${PREFIX}/lib/.libGL
cd ${WRKSRC}/src/mesa; ${GMAKE} install-libgl
+.else
+ cd ${WRKSRC}/src/mesa; ${GMAKE} install-pkgconfigDATA
+ cd ${WRKSRC}/src/glx; ${GMAKE} install
+ ${MKDIR} ${PREFIX}/include/GL
+ cd ${WRKSRC}/include/GL && ${COPYTREE_SHARE} \*.h ${PREFIX}/include/GL/
+ @${MKDIR} ${PREFIX}/lib/.libGL
+ ${INSTALL_LIB} ${WRKSRC}/src/glx/.libs/libGL.so ${PREFIX}/lib/.libGL/
+ ${INSTALL_LIB} ${WRKSRC}/src/glx/.libs/libGL.so.1 ${PREFIX}/lib/.libGL/
+.endif
post-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include "${.CURDIR}/bsd.mesalib.mk"
-.include <bsd.port.pre.mk>
-
.if !(${ARCH} == "amd64" || ${ARCH} == "i386")
CONFIGURE_ARGS+=--disable-gallium-intel
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/graphics/libGL/bsd.mesalib.mk b/graphics/libGL/bsd.mesalib.mk
index c79cfdb54dcf..6ae5ab7cd95b 100644
--- a/graphics/libGL/bsd.mesalib.mk
+++ b/graphics/libGL/bsd.mesalib.mk
@@ -1,16 +1,12 @@
-#-*- mode: Fundamental; tab-width: 4; -*-
-# ex:ts=4
-#
-# bsd.mesa.mk - an attempt to refactor MesaLib ports.
-#
-# Created by: Florent Thoumie <flz@FreeBSD.org>
+# bsd.mesalib.mk - 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/libEGL
# - graphics/libGL
-# - graphics/libGLU
+# - grahpics/libglesv2
# - graphics/dri
#
# $FreeBSD$
@@ -21,7 +17,7 @@ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
.if defined(WITH_NEW_XORG)
-MESABASEVERSION= 8.0.5
+MESABASEVERSION= 9.1.6
# if there is a subversion, include the '-' between 7.11-rc2 for example.
MESASUBVERSION=
PLIST_SUB+= OLD="@comment " NEW=""
@@ -35,64 +31,80 @@ MASTER_SITES= ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
DISTFILES= MesaLib-${MESADISTVERSION}${EXTRACT_SUFX}
MAINTAINER?= x11@FreeBSD.org
-# HACK: added lang/python as build dependency - we need to check, which
-# python versions are cleanly supported by Mesa
BUILD_DEPENDS+= makedepend:${PORTSDIR}/devel/makedepend \
- python:${PORTSDIR}/lang/python \
+ python2:${PORTSDIR}/lang/python2 \
${PYTHON_SITELIBDIR}/libxml2.py:${PORTSDIR}/textproc/py-libxml2
-USES+= bison
-USE_PYTHON_BUILD=yes
+USES= bison gmake pathfix pkgconfig shebangfix
+USE_PYTHON_BUILD=-2.7
USE_BZIP2= yes
-USE_GMAKE= yes
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
-CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers \
- --disable-egl
+
+.if ${OSVERSION} < 1000033
+BUILD_DEPENDS+= ${LOCALBASE}/bin/flex:${PORTSDIR}/textproc/flex
+CONFIGURE_ENV+=ac_cv_prog_LEX=${LOCALBASE}/bin/flex
+.endif
.if defined(WITH_NEW_XORG)
-EXTRA_PATCHES+= ${PATCHDIR}/extra-configure \
- ${PATCHDIR}/extra-src-glsl_ir_constant_expression.cpp \
- ${PATCHDIR}/extra-src__gallium__include__pipe__p_config.h \
- ${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c \
- ${PATCHDIR}/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c \
- ${PATCHDIR}/extra-src_glx_XF86dri.c
+USE_AUTOTOOLS= autoconf:env automake:env libtool:env
+# probably be shared lib, and in it own port.
+CONFIGURE_ARGS+= --enable-shared-glapi=no
+# we need to reapply these patches because we doing wierd stuff with autogen
+REAPPLY_PATCHES= \
+ ${PATCHDIR}/patch-configure \
+ ${PATCHDIR}/patch-src_egl_main_Makefile.in \
+ ${PATCHDIR}/patch-src_glx_Makefile.in \
+ ${PATCHDIR}/patch-src_mapi_es2api_Makefile.in \
+ ${PATCHDIR}/patch-src_mapi_shared-glapi_Makefile.in \
+ ${PATCHDIR}/patch-src_mesa_drivers_dri_common_Makefile.in \
+ ${PATCHDIR}/patch-src_mesa_drivers_dri_common_xmlpool_Makefile.in \
+ ${PATCHDIR}/patch-src_mesa_libdricore_Makefile.in
+
+python_OLD_CMD= "/usr/bin/env[[:space:]]python"
+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 \
+ src/mapi/mapi/mapi_abi.py
.else
-EXTRA_PATCHES+= ${PATCHDIR}/extra-configure-old \
- ${PATCHDIR}/extra-mach64_context.h-old \
- ${PATCHDIR}/extra-src__mesa__x86-64__glapi_x86-64.S \
- ${PATCHDIR}/extra-src__mesa__x86-64__xform4.S \
- ${PATCHDIR}/extra-src__mesa__x86__glapi_x86.S \
- ${PATCHDIR}/extra-src__mesa__x86__read_rgba_span_x86.S \
- ${PATCHDIR}/extra-src_glx_x11_XF86dri.c
-CONFIGURE_ARGS+=--disable-glut --disable-glw
-.endif
+CONFIGURE_ARGS+=--disable-glut --disable-glw --disable-glu
ALL_TARGET= default
+.endif
MASTERDIR= ${.CURDIR}/../../graphics/libGL
+.if defined(WITH_NEW_XORG)
PATCHDIR= ${MASTERDIR}/files
+.else
+PATCHDIR= ${MASTERDIR}/files-old
+.endif
DESCR= ${.CURDIR}/pkg-descr
PLIST= ${.CURDIR}/pkg-plist
WRKSRC= ${WRKDIR}/Mesa-${MESADISTVERSION}
-.if !defined(ARCH)
-ARCH!= uname -p
-.endif
-
COMPONENT= ${PORTNAME:L:C/^lib//:C/mesa-//}
-.if ${COMPONENT:Mglu} == ""
-CONFIGURE_ARGS+= --disable-glu
+.if ${COMPONENT:Mglesv2} == ""
+CONFIGURE_ARGS+= --disable-gles2
+.else
+CONFIGURE_ARGS+= --enable-gles2
+.endif
+
+.if ${COMPONENT:Megl} == ""
+CONFIGURE_ARGS+= --disable-egl
+.else
+CONFIGURE_ARGS+= --enable-egl
.endif
.if ${COMPONENT:Mdri} == ""
-CONFIGURE_ARGS+= --with-dri-drivers=no
+CONFIGURE_ARGS+=--with-dri-drivers=no
+CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers
.else
-CONFIGURE_ARGS+= --with-dri-drivers="i915,i965,r200,radeon,swrast"
+# done in the dri port
.endif
.if !defined(WITH_NEW_XORG)
@@ -106,8 +118,35 @@ CONFIGURE_ARGS+= --enable-xcb
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
+.if !defined(WITH_NEW_XORG)
@${REINPLACE_CMD} -e 's|[$$](INSTALL_LIB_DIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
${WRKSRC}/src/glu/Makefile \
${WRKSRC}/src/mesa/Makefile \
${WRKSRC}/src/mesa/drivers/dri/Makefile
+.else
+ @${REINPLACE_CMD} -e 's|#!/use/bin/python|#!${LOCALBASE}/bin/python2|g' \
+ ${WRKSRC}/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \
+ ${WRKSRC}/src/glsl/builtins/tools/*.py
+ @${REINPLACE_CMD} -e 's|!/use/bin/python2|!${LOCALBASE}/bin/python2|g' \
+ ${WRKSRC}/src/mesa/main/get_hash_generator.py \
+ ${WRKSRC}/src/mapi/glapi/gen/gl_enums.py \
+ ${WRKSRC}/src/mapi/glapi/gen/gl_table.py \
+
+.endif
+
+pre-configure:
+# workaround for stupid rerunning configure in do-build step
+# xxx
+.if defined(WITH_NEW_XORG)
+ cd ${WRKSRC} && env NOCONFIGURE=1 sh autogen.sh
+. for file in ${REAPPLY_PATCHES}
+ @cd ${WRKSRC} && ${PATCH} -p0 --quiet < ${file}
+. endfor
+# make sure the pkg-config files are installed in the correct place.
+# this was reverted by running autogen.sh
+ @${FIND} ${WRKSRC} -name Makefile.in -type f | ${XARGS} ${REINPLACE_CMD} -e \
+ 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' ;
+.endif
diff --git a/graphics/libGL/distinfo b/graphics/libGL/distinfo
index 5ee9af26ab05..aa7bb41c5c5d 100644
--- a/graphics/libGL/distinfo
+++ b/graphics/libGL/distinfo
@@ -1,4 +1,4 @@
SHA256 (MesaLib-7.6.1.tar.bz2) = 701f0e4cb85d6298181651b780d1c0a439fadd02aad29ee6623fc05588bb8d44
SIZE (MesaLib-7.6.1.tar.bz2) = 4886995
-SHA256 (MesaLib-8.0.5.tar.bz2) = 511b8da34f8e69ed24caf422964fb7ae747f3b1d8093f6b8aa2602164a475a5e
-SIZE (MesaLib-8.0.5.tar.bz2) = 5734571
+SHA256 (MesaLib-9.1.6.tar.bz2) = e632dff0acafad0a59dc208d16dedb37f7bd58f94c5d58c4b51912e41d005e3d
+SIZE (MesaLib-9.1.6.tar.bz2) = 6134267
diff --git a/graphics/libGL/files/extra-configure-old b/graphics/libGL/files-old/patch-configure
index b2e156de3b6b..b2e156de3b6b 100644
--- a/graphics/libGL/files/extra-configure-old
+++ b/graphics/libGL/files-old/patch-configure
diff --git a/graphics/libGL/files/extra-mach64_context.h-old b/graphics/libGL/files-old/patch-mach64_context.h
index 9e3b38e357cd..9e3b38e357cd 100644
--- a/graphics/libGL/files/extra-mach64_context.h-old
+++ b/graphics/libGL/files-old/patch-mach64_context.h
diff --git a/graphics/libGL/files/extra-src__mesa__x86-64__glapi_x86-64.S b/graphics/libGL/files-old/patch-src__mesa__x86-64__glapi_x86-64.S
index 908a6fe300aa..908a6fe300aa 100644
--- a/graphics/libGL/files/extra-src__mesa__x86-64__glapi_x86-64.S
+++ b/graphics/libGL/files-old/patch-src__mesa__x86-64__glapi_x86-64.S
diff --git a/graphics/libGL/files/extra-src__mesa__x86-64__xform4.S b/graphics/libGL/files-old/patch-src__mesa__x86-64__xform4.S
index 193e6cc30fbe..193e6cc30fbe 100644
--- a/graphics/libGL/files/extra-src__mesa__x86-64__xform4.S
+++ b/graphics/libGL/files-old/patch-src__mesa__x86-64__xform4.S
diff --git a/graphics/libGL/files/extra-src__mesa__x86__glapi_x86.S b/graphics/libGL/files-old/patch-src__mesa__x86__glapi_x86.S
index 71da78c83ffd..71da78c83ffd 100644
--- a/graphics/libGL/files/extra-src__mesa__x86__glapi_x86.S
+++ b/graphics/libGL/files-old/patch-src__mesa__x86__glapi_x86.S
diff --git a/graphics/libGL/files/extra-src__mesa__x86__read_rgba_span_x86.S b/graphics/libGL/files-old/patch-src__mesa__x86__read_rgba_span_x86.S
index 37b08d1cda3c..37b08d1cda3c 100644
--- a/graphics/libGL/files/extra-src__mesa__x86__read_rgba_span_x86.S
+++ b/graphics/libGL/files-old/patch-src__mesa__x86__read_rgba_span_x86.S
diff --git a/graphics/libGL/files/extra-src_glx_x11_XF86dri.c b/graphics/libGL/files-old/patch-src_glx_x11_XF86dri.c
index 1d082b54e21d..1d082b54e21d 100644
--- a/graphics/libGL/files/extra-src_glx_x11_XF86dri.c
+++ b/graphics/libGL/files-old/patch-src_glx_x11_XF86dri.c
diff --git a/graphics/libGL/files/patch-src_mesa_Makefile b/graphics/libGL/files-old/patch-src_mesa_Makefile
index fe2624bae8a7..433f3fbbf182 100644
--- a/graphics/libGL/files/patch-src_mesa_Makefile
+++ b/graphics/libGL/files-old/patch-src_mesa_Makefile
@@ -1,6 +1,6 @@
---- src/mesa/Makefile.orig 2012-04-22 18:34:50.000000000 +0200
-+++ src/mesa/Makefile 2012-04-22 18:35:00.000000000 +0200
-@@ -183,10 +183,10 @@
+--- src/mesa/Makefile.orig 2009-12-22 03:31:19.000000000 +0100
++++ src/mesa/Makefile 2013-08-19 23:19:42.000000000 +0200
+@@ -127,10 +127,10 @@
$(DESTDIR)$(INSTALL_INC_DIR)/GL
install-libgl: default gl.pc install-headers
diff --git a/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c b/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c
deleted file mode 100644
index c07a519ef25f..000000000000
--- a/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_array.c
+++ /dev/null
@@ -1,99 +0,0 @@
---- src/mesa/drivers/dri/nouveau/nouveau_array.c.orig 2011-01-06 01:19:15.000000000 +0100
-+++ src/mesa/drivers/dri/nouveau/nouveau_array.c 2012-04-28 18:27:06.000000000 +0200
-@@ -29,54 +29,71 @@
- #include "nouveau_array.h"
- #include "nouveau_bufferobj.h"
-
-+#define EXTRACT(in_t, out_t) extract_func_##in_t##_to_##out_t
-+
-+#define EXTRACT_FUNC(in_t, out_t, k) \
-+static out_t EXTRACT(in_t, out_t) \
-+(struct nouveau_array *a, int i, int j) { \
-+ in_t x = ((in_t *)(a->buf + i * a->stride))[j]; \
-+ \
-+ return (out_t)x / (k); \
-+}
-+
-+EXTRACT_FUNC(GLchar, unsigned, 1);
-+EXTRACT_FUNC(GLchar, float, SCHAR_MAX);
-+EXTRACT_FUNC(GLubyte, unsigned, 1);
-+EXTRACT_FUNC(GLubyte, float, UCHAR_MAX);
-+EXTRACT_FUNC(GLshort, unsigned, 1);
-+EXTRACT_FUNC(GLshort, float, SHRT_MAX);
-+EXTRACT_FUNC(GLushort, unsigned, 1);
-+EXTRACT_FUNC(GLushort, float, USHRT_MAX);
-+EXTRACT_FUNC(GLint, unsigned, 1);
-+EXTRACT_FUNC(GLint, float, INT_MAX);
-+EXTRACT_FUNC(GLuint, unsigned, 1);
-+EXTRACT_FUNC(GLuint, float, UINT_MAX);
-+EXTRACT_FUNC(GLfloat, unsigned, 1.0 / UINT_MAX);
-+EXTRACT_FUNC(GLfloat, float, 1);
-+
-+#undef EXTRACT_FUNC
-+
- static void
- get_array_extract(struct nouveau_array *a, extract_u_t *extract_u,
- extract_f_t *extract_f)
- {
--#define EXTRACT(in_t, out_t, k) \
-- ({ \
-- auto out_t f(struct nouveau_array *, int, int); \
-- out_t f(struct nouveau_array *a, int i, int j) { \
-- in_t x = ((in_t *)(a->buf + i * a->stride))[j]; \
-- \
-- return (out_t)x / (k); \
-- }; \
-- f; \
-- });
--
- switch (a->type) {
- case GL_BYTE:
-- *extract_u = EXTRACT(char, unsigned, 1);
-- *extract_f = EXTRACT(char, float, SCHAR_MAX);
-+ *extract_u = EXTRACT(GLchar, unsigned);
-+ *extract_f = EXTRACT(GLchar, float);
- break;
- case GL_UNSIGNED_BYTE:
-- *extract_u = EXTRACT(unsigned char, unsigned, 1);
-- *extract_f = EXTRACT(unsigned char, float, UCHAR_MAX);
-+ *extract_u = EXTRACT(GLubyte, unsigned);
-+ *extract_f = EXTRACT(GLubyte, float);
- break;
- case GL_SHORT:
-- *extract_u = EXTRACT(short, unsigned, 1);
-- *extract_f = EXTRACT(short, float, SHRT_MAX);
-+ *extract_u = EXTRACT(GLshort, unsigned);
-+ *extract_f = EXTRACT(GLshort, float);
- break;
- case GL_UNSIGNED_SHORT:
-- *extract_u = EXTRACT(unsigned short, unsigned, 1);
-- *extract_f = EXTRACT(unsigned short, float, USHRT_MAX);
-+ *extract_u = EXTRACT(GLushort, unsigned);
-+ *extract_f = EXTRACT(GLushort, float);
- break;
- case GL_INT:
-- *extract_u = EXTRACT(int, unsigned, 1);
-- *extract_f = EXTRACT(int, float, INT_MAX);
-+ *extract_u = EXTRACT(GLint, unsigned);
-+ *extract_f = EXTRACT(GLint, float);
- break;
- case GL_UNSIGNED_INT:
-- *extract_u = EXTRACT(unsigned int, unsigned, 1);
-- *extract_f = EXTRACT(unsigned int, float, UINT_MAX);
-+ *extract_u = EXTRACT(GLuint, unsigned);
-+ *extract_f = EXTRACT(GLuint, float);
- break;
- case GL_FLOAT:
-- *extract_u = EXTRACT(float, unsigned, 1.0 / UINT_MAX);
-- *extract_f = EXTRACT(float, float, 1);
-+ *extract_u = EXTRACT(GLfloat, unsigned);
-+ *extract_f = EXTRACT(GLfloat, float);
- break;
- default:
- assert(0);
- }
- }
-+#undef EXTRACT
-
- void
- nouveau_init_array(struct nouveau_array *a, int attr, int stride,
diff --git a/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c b/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c
deleted file mode 100644
index 7c29328546ef..000000000000
--- a/graphics/libGL/files/extra-src__mesa__drivers__dri__nouveau__nouveau_render_t.c
+++ /dev/null
@@ -1,91 +0,0 @@
---- src/mesa/drivers/dri/nouveau/nouveau_render_t.c.orig 2011-01-06 01:19:34.000000000 +0100
-+++ src/mesa/drivers/dri/nouveau/nouveau_render_t.c 2012-04-28 18:27:06.000000000 +0200
-@@ -97,52 +97,49 @@
- } \
- } while (0)
-
--/*
-- * Select an appropriate dispatch function for the given index buffer.
-- */
--static dispatch_t
--get_array_dispatch(struct nouveau_array *a)
-+static void
-+dispatch_l(struct gl_context *ctx, unsigned int start, int delta,
-+ unsigned int n)
- {
-- if (!a->fields) {
-- auto void f(struct gl_context *, unsigned int, int, unsigned int);
--
-- void f(struct gl_context *ctx, unsigned int start, int delta,
-- unsigned int n) {
-- struct nouveau_channel *chan = context_chan(ctx);
-- RENDER_LOCALS(ctx);
-+ struct nouveau_channel *chan = context_chan(ctx);
-+ RENDER_LOCALS(ctx);
-
-- EMIT_VBO(L, ctx, start, delta, n);
-- };
--
-- return f;
--
-- } else if (a->type == GL_UNSIGNED_INT) {
-- auto void f(struct gl_context *, unsigned int, int, unsigned int);
--
-- void f(struct gl_context *ctx, unsigned int start, int delta,
-- unsigned int n) {
-- struct nouveau_channel *chan = context_chan(ctx);
-- RENDER_LOCALS(ctx);
-+ EMIT_VBO(L, ctx, start, delta, n);
-+}
-
-- EMIT_VBO(I32, ctx, start, delta, n);
-- };
-+static void
-+dispatch_i32(struct gl_context *ctx, unsigned int start, int delta,
-+ unsigned int n)
-+{
-+ struct nouveau_channel *chan = context_chan(ctx);
-+ RENDER_LOCALS(ctx);
-
-- return f;
-+ EMIT_VBO(I32, ctx, start, delta, n);
-+}
-
-- } else {
-- auto void f(struct gl_context *, unsigned int, int, unsigned int);
-+static void
-+dispatch_i16(struct gl_context *ctx, unsigned int start, int delta,
-+ unsigned int n)
-+{
-+ struct nouveau_channel *chan = context_chan(ctx);
-+ RENDER_LOCALS(ctx);
-
-- void f(struct gl_context *ctx, unsigned int start, int delta,
-- unsigned int n) {
-- struct nouveau_channel *chan = context_chan(ctx);
-- RENDER_LOCALS(ctx);
--
-- EMIT_VBO(I32, ctx, start, delta, n & 1);
-- EMIT_VBO(I16, ctx, start, delta, n & ~1);
-- };
-+ EMIT_VBO(I32, ctx, start, delta, n & 1);
-+ EMIT_VBO(I16, ctx, start, delta, n & ~1);
-+}
-
-- return f;
-- }
-+/*
-+ * Select an appropriate dispatch function for the given index buffer.
-+ */
-+static dispatch_t
-+get_array_dispatch(struct nouveau_array *a)
-+{
-+ if (!a->fields)
-+ return dispatch_l;
-+ else if (a->type == GL_UNSIGNED_INT)
-+ return dispatch_i32;
-+ else
-+ return dispatch_i16;
- }
-
- /*
diff --git a/graphics/libGL/files/extra-src_glx_XF86dri.c b/graphics/libGL/files/extra-src_glx_XF86dri.c
deleted file mode 100644
index 42319b8abb6e..000000000000
--- a/graphics/libGL/files/extra-src_glx_XF86dri.c
+++ /dev/null
@@ -1,38 +0,0 @@
---- src/glx/XF86dri.c.orig 2012-10-24 19:03:59.000000000 +0000
-+++ src/glx/XF86dri.c 2013-05-29 10:07:33.000000000 +0000
-@@ -43,6 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
- #include <X11/extensions/Xext.h>
- #include <X11/extensions/extutil.h>
- #include "xf86dristr.h"
-+#include <limits.h>
-
- static XExtensionInfo _xf86dri_info_data;
- static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
-@@ -201,7 +202,11 @@ XF86DRIOpenConnection(Display * dpy, int
- }
-
- if (rep.length) {
-- if (!(*busIdString = (char *) Xcalloc(rep.busIdStringLength + 1, 1))) {
-+ if (rep.busIdStringLength < INT_MAX)
-+ *busIdString = Xcalloc(rep.busIdStringLength + 1, 1);
-+ else
-+ *busIdString = NULL;
-+ if (*busIdString == NULL) {
- _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
-@@ -300,9 +305,11 @@ XF86DRIGetClientDriverName(Display * dpy
- *ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
-
- if (rep.length) {
-- if (!
-- (*clientDriverName =
-- (char *) Xcalloc(rep.clientDriverNameLength + 1, 1))) {
-+ if (rep.clientDriverNameLength < INT_MAX)
-+ *clientDriverName = Xcalloc(rep.clientDriverNameLength + 1, 1);
-+ else
-+ *clientDriverName = NULL;
-+ if (*clientDriverName == NULL) {
- _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
diff --git a/graphics/libGL/files/extra-configure b/graphics/libGL/files/patch-configure
index d1ae3b75e23d..5f788478fb58 100644
--- a/graphics/libGL/files/extra-configure
+++ b/graphics/libGL/files/patch-configure
@@ -1,7 +1,7 @@
---- configure.orig 2012-07-10 17:30:46.000000000 +0200
-+++ configure 2012-09-01 13:27:22.000000000 +0200
-@@ -9017,9 +9017,34 @@
- DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
+--- configure.orig 2013-08-01 23:22:15.000000000 +0200
++++ configure 2013-08-19 20:05:02.000000000 +0200
+@@ -21046,9 +21046,34 @@
+ DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
- if test "x$DRI_DIRS" = "xyes"; then
@@ -38,3 +38,12 @@
;;
gnu*)
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+@@ -23396,7 +23421,7 @@
+ radeon_llvm_check() {
+ LLVM_REQUIRED_VERSION_MAJOR="3"
+ LLVM_REQUIRED_VERSION_MINOR="2"
+- if test "$LLVM_VERSION_INT" -ne "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
++ if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
+ as_fn_error $? "LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR with R600 target enabled is required.
+ To use the r600/radeonsi LLVM backend, you need to fetch the LLVM source from:
+ git://people.freedesktop.org/~tstellar/llvm master
diff --git a/graphics/libGL/files/extra-src-glsl_ir_constant_expression.cpp b/graphics/libGL/files/patch-src-glsl_ir_constant_expression.cpp
index 8df40432dfc9..8df40432dfc9 100644
--- a/graphics/libGL/files/extra-src-glsl_ir_constant_expression.cpp
+++ b/graphics/libGL/files/patch-src-glsl_ir_constant_expression.cpp
diff --git a/graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h b/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h
index 41f38a9663bb..41f38a9663bb 100644
--- a/graphics/libGL/files/extra-src__gallium__include__pipe__p_config.h
+++ b/graphics/libGL/files/patch-src__gallium__include__pipe__p_config.h
diff --git a/graphics/libGL/files/patch-src_egl_main_Makefile.in b/graphics/libGL/files/patch-src_egl_main_Makefile.in
new file mode 100644
index 000000000000..7fefe71c41a9
--- /dev/null
+++ b/graphics/libGL/files/patch-src_egl_main_Makefile.in
@@ -0,0 +1,19 @@
+--- src/egl/main/Makefile.in.orig 2013-08-01 23:22:16.000000000 +0200
++++ src/egl/main/Makefile.in 2013-09-01 11:33:47.000000000 +0200
+@@ -990,8 +990,14 @@
+ # a while by putting a link to the driver into /lib of the build tree.
+ all-local: libEGL.la
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+- ln -f .libs/libEGL.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libEGL.so.1
+- ln -sf libEGL.so.1 $(top_builddir)/$(LIB_DIR)/libEGL.so
++ base=$(basename $<); \
++ dlname=$$(grep dlname= .libs/$< | cut -d "'" -f 2); \
++ ver=$$(grep current= .libs/$< | cut -d "=" -f 2); \
++ ln -f .libs/$$dlname $(top_builddir)/$(LIB_DIR)/$$dlname; \
++ if [ ! -f $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver ]; then \
++ ln -sf $$dlname $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver; \
++ fi; \
++ ln -sf $$base.so.$$ver $(top_builddir)/$(LIB_DIR)/$$base.so
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_r300_r300-chipset.c b/graphics/libGL/files/patch-src_gallium_drivers_r300_r300-chipset.c
new file mode 100644
index 000000000000..821b07ce8be2
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_r300_r300-chipset.c
@@ -0,0 +1,26 @@
+diff --git a/src/gallium/drivers/r300/r300_chipset.c b/src/gallium/drivers/r300/r300_chipset.c
+index 11061ed..daf990e 100644
+--- src/gallium/drivers/r300/r300_chipset.c
++++ src/gallium/drivers/r300/r300_chipset.c
+@@ -48,6 +48,21 @@ static void r300_apply_hyperz_blacklist(struct r300_capabilities* caps)
+ };
+ int i;
+
++#if defined(__DragonFly__) || \
++ defined(__FreeBSD__) || \
++ defined(__NetBSD__) || \
++ defined(__OpenBSD__)
++ const char *progname, *program_invocation_short_name;
++
++ progname = getprogname();
++ program_invocation_short_name = strrchr(progname, '/');
++ if (program_invocation_short_name) {
++ program_invocation_short_name++;
++ } else {
++ program_invocation_short_name = progname;
++ }
++#endif
++
+ for (i = 0; i < Elements(list); i++) {
+ if (strcmp(list[i], program_invocation_short_name) == 0) {
+ caps->zmask_ram = 0;
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-asm.c b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-asm.c
new file mode 100644
index 000000000000..bdaada3f1fe7
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-asm.c
@@ -0,0 +1,15 @@
+--- src/gallium/drivers/r600/r600_asm.c.orig 2013-03-20 00:28:25.000000000 +0100
++++ src/gallium/drivers/r600/r600_asm.c 2013-06-26 23:29:14.000000000 +0200
+@@ -27,7 +27,12 @@
+ #include "r600d.h"
+
+ #include <errno.h>
++#if defined(__linux__)
+ #include <byteswap.h>
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++#define bswap_32(x) bswap32((x))
++#endif
+ #include "util/u_memory.h"
+ #include "pipe/p_shader_tokens.h"
+
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-shader.c b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-shader.c
new file mode 100644
index 000000000000..536529e39704
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600-shader.c
@@ -0,0 +1,15 @@
+--- src/gallium/drivers/r600/r600_shader.c.orig 2013-05-16 19:38:54.000000000 +0200
++++ src/gallium/drivers/r600/r600_shader.c 2013-06-26 23:26:02.000000000 +0200
+@@ -35,7 +35,12 @@
+ #include "util/u_memory.h"
+ #include <stdio.h>
+ #include <errno.h>
++#if defined(__linux__)
+ #include <byteswap.h>
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++#define bswap_32(x) bswap32((x))
++#endif
+
+ /* CAYMAN notes
+ Why CAYMAN got loops for lots of instructions is explained here.
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_r600_r600_state_common.c b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600_state_common.c
new file mode 100644
index 000000000000..89b2d7acbf83
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_r600_r600_state_common.c
@@ -0,0 +1,15 @@
+--- src/gallium/drivers/r600/r600_state_common.c.orig 2013-03-06 00:25:39.000000000 +0100
++++ src/gallium/drivers/r600/r600_state_common.c 2013-06-26 23:26:02.000000000 +0200
+@@ -33,7 +33,12 @@
+ #include "util/u_memory.h"
+ #include "util/u_upload_mgr.h"
+ #include "tgsi/tgsi_parse.h"
++#if defined(__linux__)
+ #include <byteswap.h>
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++#define bswap_32(x) bswap32((x))
++#endif
+
+ #define R600_PRIM_RECTANGLE_LIST PIPE_PRIM_MAX
+
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_radeon_radeon-llvm-emit.cpp b/graphics/libGL/files/patch-src_gallium_drivers_radeon_radeon-llvm-emit.cpp
new file mode 100644
index 000000000000..ee67776d839e
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_radeon_radeon-llvm-emit.cpp
@@ -0,0 +1,28 @@
+--- src/gallium/drivers/radeon/radeon_llvm_emit.cpp.orig 2013-08-19 21:23:06.000000000 +0200
++++ src/gallium/drivers/radeon/radeon_llvm_emit.cpp 2013-08-19 21:30:58.000000000 +0200
+@@ -25,13 +25,13 @@
+ */
+ #include "radeon_llvm_emit.h"
+
+-#include <llvm/LLVMContext.h>
+-#include <llvm/Module.h>
++#include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
+ #include <llvm/PassManager.h>
+ #include <llvm/ADT/Triple.h>
+ #include <llvm/Support/FormattedStream.h>
+ #include <llvm/Support/Host.h>
+-#include <llvm/Support/IRReader.h>
++#include <llvm/IRReader/IRReader.h>
+ #include <llvm/Support/SourceMgr.h>
+ #include <llvm/Support/TargetRegistry.h>
+ #include <llvm/Support/TargetSelect.h>
+@@ -39,7 +39,7 @@
+ #include <llvm/Target/TargetMachine.h>
+ #include <llvm/Transforms/Scalar.h>
+ #include <llvm-c/Target.h>
+-#include <llvm/DataLayout.h>
++#include <llvm/IR/DataLayout.h>
+
+ #include <iostream>
+ #include <stdlib.h>
diff --git a/graphics/libGL/files/patch-src_gallium_drivers_radeonsi_r600-buffer.c b/graphics/libGL/files/patch-src_gallium_drivers_radeonsi_r600-buffer.c
new file mode 100644
index 000000000000..4e69603030a2
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_drivers_radeonsi_r600-buffer.c
@@ -0,0 +1,16 @@
+--- src/gallium/drivers/radeonsi/r600_buffer.c.orig 2013-08-01 00:56:45.000000000 +0200
++++ src/gallium/drivers/radeonsi/r600_buffer.c 2013-08-19 21:36:02.000000000 +0200
+@@ -24,7 +24,13 @@
+ * Jerome Glisse
+ * Corbin Simpson <MostAwesomeDude@gmail.com>
+ */
++
++#if defined(__linux__)
+ #include <byteswap.h>
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++#define bswap_32(x) bswap32((x))
++#endif
+
+ #include "pipe/p_screen.h"
+ #include "util/u_format.h"
diff --git a/graphics/libGL/files/patch-src_gallium_winsys_svga_drm_vmw-screen-ioctl.c b/graphics/libGL/files/patch-src_gallium_winsys_svga_drm_vmw-screen-ioctl.c
new file mode 100644
index 000000000000..208601de99a0
--- /dev/null
+++ b/graphics/libGL/files/patch-src_gallium_winsys_svga_drm_vmw-screen-ioctl.c
@@ -0,0 +1,18 @@
+diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+index 36888dc..62a6e6a 100644
+--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
++++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+@@ -66,6 +66,13 @@ struct vmw_region
+ */
+ #define SVGA3D_SURFACE_HINT_SCANOUT (1 << 9)
+
++#if defined(__DragonFly__) || \
++ defined(__FreeBSD__) || \
++ defined(__NetBSD__) || \
++ defined(__OpenBSD__)
++#define ERESTART EINTR
++#endif
++
+ uint32
+ vmw_ioctl_context_create(struct vmw_winsys_screen *vws)
+ {
diff --git a/graphics/libGL/files/patch-src_glx_Makefile.in b/graphics/libGL/files/patch-src_glx_Makefile.in
new file mode 100644
index 000000000000..ffe97fef8922
--- /dev/null
+++ b/graphics/libGL/files/patch-src_glx_Makefile.in
@@ -0,0 +1,59 @@
+--- src/glx/Makefile.in.orig 2013-07-03 15:13:37.000000000 +0200
++++ src/glx/Makefile.in 2013-07-03 15:19:44.000000000 +0200
+@@ -162,12 +162,12 @@
+ depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
+ am__depfiles_maybe = depfiles
+ am__mv = mv -f
+-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++COMPILE = $(CC) $(DEFS) $(AM_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
++ $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
+ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+- $(AM_CFLAGS) $(CFLAGS)
++ $(AM_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS) $(CFLAGS)
+ AM_V_CC = $(am__v_CC_@AM_V@)
+ am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+ am__v_CC_0 = @echo " CC " $@;
+@@ -632,17 +632,17 @@
+ $(am__aclocal_m4_deps):
+ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
++ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)/.libGL" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
++ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)/.libGL'"; \
++ $(MKDIR_P) "$(DESTDIR)$(libdir)/.libGL" || exit 1; \
++ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)/.libGL'"; \
++ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)/.libGL"; \
+ }
+
+ uninstall-libLTLIBRARIES:
+@@ -1068,8 +1068,14 @@
+ # a while by putting a link to the driver into /lib of the build tree.
+ all-local: lib@GL_LIB@.la
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+- ln -f .libs/lib@GL_LIB@.so.1.2.0 $(top_builddir)/$(LIB_DIR)/lib@GL_LIB@.so.1
+- ln -sf lib@GL_LIB@.so.1 $(top_builddir)/$(LIB_DIR)/lib@GL_LIB@.so
++ base=$(basename $<); \
++ dlname=$$(grep dlname= .libs/$< | cut -d "'" -f 2); \
++ ver=$$(grep current= .libs/$< | cut -d "=" -f 2); \
++ ln -f .libs/$$dlname $(top_builddir)/$(LIB_DIR)/$$dlname; \
++ if [ ! -f $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver ]; then \
++ ln -sf $$dlname $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver; \
++ fi; \
++ ln -sf $$base.so.$$ver $(top_builddir)/$(LIB_DIR)/$$base.so
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/graphics/libGL/files/patch-src_mapi_es2api_Makefile.in b/graphics/libGL/files/patch-src_mapi_es2api_Makefile.in
new file mode 100644
index 000000000000..1e3229ef40cc
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mapi_es2api_Makefile.in
@@ -0,0 +1,20 @@
+--- src/mapi/es2api/Makefile.in.orig 2013-08-01 23:22:21.000000000 +0200
++++ src/mapi/es2api/Makefile.in 2013-09-01 11:38:01.000000000 +0200
+@@ -958,9 +958,14 @@
+ # a while by putting a link to the driver into /lib of the build tree.
+ all-local: libGLESv2.la
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+- ln -f .libs/libGLESv2.so $(top_builddir)/$(LIB_DIR)/libGLESv2.so
+- ln -f .libs/libGLESv2.so.2 $(top_builddir)/$(LIB_DIR)/libGLESv2.so.2
+- ln -f .libs/libGLESv2.so.2.0.0 $(top_builddir)/$(LIB_DIR)/libGLESv2.so.2.0.0
++ base=$(basename $<); \
++ dlname=$$(grep dlname= .libs/$< | cut -d "'" -f 2); \
++ ver=$$(grep current= .libs/$< | cut -d "=" -f 2); \
++ ln -f .libs/$$dlname $(top_builddir)/$(LIB_DIR)/$$dlname; \
++ if [ ! -f $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver ]; then \
++ ln -sf $$dlname $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver; \
++ fi; \
++ ln -sf $$base.so.$$ver $(top_builddir)/$(LIB_DIR)/$$base.so
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/graphics/libGL/files/patch-src_mapi_glapi_gen_gl-gentable.py b/graphics/libGL/files/patch-src_mapi_glapi_gen_gl-gentable.py
new file mode 100644
index 000000000000..d952bb61cf26
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mapi_glapi_gen_gl-gentable.py
@@ -0,0 +1,11 @@
+--- src/mapi/glapi/gen/gl_gentable.py.orig 2013-07-17 15:41:13.000000000 +0200
++++ src/mapi/glapi/gen/gl_gentable.py 2013-07-17 15:41:55.000000000 +0200
+@@ -42,7 +42,7 @@
+ #endif
+
+ #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
+- || (!defined(GLXEXT) && defined(DEBUG) && !defined(_WIN32_WCE) && !defined(__CYGWIN__))
++ || (!defined(GLXEXT) && defined(DEBUG) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) && !defined(__OpenBSD__) && !defined(__FreeBSD__))
+ #define USE_BACKTRACE
+ #endif
+
diff --git a/graphics/libGL/files/patch-src_mapi_shared-glapi_Makefile.in b/graphics/libGL/files/patch-src_mapi_shared-glapi_Makefile.in
new file mode 100644
index 000000000000..a82a748e7b10
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mapi_shared-glapi_Makefile.in
@@ -0,0 +1,20 @@
+--- src/mapi/shared-glapi/Makefile.in.orig 2013-06-27 00:42:45.000000000 +0200
++++ src/mapi/shared-glapi/Makefile.in 2013-06-27 00:43:25.000000000 +0200
+@@ -889,9 +889,14 @@
+
+ all-local: libglapi.la
+ $(MKDIR_P) $(top_builddir)/$(LIB_DIR)
+- ln -f .libs/libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so.0.0.0
+- ln -sf libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so.0
+- ln -sf libglapi.so.0 $(top_builddir)/$(LIB_DIR)/libglapi.so
++ base=$(basename $<); \
++ dlname=$$(grep dlname= .libs/$< | cut -d "'" -f 2); \
++ ver=$$(grep current= .libs/$< | cut -d "=" -f 2); \
++ ln -f .libs/$$dlname $(top_builddir)/$(LIB_DIR)/$$dlname; \
++ if [ ! -f $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver ]; then \
++ ln -sf $$dlname $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver; \
++ fi; \
++ ln -sf $$base.so.$$ver $(top_builddir)/$(LIB_DIR)/$$base.so
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/graphics/libGL/files/patch-src_mesa_drivers_dri_common_Makefile.in b/graphics/libGL/files/patch-src_mesa_drivers_dri_common_Makefile.in
new file mode 100644
index 000000000000..1084e90fd805
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mesa_drivers_dri_common_Makefile.in
@@ -0,0 +1,17 @@
+--- src/mesa/drivers/dri/common/Makefile.in.orig 2013-04-20 14:50:15.000000000 +0000
++++ src/mesa/drivers/dri/common/Makefile.in 2013-04-20 15:02:05.000000000 +0000
+@@ -123,11 +123,11 @@
+ am__depfiles_maybe = depfiles
+ am__mv = mv -f
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++ $(AM_CFLAGS) $(CPPFLAGS) $(CFLAGS)
+ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+- $(AM_CFLAGS) $(CFLAGS)
++ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS) $(CPPFLAGS) \
++ $(CFLAGS)
+ AM_V_CC = $(am__v_CC_@AM_V@)
+ am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+ am__v_CC_0 = @echo " CC " $@;
diff --git a/graphics/libGL/files/patch-src_mesa_drivers_dri_common_xmlpool_Makefile.in b/graphics/libGL/files/patch-src_mesa_drivers_dri_common_xmlpool_Makefile.in
new file mode 100644
index 000000000000..4f2a84b8be96
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mesa_drivers_dri_common_xmlpool_Makefile.in
@@ -0,0 +1,11 @@
+--- src/mesa/drivers/dri/common/xmlpool/Makefile.in.orig 2013-07-02 22:42:09.000000000 +0200
++++ src/mesa/drivers/dri/common/xmlpool/Makefile.in 2013-07-02 22:53:30.000000000 +0200
+@@ -639,7 +639,7 @@
+ # Update .mo files from the corresponding .po files.
+ %/LC_MESSAGES/options.mo: %.po
+ @mo="$@"; \
+- lang=$${mo%%/*}; \
++ lang=$*; \
+ echo "Updating ($$lang) $@ from $?."; \
+ mkdir -p $$lang/LC_MESSAGES; \
+ msgfmt -o $@ $?
diff --git a/graphics/libGL/files/patch-src_mesa_libdricore_Makefile.in b/graphics/libGL/files/patch-src_mesa_libdricore_Makefile.in
new file mode 100644
index 000000000000..15b35d1b3eea
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mesa_libdricore_Makefile.in
@@ -0,0 +1,19 @@
+--- src/mesa/libdricore/Makefile.in.orig 2013-06-27 00:21:26.000000000 +0200
++++ src/mesa/libdricore/Makefile.in 2013-06-27 00:28:29.000000000 +0200
+@@ -3950,8 +4000,14 @@
+ # a while by putting a link to the driver into /lib of the build tree.
+ @HAVE_DRI_TRUE@all-local: libdricore@VERSION@.la
+ @HAVE_DRI_TRUE@ $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+-@HAVE_DRI_TRUE@ ln -f .libs/libdricore@VERSION@.so.1.0.0 $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so.1;
+-@HAVE_DRI_TRUE@ ln -sf libdricore@VERSION@.so.1 $(top_builddir)/$(LIB_DIR)/libdricore@VERSION@.so
++@HAVE_DRI_TRUE@ base=$(basename $<); \
++@HAVE_DRI_TRUE@ dlname=$$(grep dlname= .libs/$< | cut -d "'" -f 2); \
++@HAVE_DRI_TRUE@ ver=$$(grep current= .libs/$< | cut -d "=" -f 2); \
++@HAVE_DRI_TRUE@ ln -f .libs/$$dlname $(top_builddir)/$(LIB_DIR)/$$dlname; \
++@HAVE_DRI_TRUE@ if [ ! -f $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver ]; then \
++@HAVE_DRI_TRUE@ ln -sf $$dlname $(top_builddir)/$(LIB_DIR)/$$base.so.$$ver; \
++@HAVE_DRI_TRUE@ fi; \
++@HAVE_DRI_TRUE@ ln -sf $$base.so.$$ver $(top_builddir)/$(LIB_DIR)/$$base.so
+
+ -include $(DEPENDS)
+
diff --git a/graphics/libGL/files/patch-src_mesa_main_compiler.h b/graphics/libGL/files/patch-src_mesa_main_compiler.h
new file mode 100644
index 000000000000..50cf3a8454f6
--- /dev/null
+++ b/graphics/libGL/files/patch-src_mesa_main_compiler.h
@@ -0,0 +1,12 @@
+--- src/mesa/main/compiler.h.orig 2013-04-06 04:01:09.000000000 +0200
++++ src/mesa/main/compiler.h 2013-06-26 23:26:02.000000000 +0200
+@@ -171,6 +171,9 @@
+ #if defined(__linux__)
+ #include <byteswap.h>
+ #define CPU_TO_LE32( x ) bswap_32( x )
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++#define CPU_TO_LE32( x ) bswap32( x )
+ #elif defined(__APPLE__)
+ #include <CoreFoundation/CFByteOrder.h>
+ #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
diff --git a/graphics/libGL/pkg-plist b/graphics/libGL/pkg-plist
index e24cff6cd396..e12392678a75 100644
--- a/graphics/libGL/pkg-plist
+++ b/graphics/libGL/pkg-plist
@@ -11,9 +11,10 @@ include/GL/glxext.h
%%OLD%%include/GL/mglmesa.h
include/GL/osmesa.h
%%OLD%%include/GL/svgamesa.h
-include/GL/vms_x_fix.h
+%%OLD%%include/GL/vms_x_fix.h
include/GL/wglext.h
include/GL/wmesa.h
+%%NEW%%lib/.libGL/libGL.la
lib/.libGL/libGL.so
lib/.libGL/libGL.so.1
libdata/pkgconfig/gl.pc
diff --git a/graphics/libGLw/Makefile b/graphics/libGLw/Makefile
index 59265e6d4ca9..95b5dcfa5009 100644
--- a/graphics/libGLw/Makefile
+++ b/graphics/libGLw/Makefile
@@ -12,7 +12,7 @@ MAINTAINER= x11@FreeBSD.org
COMMENT= OpenGL widgets library
USE_BZIP2= yes
-USES= pathfix pkgconfig motif
+USES= motif pathfix pkgconfig
USE_LDCONFIG= yes
USE_GL= gl
USE_XORG= x11 xt xext
diff --git a/graphics/libdrm/Makefile b/graphics/libdrm/Makefile
index 5b51bc62d067..d9aa3c68d292 100644
--- a/graphics/libdrm/Makefile
+++ b/graphics/libdrm/Makefile
@@ -10,8 +10,8 @@ MASTER_SITES= http://dri.freedesktop.org/libdrm/
MAINTAINER= x11@FreeBSD.org
COMMENT= Userspace interface to kernel Direct Rendering Module services
-LIB_DEPENDS= pciaccess:${PORTSDIR}/devel/libpciaccess \
- pthread-stubs:${PORTSDIR}/devel/libpthread-stubs
+LIB_DEPENDS= libpciaccess.so:${PORTSDIR}/devel/libpciaccess \
+ libpthread-stubs.so:${PORTSDIR}/devel/libpthread-stubs
USES= pkgconfig
USE_BZIP2= yes
@@ -19,14 +19,7 @@ GNU_CONFIGURE= yes
USE_LDCONFIG= yes
NO_STAGE= yes
-
-.if defined(WITH_NEW_XORG)
-
-USES+= gmake
-
-OPTIONS_DEFINE= KMS MANPAGES
-OPTIONS_DEFAULT=KMS
-KMS_DESC= Enable KMS support
+OPTIONS_DEFINE= MANPAGES
.if defined(PACKAGE_BUILDING)
OPTIONS_DEFAULT+= MANPAGES
@@ -34,12 +27,18 @@ OPTIONS_DEFAULT+= MANPAGES
.include <bsd.port.options.mk>
-.if ${PORT_OPTIONS:MKMS}
+.if defined(WITH_NEW_XORG)
+
+USES+= gmake
+
+# KMS support in the kernel is only build on these archs, disable others
+.if ${ARCH} == "amd64" || ${ARCH} == "i386"
CONFIGURE_ARGS+=--enable-libkms
EXTRA_PATCHES+= ${FILESDIR}/extra-xf86drmMode.c
-PLIST_SUB+= KMS=""
+PLIST_SUB+= KMS="" NOUVEAU=""
.else
-PLIST_SUB+= KMS="@comment "
+CONFIGURE_ARGS+=--disable-libkms
+PLIST_SUB+= KMS="@comment " NOUVEAU="@comment "
.endif
.if ${PORT_OPTIONS:MMANPAGES}
@@ -70,11 +69,9 @@ CONFIGURE_ARGS+=--disable-vmwgfx
CONFIGURE_ARGS= --enable-nouveau-experimental-api
LIBDRM_VERSION= 2.4.17
LIBDRM_REVISION=1
-PLIST_SUB+= OLD="" NEW="@comment "
+PLIST_SUB+= OLD="" NEW="@comment " NOUVEAU=""
.endif
-.include <bsd.port.pre.mk>
-
.if ${ARCH} == "amd64" || ${ARCH} == "i386" || ${ARCH} == "ia64" || ${ARCH} == "powerpc"
PLIST_SUB+= INTEL_DRIVER=""
PLIST_SUB+= RADEON_DRIVERS=""
@@ -88,4 +85,4 @@ pre-patch:
s,i?86|x86_64),i?86|amd64|x86_64),g' \
${WRKSRC}/configure
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/graphics/libdrm/pkg-plist b/graphics/libdrm/pkg-plist
index b8b6ed53fb45..52b736317e29 100644
--- a/graphics/libdrm/pkg-plist
+++ b/graphics/libdrm/pkg-plist
@@ -22,8 +22,9 @@
%%NEW%%%%INTEL_DRIVER%%include/libdrm/intel_debug.h
%%NEW%%include/libdrm/mach64_drm.h
%%NEW%%include/libdrm/mga_drm.h
-%%NEW%%include/libdrm/nouveau.h
+%%NEW%%%%NOUVEAU%%include/libdrm/nouveau.h
%%NEW%%include/libdrm/nouveau_drm.h
+%%NEW%%include/libdrm/qxl_drm.h
%%NEW%%include/libdrm/r128_drm.h
%%NEW%%%%RADEON_DRIVERS%%include/libdrm/r600_pci_ids.h
%%NEW%%%%RADEON_DRIVERS%%include/libdrm/radeon_bo.h
@@ -54,10 +55,10 @@ lib/libdrm.so.2
%%INTEL_DRIVER%%lib/libdrm_intel.la
%%INTEL_DRIVER%%lib/libdrm_intel.so
%%INTEL_DRIVER%%lib/libdrm_intel.so.1
-lib/libdrm_nouveau.la
-lib/libdrm_nouveau.so
-%%OLD%%lib/libdrm_nouveau.so.1
-%%NEW%%lib/libdrm_nouveau.so.2
+%%NOUVEAU%%lib/libdrm_nouveau.la
+%%NOUVEAU%%lib/libdrm_nouveau.so
+%%OLD%%%%NOUVEAU%%lib/libdrm_nouveau.so.1
+%%NEW%%%%NOUVEAU%%lib/libdrm_nouveau.so.2
%%NEW%%%%RADEON_DRIVERS%%lib/libdrm_radeon.la
%%NEW%%%%RADEON_DRIVERS%%lib/libdrm_radeon.so
%%NEW%%%%RADEON_DRIVERS%%lib/libdrm_radeon.so.1
@@ -66,7 +67,7 @@ lib/libdrm_nouveau.so
%%NEW%%%%KMS%%lib/libkms.so.1
libdata/pkgconfig/libdrm.pc
%%INTEL_DRIVER%%libdata/pkgconfig/libdrm_intel.pc
-libdata/pkgconfig/libdrm_nouveau.pc
+%%NOUVEAU%%libdata/pkgconfig/libdrm_nouveau.pc
%%NEW%%%%RADEON_DRIVERS%%libdata/pkgconfig/libdrm_radeon.pc
%%NEW%%%%KMS%%libdata/pkgconfig/libkms.pc
%%OLD%%@dirrm include/nouveau
diff --git a/graphics/libglesv2/Makefile b/graphics/libglesv2/Makefile
new file mode 100644
index 000000000000..c48744a55079
--- /dev/null
+++ b/graphics/libglesv2/Makefile
@@ -0,0 +1,29 @@
+# Created by: kwm@FreeBSD.org
+# $FreeBSD$
+
+PORTNAME= libglesv2
+PORTVERSION= ${MESAVERSION}
+CATEGORIES= graphics
+
+COMMENT= OpenGL ES v2 library
+
+LIB_DEPENDS+= libdrm.so:${PORTSDIR}/graphics/libdrm \
+ libexpat.so:${PORTSDIR}/textproc/expat2
+
+.if ! defined(WITH_NEW_XORG)
+IGNORE= Please enable WITH_NEW_XORG, libglesv2 needs libdrm higher then 2.4.24
+.endif
+
+# stuff not needed by libEGL but configure wants it
+USE_XORG+= glproto dri2proto xext xdamage xfixes
+
+
+BUILD_WKRSRC= ${WRKSRC}/src/mapi/es2api
+INSTALL_WRKSRC= ${WRKSRC}/src/mapi/es2api
+
+# this library doesn't exist in Mesa 7.6 so use newer
+WITH_NEW_XORG=yes
+
+.include <bsd.port.options.mk>
+.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
+.include <bsd.port.mk>
diff --git a/graphics/libglesv2/pkg-descr b/graphics/libglesv2/pkg-descr
new file mode 100644
index 000000000000..b01c5db82929
--- /dev/null
+++ b/graphics/libglesv2/pkg-descr
@@ -0,0 +1,3 @@
+This package contains the GL ES v2 utility library.
+
+WWW: http://www.freedesktop.org/Software/xorg
diff --git a/graphics/libglesv2/pkg-plist b/graphics/libglesv2/pkg-plist
new file mode 100644
index 000000000000..83fc602af5b3
--- /dev/null
+++ b/graphics/libglesv2/pkg-plist
@@ -0,0 +1,12 @@
+include/GLES2/gl2.h
+include/GLES2/gl2ext.h
+include/GLES2/gl2platform.h
+include/GLES3/gl3.h
+include/GLES3/gl3ext.h
+include/GLES3/gl3platform.h
+lib/libGLESv2.la
+lib/libGLESv2.so
+lib/libGLESv2.so.2
+libdata/pkgconfig/glesv2.pc
+@dirrmtry include/GLES3
+@dirrmtry include/GLES2
diff --git a/graphics/libreatlas/Makefile b/graphics/libreatlas/Makefile
index 7a24f8275387..14a1a1c347aa 100644
--- a/graphics/libreatlas/Makefile
+++ b/graphics/libreatlas/Makefile
@@ -3,7 +3,7 @@
PORTNAME= libreatlas
PORTVERSION= 1.0.0a
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= graphics geography
MASTER_SITES= http://www.gaia-gis.it/gaia-sins/
@@ -30,8 +30,7 @@ LIB_DEPENDS= mspack:${PORTSDIR}/archivers/libmspack \
fontconfig:${PORTSDIR}/x11-fonts/fontconfig
GNU_CONFIGURE= yes
-USES= pkgconfig gettext iconv
-USE_GMAKE= yes
+USES= pkgconfig gettext gmake iconv
USE_XORG= ice pixman sm x11 xau xcb xcomposite xcursor xdamage xdmcp xext \
xfixes xi xinerama xrandr xrender xxf86vm
USE_GNOME= atk gdkpixbuf2 glib20 gtk20 pango