aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/dri/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/dri/Makefile')
-rw-r--r--graphics/dri/Makefile119
1 files changed, 62 insertions, 57 deletions
diff --git a/graphics/dri/Makefile b/graphics/dri/Makefile
index 29c2be3c4798..2dc5bf868e46 100644
--- a/graphics/dri/Makefile
+++ b/graphics/dri/Makefile
@@ -3,7 +3,7 @@
PORTNAME= dri
PORTVERSION= ${MESAVERSION}
-PORTREVISION= 5
+PORTREVISION= ${DRIREVISION}
PORTEPOCH= 2
CATEGORIES= graphics
@@ -12,31 +12,37 @@ COMMENT= OpenGL hardware acceleration drivers for the DRI
LIB_DEPENDS= libdrm.so:${PORTSDIR}/graphics/libdrm \
libexpat.so:${PORTSDIR}/textproc/expat2
-USES+= gettext:build
-USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto
+USE_XORG= glproto x11 xext xxf86vm xdamage xfixes dri2proto \
+ presentproto xvmc xshmfence
+
+OPTIONS_DEFINE= TEXTURE
+
+OPTIONS_DEFINE_i386= GALLIUM VDPAU
+OPTIONS_DEFAULT_i386= GALLIUM VDPAU
+OPTIONS_DEFINE_amd64= GALLIUM VDPAU
+OPTIONS_DEFAULT_amd64= GALLIUM VDPAU
+
+GALLIUM_DESC= Gallium (llvm backed) dri drivers
+TEXTURE_DESC= Enable texture-float support (patent encumbered)
+VDPAU_DESC= VDPAU (GPU video acceleration) support (needs Gallium)
+
+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, not for old pre-clang default current.
+# 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 defined(WITH_NEW_XORG)
-. if (${OSVERSION} >= 901500 && ${OSVERSION} < 1000000) \
- && ${ARCH} == amd64
+. if (${OSVERSION} >= 901500 && ${OSVERSION} < 1000000)
CC=clang
CXX=clang++
CPP=clang-cpp
. elif ${OSVERSION} < 901500
USE_GCC=yes
. endif
-.endif
ALL_DRI_DRIVERS=I915 I965 R200 RADEON SWRAST
-.if !defined(WITH_NEW_XORG)
-ALL_DRI_DRIVERS+=I810 MACH64 MGA R128 R300 R600 SAVAGE SIS TDFX UNICHROME
-.endif
-
.include "${.CURDIR}/../../graphics/libGL/bsd.mesalib.mk"
PLIST_SUB+= VERSION=${MESADISTVERSION}
@@ -45,42 +51,63 @@ PLIST_SUB+= VERSION=${MESADISTVERSION}
DRI_DRIVERS= ${ALL_DRI_DRIVERS}
.endif
-.if defined(WITH_NEW_XORG)
-. if !defined(WITHOUT_GALLIUM) && (${ARCH} == i386 || ${ARCH} == amd64)
-BUILD_DEPENDS+= llvm-config33:${PORTSDIR}/devel/llvm33
-CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config33
+.if defined(WITH_NEW_MESA)
+DRIREVISION= 0
+PLIST= ${.CURDIR}/pkg-plist
+.else
+DRIREVISION= 6
+PLIST= ${.CURDIR}/pkg-plist-old
+.endif
-CONFIGURE_ARGS+=--enable-gallium-llvm --disable-gallium-egl
+.if ${PORT_OPTIONS:MGALLIUM}
+. if defined(WITH_NEW_MESA)
+# keep in sync with libopencl please
+BUILD_DEPENDS+= llvm34>=0:${PORTSDIR}/devel/llvm34
+CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config34
+. else
+BUILD_DEPENDS+= llvm33>=0:${PORTSDIR}/devel/llvm33
+CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config33
+. endif
-CONFIGURE_ARGS+=--with-gallium-drivers=r300,r600,radeonsi,svga,swrast
+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
+.else
+CONFIGURE_ARGS+=--enable-gallium-llvm=no --without-gallium-drivers \
+ --disable-gallium-egl
PLIST_SUB+= GALLIUM="@comment "
-. endif
-. if ${ARCH} == powerpc || ${ARCH} == powerpc64
+.endif
+
+.if ${PORT_OPTIONS:MTEXTURE}
+CONFIGURE_ARGS+=--enable-texture-float
+.endif
+
+.if ${PORT_OPTIONS:MVDPAU}
+CONFIGURE_ARGS+=--enable-vdpau
+LIB_DEPENDS+= libvdpau.so:${PORTSDIR}/multimedia/libvdpau
+PLIST_SUB+= VDPAU=""
+.else
+CONFIGURE_ARGS+=--disable-vdpau
+PLIST_SUB+= VDPAU="@comment "
+.endif
+
+.if ${ARCH} == powerpc || ${ARCH} == powerpc64
DRI_DRIVERS= RADEON SWRAST
-. endif
-. if ${ARCH} == sparc64 || ${ARCH} == armv6
+.endif
+.if ${ARCH} == sparc64 || ${ARCH} == armv6
DRI_DRIVERS= SWRAST
-. endif
-.else # !defined(WITH_NEW_XORG)
-. if ${ARCH} == powerpc || ${ARCH} == powerpc64
-DRI_DRIVERS= MACH64 RADEON SWRAST TDFX
-. elif ${ARCH} == sparc64
-DRI_DRIVERS= MACH64 RADEON SWRAST
-. endif
-.endif # defined(WITH_NEW_XORG)
+.endif
# empty for unsupported arches
DRI_DRIVERS+=
.for _d in ${ALL_DRI_DRIVERS}
-.if ${DRI_DRIVERS:M${_d}}
+. if ${DRI_DRIVERS:M${_d}}
PLIST_SUB+= ${_d}_DRIVER=""
-.else
+. else
PLIST_SUB+= ${_d}_DRIVER="@comment "
-.endif
+. endif
.endfor
.if !(${ARCH} == amd64 || ${ARCH} == i386)
@@ -88,26 +115,4 @@ CONFIGURE_ARGS+=--disable-gallium-intel
.endif
CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
-.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
-
-post-install:
-.if defined(WITH_NEW_XORG)
- @${RM} -f ${STAGEDIR}${PREFIX}/include/GL/*.h
- @${RM} ${STAGEDIR}${PREFIX}/lib/libGL.*
- @${RM} ${STAGEDIR}${PREFIX}/lib/libglapi.*
- @${RM} -f ${STAGEDIR}${PREFIX}/libdata/pkgconfig/gl.pc
-.else
- @${RM} -f ${STAGEDIR}${PREFIX}/include/GL/*.h
- @${RM} -rf ${STAGEDIR}${PREFIX}/lib/.libGL
- @${RM} -f ${STAGEDIR}${PREFIX}/libdata/pkgconfig/gl.pc
-.endif
-
.include <bsd.port.mk>