View | Details | Raw Unified | Return to bug 218799 | Differences between
and this patch

Collapse All | Expand All

(-)MOVED (+6 lines)
Lines 9373-9375 Link Here
9373
net-mgmt/flow-tools-ng||2017-04-30|Has expired: Unfetchable for more than six months (google code has gone away)
9373
net-mgmt/flow-tools-ng||2017-04-30|Has expired: Unfetchable for more than six months (google code has gone away)
9374
devel/llvm36||2017-05-02|Obsolete and unmaintained upstream
9374
devel/llvm36||2017-05-02|Obsolete and unmaintained upstream
9375
lang/clang36||2017-05-02|Obsolete and unmaintained upstream
9375
lang/clang36||2017-05-02|Obsolete and unmaintained upstream
9376
graphics/dri|graphics/mesa-dri|2017-05-02|Renamed for clarity and consistency with graphics/mesa-libs
9377
graphics/gbm|graphics/mesa-libs|2017-05-02|Mesa libraries were merged into one port
9378
graphics/libglapi|graphics/mesa-libs|2017-05-02|Mesa libraries were merged into one port
9379
graphics/libglesv2|graphics/mesa-libs|2017-05-02|Mesa libraries were merged into one port
9380
graphics/libEGL|graphics/mesa-libs|2017-05-02|Mesa libraries were merged into one port
9381
graphics/libGL|graphics/mesa-libs|2017-05-02|Mesa libraries were merged into one port
(-)Mk/Scripts/qa.sh (-4 / +4 lines)
Lines 537-549 Link Here
537
	elif echo ${pkg} | grep -E '/sdl2_(gfx|image|mixer|net|ttf)$' > /dev/null; then
537
	elif echo ${pkg} | grep -E '/sdl2_(gfx|image|mixer|net|ttf)$' > /dev/null; then
538
		warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's|.*/sdl2_||')2"
538
		warn "you need USE_SDL+=$(echo ${pkg} | sed -E 's|.*/sdl2_||')2"
539
	# gl-related
539
	# gl-related
540
	elif [ ${pkg} = 'graphics/libGL' ]; then
540
	elif expr ${lib_file} : "${LOCALBASE}/lib/libGL.so.*$" > /dev/null; then
541
		warn "you need USE_GL+=gl"
541
		warn "you need USE_GL+=gl"
542
	elif [ ${pkg} = 'graphics/gbm' ]; then
542
	elif expr ${lib_file} : "${LOCALBASE}/lib/libgbm.so.*$" > /dev/null; then
543
		warn "you need USE_GL+=gbm"
543
		warn "you need USE_GL+=gbm"
544
	elif [ ${pkg} = 'graphics/libglesv2' ]; then
544
	elif expr ${lib_file} : "${LOCALBASE}/lib/libGLESv2.so.*$" > /dev/null; then
545
		warn "you need USE_GL+=glesv2"
545
		warn "you need USE_GL+=glesv2"
546
	elif [ ${pkg} = 'graphics/libEGL' ]; then
546
	elif expr ${lib_file} : "${LOCALBASE}/lib/libEGL.so.*$" > /dev/null; then
547
		warn "you need USE_GL+=egl"
547
		warn "you need USE_GL+=egl"
548
	elif [ ${pkg} = 'graphics/glew' ]; then
548
	elif [ ${pkg} = 'graphics/glew' ]; then
549
		warn "you need USE_GL+=glew"
549
		warn "you need USE_GL+=glew"
(-)Mk/bsd.port.mk (-10 / +9 lines)
Lines 1763-1782 Link Here
1763
1763
1764
PKG_IGNORE_DEPENDS?=		'this_port_does_not_exist'
1764
PKG_IGNORE_DEPENDS?=		'this_port_does_not_exist'
1765
1765
1766
_GL_gbm_LIB_DEPENDS=		libgbm.so:graphics/gbm
1766
_GL_gbm_LIB_DEPENDS=		libgbm.so:graphics/mesa-libs
1767
_GL_glesv2_BUILD_DEPENDS=		libglesv2>0:graphics/libglesv2
1767
_GL_glesv2_BUILD_DEPENDS=	${LOCALBASE}/lib/libGLESv2.so:graphics/mesa-libs
1768
_GL_glesv2_RUN_DEPENDS=		libglesv2>0:graphics/libglesv2
1768
_GL_glesv2_RUN_DEPENDS=		${LOCALBASE}/lib/libGLESv2.so:graphics/mesa-libs
1769
_GL_egl_BUILD_DEPENDS=		libEGL>0:graphics/libEGL
1769
_GL_egl_BUILD_DEPENDS=		${LOCALBASE}/lib/libEGL.so:graphics/mesa-libs
1770
_GL_egl_RUN_DEPENDS=		libEGL>0:graphics/libEGL
1770
_GL_egl_RUN_DEPENDS=		${LOCALBASE}/lib/libEGL.so:graphics/mesa-libs
1771
_GL_gl_BUILD_DEPENDS=		libGL>0:graphics/libGL
1771
_GL_gl_BUILD_DEPENDS=		${LOCALBASE}/lib/libGL.so:graphics/mesa-libs
1772
_GL_gl_RUN_DEPENDS=		libGL>0:graphics/libGL
1772
_GL_gl_RUN_DEPENDS=			${LOCALBASE}/lib/libGL.so:graphics/mesa-libs
1773
_GL_gl_USE_XORG=		glproto dri2proto
1773
_GL_gl_USE_XORG=			glproto dri2proto dri3proto
1774
_GL_glew_LIB_DEPENDS=		libGLEW.so:graphics/glew
1774
_GL_glew_LIB_DEPENDS=		libGLEW.so:graphics/glew
1775
_GL_glu_LIB_DEPENDS=		libGLU.so:graphics/libGLU
1775
_GL_glu_LIB_DEPENDS=		libGLU.so:graphics/libGLU
1776
_GL_glu_USE_XORG=		glproto dri2proto
1776
_GL_glu_USE_XORG=			glproto dri2proto dri3proto
1777
_GL_glw_LIB_DEPENDS=		libGLw.so:graphics/libGLw
1777
_GL_glw_LIB_DEPENDS=		libGLw.so:graphics/libGLw
1778
_GL_glut_LIB_DEPENDS=		libglut.so:graphics/freeglut
1778
_GL_glut_LIB_DEPENDS=		libglut.so:graphics/freeglut
1779
1780
.if defined(USE_GL)
1779
.if defined(USE_GL)
1781
. if ${USE_GL:tl} == "yes"
1780
. if ${USE_GL:tl} == "yes"
1782
USE_GL=		glu
1781
USE_GL=		glu
(-)Mk/bsd.xorg.mk (-1 / +1 lines)
Lines 97-103 Link Here
97
CONFIGURE_ARGS+=	--with-xkb-path=${LOCALBASE}/share/X11/xkb \
97
CONFIGURE_ARGS+=	--with-xkb-path=${LOCALBASE}/share/X11/xkb \
98
					--with-fontrootdir=${LOCALBASE}/share/fonts
98
					--with-fontrootdir=${LOCALBASE}/share/fonts
99
99
100
LIB_PC_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/dri
100
LIB_PC_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
101
USE_XORG+=	fontutil:build
101
USE_XORG+=	fontutil:build
102
. endif
102
. endif
103
103
(-)emulators/i386-wine/Makefile.i386 (-1 / +1 lines)
Lines 12-18 Link Here
12
PKGINSTALL=	${SLAVEDIR}/files/pkg-install
12
PKGINSTALL=	${SLAVEDIR}/files/pkg-install
13
PKGDEINSTALL=	${PKGINSTALL}
13
PKGDEINSTALL=	${PKGINSTALL}
14
14
15
RUN_DEPENDS=	dri>0:graphics/dri
15
RUN_DEPENDS=	mesa-dri>0:graphics/mesa-dri
16
16
17
CONFLICTS_INSTALL?=	wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \
17
CONFLICTS_INSTALL?=	wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \
18
			i386-wine-staging-[0-9]* i386-wine-devel-[0-9]*
18
			i386-wine-staging-[0-9]* i386-wine-devel-[0-9]*
(-)emulators/i386-wine-devel/Makefile.i386 (-1 / +1 lines)
Lines 12-18 Link Here
12
PKGINSTALL=	${SLAVEDIR}/files/pkg-install
12
PKGINSTALL=	${SLAVEDIR}/files/pkg-install
13
PKGDEINSTALL=	${PKGINSTALL}
13
PKGDEINSTALL=	${PKGINSTALL}
14
14
15
RUN_DEPENDS=	dri>0:graphics/dri
15
RUN_DEPENDS=	mesa-dri>0:graphics/mesa-dri
16
16
17
CONFLICTS_INSTALL?=	wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \
17
CONFLICTS_INSTALL?=	wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \
18
			i386-wine-[0-9]* i386-wine-staging-[0-9]*
18
			i386-wine-[0-9]* i386-wine-staging-[0-9]*
(-)graphics/Makefile (-6 / +2 lines)
Lines 144-150 Link Here
144
    SUBDIR += djview4-qt4
144
    SUBDIR += djview4-qt4
145
    SUBDIR += djvulibre
145
    SUBDIR += djvulibre
146
    SUBDIR += dmtx-utils
146
    SUBDIR += dmtx-utils
147
    SUBDIR += dri
148
    SUBDIR += driconf
147
    SUBDIR += driconf
149
    SUBDIR += dspdfviewer
148
    SUBDIR += dspdfviewer
150
    SUBDIR += duhdraw
149
    SUBDIR += duhdraw
Lines 214-220 Link Here
214
    SUBDIR += fyre
213
    SUBDIR += fyre
215
    SUBDIR += g2
214
    SUBDIR += g2
216
    SUBDIR += gauche-gl
215
    SUBDIR += gauche-gl
217
    SUBDIR += gbm
218
    SUBDIR += gcolor
216
    SUBDIR += gcolor
219
    SUBDIR += gcolor2
217
    SUBDIR += gcolor2
220
    SUBDIR += gcolor3
218
    SUBDIR += gcolor3
Lines 469-476 Link Here
469
    SUBDIR += leptonica
467
    SUBDIR += leptonica
470
    SUBDIR += lfview
468
    SUBDIR += lfview
471
    SUBDIR += lib3ds
469
    SUBDIR += lib3ds
472
    SUBDIR += libEGL
473
    SUBDIR += libGL
474
    SUBDIR += libGLU
470
    SUBDIR += libGLU
475
    SUBDIR += libGLw
471
    SUBDIR += libGLw
476
    SUBDIR += libafterimage
472
    SUBDIR += libafterimage
Lines 493-500 Link Here
493
    SUBDIR += libgaiagraphics
489
    SUBDIR += libgaiagraphics
494
    SUBDIR += libgeotiff
490
    SUBDIR += libgeotiff
495
    SUBDIR += libgfx
491
    SUBDIR += libgfx
496
    SUBDIR += libglapi
497
    SUBDIR += libglesv2
498
    SUBDIR += libgltext
492
    SUBDIR += libgltext
499
    SUBDIR += libgltf
493
    SUBDIR += libgltf
500
    SUBDIR += libgnomecanvas
494
    SUBDIR += libgnomecanvas
Lines 588-593 Link Here
588
    SUBDIR += mapyrus
582
    SUBDIR += mapyrus
589
    SUBDIR += megapov
583
    SUBDIR += megapov
590
    SUBDIR += mesa-demos
584
    SUBDIR += mesa-demos
585
    SUBDIR += mesa-dri
586
    SUBDIR += mesa-libs
591
    SUBDIR += meshviewer
587
    SUBDIR += meshviewer
592
    SUBDIR += metacam
588
    SUBDIR += metacam
593
    SUBDIR += metapixel
589
    SUBDIR += metapixel
(-)graphics/copperspice/Makefile (-2 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	copperspice
4
PORTNAME=	copperspice
5
PORTVERSION=	1.3.2
5
PORTVERSION=	1.3.2
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	graphics
7
CATEGORIES=	graphics
8
MASTER_SITES=	http://download.copperspice.com/copperspice/source/
8
MASTER_SITES=	http://download.copperspice.com/copperspice/source/
9
9
Lines 17-23 Link Here
17
		libexpat.so:textproc/expat2 \
17
		libexpat.so:textproc/expat2 \
18
		libffi.so:devel/libffi \
18
		libffi.so:devel/libffi \
19
		libfreetype.so:print/freetype2 \
19
		libfreetype.so:print/freetype2 \
20
		libglapi.so:graphics/libglapi \
21
		libgstbase-0.10.so:multimedia/gstreamer \
20
		libgstbase-0.10.so:multimedia/gstreamer \
22
		libgstreamer-0.10.so:multimedia/gstreamer \
21
		libgstreamer-0.10.so:multimedia/gstreamer \
23
		libpcre.so:devel/pcre \
22
		libpcre.so:devel/pcre \
(-)graphics/dri/Makefile (-46 lines)
Lines 1-46 Link Here
1
# Created by: Eric Anholt <anholt@FreeBSD.org>
2
# $FreeBSD$
3
4
PORTNAME=	dri
5
PORTVERSION=	${MESAVERSION}
6
PORTEPOCH=	2
7
CATEGORIES=	graphics
8
9
COMMENT=	OpenGL hardware acceleration drivers for the DRI
10
11
LIB_DEPENDS=	libdrm.so:graphics/libdrm \
12
		libexpat.so:textproc/expat2
13
14
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xdamage xext \
15
		xfixes xshmfence xv xvmc xxf86vm 
16
17
OPTIONS_DEFINE=	TEXTURE VAAPI VDPAU
18
OPTIONS_DEFAULT=TEXTURE
19
OPTIONS_SUB=	yes
20
21
TEXTURE_DESC=	Enable texture-float support (patent encumbered)
22
TEXTURE_CONFIGURE_ENABLE=	texture-float
23
24
VAAPI_CONFIGURE_ENABLE=	va
25
VAAPI_LIB_DEPENDS=	libva.so:multimedia/libva
26
VAAPI_USE=		XORG=xcb
27
28
VDPAU_CONFIGURE_ENABLE=	vdpau
29
VDPAU_LIB_DEPENDS=	libvdpau.so:multimedia/libvdpau
30
31
PKGHELP=	${.CURDIR}/pkg-help
32
33
.include <bsd.port.options.mk>
34
35
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
36
37
#src/mesa/libmesagallium.la
38
#MESA_BUILD_WRKSRC=	src/util src/gallium
39
#MESA_INSTALL_WRKSRC=	src/gallium
40
41
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
42
43
post-install:
44
	@${RM} -r ${STAGEDIR}/etc/OpenCL
45
46
.include <bsd.port.mk>
(-)graphics/dri/pkg-descr (-5 lines)
Lines 1-5 Link Here
1
This package contains the current stable release of the client drivers for the
2
DRI.  With an X Server configured for the DRI they allow direct rendering of
3
hardware-accelerated OpenGL.
4
5
WWW: http://dri.sourceforge.net/
(-)graphics/dri/pkg-help (-15 lines)
Lines 1-15 Link Here
1
VAAPI and VDPAU options enable building Gallium based VA-API and VDPAU
2
drivers to decode video on the GPU via libva and libvdpau, respectively.
3
Gallium based VAAPI and VDPAU drivers are only available for Radeon GPUs.
4
5
Both GPU decode options require newer drm drivers than are currently present
6
in a released FreeBSD kernel. These are options for DRM-next and DragonFly.
7
8
The TEXTURE option enables texture-float support, which SGI claims requires
9
US Patent #6,650,327 [1], filed Jun 16, 1998 thus expiring on Jun 16, 2018.
10
Use may require a license depending on jurisdiction, consult a lawyer.
11
12
See docs/patents.txt in the Mesa tarball or the following URLs:
13
14
[1] https://www.google.com/patents/US6650327
15
[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt
(-)graphics/dri/pkg-plist (-89 lines)
Lines 1-89 Link Here
1
etc/drirc
2
@comment include/EGL/egl.h
3
@comment include/EGL/eglext.h
4
@comment include/EGL/eglextchromium.h
5
@comment include/EGL/eglmesaext.h
6
@comment include/EGL/eglplatform.h
7
@comment include/GL/gl.h
8
@comment include/GL/gl_mangle.h
9
@comment include/GL/glcorearb.h
10
@comment include/GL/glext.h
11
@comment include/GL/glx.h
12
@comment include/GL/glx_mangle.h
13
@comment include/GL/glxext.h
14
include/GL/internal/dri_interface.h
15
@comment include/GL/osmesa.h
16
@comment include/GLES2/gl2.h
17
@comment include/GLES2/gl2ext.h
18
@comment include/GLES2/gl2platform.h
19
@comment include/GLES3/gl3.h
20
@comment include/GLES3/gl31.h
21
@comment include/GLES3/gl32.h
22
@comment include/GLES3/gl3ext.h
23
@comment include/GLES3/gl3platform.h
24
@comment include/KHR/khrplatform.h
25
@comment include/gbm.h
26
%%I915_DRIVER%%lib/dri/i915_dri.so
27
%%I965_DRIVER%%lib/dri/i965_dri.so
28
%%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so
29
%%R200_DRIVER%%lib/dri/r200_dri.so
30
%%R300_GDRIVER%%lib/dri/r300_dri.so
31
%%R600_GDRIVER%%lib/dri/r600_dri.so
32
%%VAAPI%%%%R600_GDRIVER%%lib/dri/r600_drv_video.so
33
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
34
%%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so
35
%%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so
36
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
37
%%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so
38
@comment lib/gallium-pipe/pipe_r300.so
39
@comment lib/gallium-pipe/pipe_r600.so
40
@comment lib/gallium-pipe/pipe_radeonsi.so
41
@comment lib/gallium-pipe/pipe_swrast.so
42
@comment lib/gallium-pipe/pipe_vmwgfx.so
43
@comment lib/libEGL.so
44
@comment lib/libEGL.so.1
45
@comment lib/libEGL.so.1.0.0
46
@comment lib/libGL.so
47
@comment lib/libGL.so.1
48
@comment lib/libGL.so.1.2.0
49
@comment lib/libGLESv2.so
50
@comment lib/libGLESv2.so.2
51
@comment lib/libGLESv2.so.2.0.0
52
@comment lib/libMesaOpenCL.so
53
@comment lib/libMesaOpenCL.so.1
54
@comment lib/libMesaOpenCL.so.1.0.0
55
@comment lib/libOSMesa.so
56
@comment lib/libOSMesa.so.8
57
@comment lib/libOSMesa.so.8.0.0
58
%%R600_GDRIVER%%lib/libXvMCr600.so
59
%%R600_GDRIVER%%lib/libXvMCr600.so.1
60
%%R600_GDRIVER%%lib/libXvMCr600.so.1.0
61
%%R600_GDRIVER%%lib/libXvMCr600.so.1.0.0
62
@comment lib/libgbm.so
63
@comment lib/libgbm.so.1
64
@comment lib/libgbm.so.1.0.0
65
@comment lib/libglapi.so
66
@comment lib/libglapi.so.0
67
@comment lib/libglapi.so.0.0.0
68
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so
69
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1
70
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0
71
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0.0
72
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so
73
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1
74
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0
75
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0.0
76
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so
77
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1
78
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
79
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
80
@comment lib/libwayland-egl.so
81
@comment lib/libwayland-egl.so.1
82
@comment lib/libwayland-egl.so.1.0.0
83
libdata/pkgconfig/dri.pc
84
@comment libdata/pkgconfig/egl.pc
85
@comment libdata/pkgconfig/gbm.pc
86
@comment libdata/pkgconfig/gl.pc
87
@comment libdata/pkgconfig/glesv2.pc
88
@comment libdata/pkgconfig/osmesa.pc
89
@comment libdata/pkgconfig/wayland-egl.pc
(-)graphics/gbm/Makefile (-30 lines)
Lines 1-30 Link Here
1
# Created by: kwm@FreeBSD.org
2
# $FreeBSD$
3
4
PORTNAME=	gbm
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
8
9
COMMENT=	gbm library
10
11
BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
12
LIB_DEPENDS+=	libexpat.so:textproc/expat2 \
13
		libdrm.so:graphics/libdrm \
14
		libglapi.so:graphics/libglapi
15
16
USE_XORG=	x11 xau xcb xdmcp
17
18
# stuff not needed by gbm but configure wants it
19
USE_XORG+=	dri2proto dri3proto glproto presentproto xdamage xext xfixes \
20
		xshmfence
21
22
.include <bsd.port.options.mk>
23
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
24
25
MESA_BUILD_WRKSRC=	src/mapi src/gbm
26
MESA_INSTALL_WRKSRC=	src/gbm
27
28
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
29
30
.include <bsd.port.mk>
(-)graphics/gbm/pkg-descr (-3 lines)
Lines 1-3 Link Here
1
This package contains the gbm utility library.
2
3
WWW: http://mesa3d.org/
(-)graphics/gbm/pkg-plist (-5 lines)
Lines 1-5 Link Here
1
include/gbm.h
2
lib/libgbm.so
3
lib/libgbm.so.1
4
lib/libgbm.so.1.0.0
5
libdata/pkgconfig/gbm.pc
(-)graphics/libEGL/Makefile (-30 lines)
Lines 1-30 Link Here
1
# Created by: kwm@FreeBSD.org
2
# $FreeBSD$
3
4
PORTNAME=	libEGL
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
8
9
COMMENT=	OpenEGL library
10
11
BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
12
LIB_DEPENDS+=	libexpat.so:textproc/expat2 \
13
		libdrm.so:graphics/libdrm
14
15
USE_GL=		gbm
16
USE_XORG=	x11 xau xcb xdmcp
17
18
# stuff not needed by libEGL but configure wants it
19
USE_XORG+=	dri2proto dri3proto glproto presentproto xdamage xext xfixes \
20
		xshmfence
21
22
.include <bsd.port.options.mk>
23
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
24
25
MESA_BUILD_WRKSRC=	src/mapi src/gbm src/egl/
26
MESA_INSTALL_WRKSRC=	src/egl
27
28
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
29
30
.include <bsd.port.mk>
(-)graphics/libEGL/pkg-descr (-3 lines)
Lines 1-3 Link Here
1
This package contains the EGL utility library.
2
3
WWW: http://mesa3d.org/
(-)graphics/libEGL/pkg-plist (-10 lines)
Lines 1-10 Link Here
1
include/EGL/egl.h
2
include/EGL/eglext.h
3
include/EGL/eglextchromium.h
4
include/EGL/eglmesaext.h
5
include/EGL/eglplatform.h
6
include/KHR/khrplatform.h
7
lib/libEGL.so
8
lib/libEGL.so.1
9
lib/libEGL.so.1.0.0
10
libdata/pkgconfig/egl.pc
(-)graphics/libGL/Makefile (-30 lines)
Lines 1-30 Link Here
1
# Created by: Eric Anholt <anholt@FreeBSD.org>
2
# $FreeBSD$
3
4
PORTNAME=	libGL
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
8
9
COMMENT=	OpenGL library that renders using GLX or DRI
10
11
LIB_DEPENDS+=	libdrm.so:graphics/libdrm \
12
		libglapi.so:graphics/libglapi \
13
		libexpat.so:textproc/expat2
14
15
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xcb xdamage xext \
16
		xfixes xshmfence xxf86vm
17
18
.include <bsd.port.options.mk>
19
.include "${.CURDIR}/Makefile.common"
20
21
MESA_BUILD_WRKSRC=	src/mapi src/glx
22
MESA_INSTALL_WRKSRC=	src/glx
23
24
.include "${.CURDIR}/Makefile.targets"
25
26
post-install:
27
	@cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \
28
		${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS
29
30
.include <bsd.port.mk>
(-)graphics/libGL/Makefile.common (-173 lines)
Lines 1-173 Link Here
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=	17.0.3
22
# if there is a subversion, don't include the '-' between 7.11-rc2.
23
MESASUBVERSION=
24
25
MASTER_SITES=	https://mesa.freedesktop.org/archive/ \
26
		https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
27
		ftp://ftp.freedesktop.org/pub/mesa/ \
28
		ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
29
30
DISTFILES=	mesa-${MESADISTVERSION}${EXTRACT_SUFX}
31
32
MAINTAINER=	x11@FreeBSD.org
33
34
BUILD_DEPENDS+=	makedepend:devel/makedepend
35
36
USES+=		compiler:c++11-lib bison gettext-tools gmake libtool \
37
		localbase pathfix pkgconfig python:2,build shebangfix tar:xz
38
USE_LDCONFIG=	yes
39
GNU_CONFIGURE=	yes
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
WRKSRC=		${WRKDIR}/mesa-${MESADISTVERSION}
59
DESCR=		${.CURDIR}/pkg-descr
60
PLIST=		${.CURDIR}/pkg-plist
61
INSTALL_TARGET=	install-strip
62
63
COMPONENT=	${PORTNAME:tl:C/^lib//:C/mesa-//}
64
65
.if (${ARCH} != sparc64 && ${ARCH} != ia64)	# no working LLVM
66
MESA_LLVM_VER?=	40
67
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib
68
.endif
69
70
# There are issues that need to be fixed to use TLS model "initial-exec"
71
# So stick with "global-dynamic"'s model for now. kan@ is working on a
72
# patch for rtld. We might want to backport global-dynamic or
73
# pthread_setspecific which it uses now by default. But since this
74
# configure switch is going away ...
75
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
76
CONFIGURE_ARGS+=	--disable-glx-tls
77
78
# libEGL, dri and clover need gallium enabled.
79
# the third option in --with-egl-platforms is wayland.
80
.if (${MESA_LLVM_VER} != "")
81
CONFIGURE_ARGS+=	--enable-egl --with-egl-platforms=x11,drm
82
.else
83
CONFIGURE_ARGS+=	--disable-egl
84
.endif
85
86
# we don't care about GLes v1
87
CONFIGURE_ARGS+=	--disable-gles1 --enable-gles2
88
89
# Clover (OpenCL).
90
.if ${OPSYS} == DragonFly || \
91
	(${OPSYS} == FreeBSD && \
92
		(${ARCH} == amd64 || ${ARCH} == i386))
93
94
BUILD_DEPENDS+=	libclc>=0.2.0.20160915:devel/libclc
95
96
# We need the clang port too even if it is not used to compile because
97
# Clover needs some of the clang includes to build.
98
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Mosmesa} != ""
99
_USES_pre_configure+=	290:clover-pre-configure
100
101
# .if !exists() evaluates too early before cairo has a chance to be installed
102
clover-pre-configure:
103
	@if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \
104
		! [ -e ${LOCALBASE}/bin/clang${MESA_LLVM_VER} ]; then \
105
		${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not build with clang support, which is required."; \
106
		${FALSE}; \
107
	fi
108
.endif
109
110
CONFIGURE_ARGS+=	--enable-opencl --enable-opencl-icd
111
.else
112
CONFIGURE_ARGS+=	--disable-opencl
113
.endif
114
115
CONFIGURE_ARGS+=	--enable-osmesa --enable-xvmc
116
117
# gallium
118
.if (${MESA_LLVM_VER} != "")
119
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
120
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != ""
121
RUN_DEPENDS+=   llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
122
.endif
123
124
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
125
126
CONFIGURE_ARGS+=	--enable-gallium-llvm --enable-llvm-shared-libs
127
.else
128
CONFIGURE_ARGS+=	--disable-gallium-llvm
129
.endif
130
131
ALL_DRI_DRIVERS=	I915 I965 RADEON R200 SWRAST
132
ALL_GALLIUM_DRIVERS=	R300 R600 RADEONSI SVGA SWRAST
133
134
.if ${ARCH} == amd64 || ${ARCH} == i386
135
DRI_DRIVERS=		I915 I965 RADEON R200
136
GALLIUM_DRIVERS=	R300 R600 RADEONSI SVGA
137
.endif
138
139
.if ${ARCH} == powerpc || ${ARCH} == powerpc64
140
DRI_DRIVERS=		RADEON R200
141
GALLIUM_DRIVERS=	R300 R600 RADEONSI
142
.endif
143
144
# software rendering for all arches
145
DRI_DRIVERS+=		SWRAST
146
GALLIUM_DRIVERS+=	SWRAST
147
148
.for _d in ${ALL_DRI_DRIVERS}
149
. if ${DRI_DRIVERS:M${_d}}
150
PLIST_SUB+=	${_d}_DRIVER=""
151
. else
152
PLIST_SUB+=	${_d}_DRIVER="@comment "
153
. endif
154
.endfor
155
156
CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}"
157
158
.for _gd in ${ALL_GALLIUM_DRIVERS}
159
. if ${GALLIUM_DRIVERS:M${_gd}}
160
PLIST_SUB+=	${_gd}_GDRIVER=""
161
. else
162
PLIST_SUB+=	${_gd}_GDRIVER="@comment "
163
. endif
164
.endfor
165
166
.if (${MESA_LLVM_VER} != "")
167
CONFIGURE_ARGS+=--with-gallium-drivers="${GALLIUM_DRIVERS:tl}"
168
.endif
169
170
.if ${OPSYS} == DragonFly
171
LIB_DEPENDS+= libelf.so:devel/libelf
172
.endif
173
(-)graphics/libGL/Makefile.targets (-55 lines)
Lines 1-55 Link Here
1
# $FreeBSD$
2
#
3
# this file holds common targets
4
5
post-patch:
6
.if ${OPSYS} == FreeBSD
7
	@${REINPLACE_CMD} -e 's|x86_64|amd64|' \
8
		${WRKSRC}/configure
9
# Clang 3.4 in 10.x on i386 fails with the following error when using "GCC atomics"
10
#
11
# glsl/cache.c:613:4: error: cannot compile this atomic library call yet
12
#   p_atomic_add(cache->size, size); note: expanded from macro 'p_atomic_add'
13
# define p_atomic_add(v, i) (void) __atomic_add_fetch((v), (i), __ATOMIC_ACQ_REL)
14
#
15
.if ${OSVERSION} < 1100000 && ${ARCH} == "i386"
16
	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure
17
.endif
18
.else # ${OPSYS} == DragonFly
19
#	Sed on dragonfly doesn't support \< or \>
20
	@${REINPLACE_CMD} -e 's|\\>//|[[:>:]]//|' \
21
		${WRKSRC}/configure
22
.endif # ${OPSYS}
23
	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
24
		${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c
25
	@${REINPLACE_CMD} -e 's|#!/use/bin/python|#!${PYTHON_CMD}|g' \
26
		${WRKSRC}/src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py
27
	@${REINPLACE_CMD} -e 's|!/use/bin/python2|!${PYTHON_CMD}|g' \
28
		${WRKSRC}/src/mesa/main/get_hash_generator.py \
29
		${WRKSRC}/src/mapi/glapi/gen/gl_enums.py \
30
		${WRKSRC}/src/mapi/glapi/gen/gl_table.py
31
32
pre-build: mesa-pre-build
33
34
#custom targets so we can build parts of Mesa
35
mesa-pre-build:
36
# do propper gmake target.
37
	@cd ${WRKSRC}/src/mesa/drivers/dri/common/ && ${MAKE_CMD}
38
	@cd ${WRKSRC}/src/loader && ${MAKE_CMD}
39
# libloader.la
40
41
.if defined(MESA_BUILD_WRKSRC)
42
do-build:
43
. for dir in ${MESA_BUILD_WRKSRC}
44
	(cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};)
45
. endfor
46
.endif
47
48
.if defined(MESA_INSTALL_WRKSRC)
49
do-install:
50
. for dir in ${MESA_INSTALL_WRKSRC}
51
	(cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
52
		${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
53
. endfor
54
.endif
55
(-)graphics/libGL/distinfo (-3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1491068637
2
SHA256 (mesa-17.0.3.tar.xz) = ca646f5075a002d60ef9123c8a4331cede155c01712ef945a65c59a5e69fe7ed
3
SIZE (mesa-17.0.3.tar.xz) = 9485792
(-)graphics/libGL/files/configure.ac (-78 lines)
Lines 1-78 Link Here
1
--- configure.ac.orig	2017-04-01 15:33:36 UTC
2
+++ configure.ac
3
@@ -943,18 +943,19 @@ llvm_add_target() {
4
 # $1 is the llvm-config command with arguments.
5
 strip_unwanted_llvm_flags() {
6
     # Use \> (marks the end of the word)
7
-    echo " `$1`" | sed \
8
-        -e 's/\s\+-m\S*//g' \
9
-        -e 's/\s\+-DNDEBUG\>//g' \
10
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
11
-        -e 's/\s\+-pedantic\>//g' \
12
-        -e 's/\s\+-W\S*//g' \
13
-        -e 's/\s\+-O\S*//g' \
14
-        -e 's/\s\+-g\S*//g' \
15
+    echo " `$1`" | sed -E \
16
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
17
+        -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
18
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
19
+        -e 's/[[[:space:]]]+-pedantic\>//g' \
20
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
21
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
22
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
23
         -e 's/-fno-rtti\>/-Fno-rtti/g' \
24
-        -e 's/\s\+-f\S*//g' \
25
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
26
         -e 's/-Fno-rtti\>/-fno-rtti/g' \
27
-        -e 's/^ //'
28
+        -e 's/-fno-exceptions\>//g' \
29
+        -e 's/^[[[:space:]]]//'
30
 }
31
 
32
 llvm_set_environment_variables() {
33
@@ -1121,7 +1122,7 @@ fi
34
 AC_SUBST(LIBSENSORS_LIBS)
35
 
36
 case "$host_os" in
37
-linux*)
38
+linux* | freebsd*)
39
     dri3_default=yes
40
     ;;
41
 *)
42
@@ -1631,7 +1632,7 @@ dnl platform checks. Set DEFINES and LIB
43
 if test "x$enable_dri" = xyes; then
44
     # Platform specific settings and drivers to build
45
     case "$host_os" in
46
-    linux*)
47
+    linux* | freebsd*)
48
         if test "x$enable_dri3" = xyes; then
49
             DEFINES="$DEFINES -DHAVE_DRI3"
50
         fi
51
@@ -2002,9 +2003,18 @@ if test "x$enable_opencl" = xyes; then
52
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
53
     fi
54
 
55
+    if test "x$acv_mesa_CLANG" = xno; then
56
+
57
+    GCC_VERSION=`$CC -dumpversion`
58
+    if test $? -eq 0; then
59
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
60
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
61
+    fi
62
+
63
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
64
         AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
65
     fi
66
+    fi # end of clang test
67
 
68
     if test "x$have_libclc" = xno; then
69
         AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
70
@@ -2061,8 +2071,6 @@ if test "x$enable_opencl" = xyes; then
71
         CLANG_LIBDIR=${LLVM_LIBDIR}
72
     fi
73
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
74
-    AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
75
-        [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
76
 fi
77
 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
78
 AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
(-)graphics/libGL/files/patch-configure (-80 lines)
Lines 1-80 Link Here
1
--- configure.orig	2017-04-01 15:33:50 UTC
2
+++ configure
3
@@ -22351,18 +22351,19 @@ llvm_add_target() {
4
 # $1 is the llvm-config command with arguments.
5
 strip_unwanted_llvm_flags() {
6
     # Use \> (marks the end of the word)
7
-    echo " `$1`" | sed \
8
-        -e 's/\s\+-m\S*//g' \
9
-        -e 's/\s\+-DNDEBUG\>//g' \
10
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
11
-        -e 's/\s\+-pedantic\>//g' \
12
-        -e 's/\s\+-W\S*//g' \
13
-        -e 's/\s\+-O\S*//g' \
14
-        -e 's/\s\+-g\S*//g' \
15
+    echo " `$1`" | sed -E \
16
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
17
+        -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
18
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
19
+        -e 's/[[[:space:]]]+-pedantic\>//g' \
20
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
21
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
22
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
23
         -e 's/-fno-rtti\>/-Fno-rtti/g' \
24
-        -e 's/\s\+-f\S*//g' \
25
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
26
         -e 's/-Fno-rtti\>/-fno-rtti/g' \
27
-        -e 's/^ //'
28
+        -e 's/-fno-exceptions\>//g' \
29
+        -e 's/^[[[:space:]]]//'
30
 }
31
 
32
 llvm_set_environment_variables() {
33
@@ -22560,7 +22561,7 @@ fi
34
 
35
 
36
 case "$host_os" in
37
-linux*)
38
+linux* | freebsd*)
39
     dri3_default=yes
40
     ;;
41
 *)
42
@@ -24099,7 +24100,7 @@ fi
43
 if test "x$enable_dri" = xyes; then
44
     # Platform specific settings and drivers to build
45
     case "$host_os" in
46
-    linux*)
47
+    linux* | freebsd*)
48
         if test "x$enable_dri3" = xyes; then
49
             DEFINES="$DEFINES -DHAVE_DRI3"
50
         fi
51
@@ -25851,9 +25852,19 @@ if test "x$enable_opencl" = xyes; then
52
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
53
     fi
54
 
55
+    if test "x$acv_mesa_CLANG" = xno; then
56
+
57
+    GCC_VERSION=`$CC -dumpversion`
58
+    if test $? -eq 0; then
59
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
60
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
61
+    fi
62
+
63
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
64
         as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5
65
     fi
66
+# end of clang test.
67
+    fi
68
 
69
     if test "x$have_libclc" = xno; then
70
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
71
@@ -25916,9 +25927,6 @@ rm -f core conftest.err conftest.$ac_obj
72
         CLANG_LIBDIR=${LLVM_LIBDIR}
73
     fi
74
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
75
-    if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
76
-  as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
77
-fi
78
 fi
79
  if test "x$enable_opencl" = xyes; then
80
   HAVE_CLOVER_TRUE=
(-)graphics/libGL/files/patch-include_GL_internal_dri__interface.h (-19 lines)
Lines 1-19 Link Here
1
GCC on 9.x doesn't allow types to be overwritten, these types are defined
2
in drm.h also, which causes build issues in xorg-server.
3
4
--- include/GL/internal/dri_interface.h.orig	2016-11-10 22:05:17 UTC
5
+++ include/GL/internal/dri_interface.h
6
@@ -40,13 +40,7 @@
7
 #ifndef DRI_INTERFACE_H
8
 #define DRI_INTERFACE_H
9
 
10
-#ifdef HAVE_LIBDRM
11
 #include <drm.h>
12
-#else
13
-typedef unsigned int drm_context_t;
14
-typedef unsigned int drm_drawable_t;
15
-typedef struct drm_clip_rect drm_clip_rect_t;
16
-#endif
17
 
18
 /**
19
  * \name DRI interface structures
(-)graphics/libGL/files/patch-src_egl_drivers_dri2_platform__x11.c (-16 lines)
Lines 1-16 Link Here
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
2
#
3
--- src/egl/drivers/dri2/platform_x11.c.orig	2017-04-01 15:33:36 UTC
4
+++ src/egl/drivers/dri2/platform_x11.c
5
@@ -1507,7 +1507,11 @@
6
 
7
    if (!getenv("LIBGL_ALWAYS_SOFTWARE")) {
8
 #ifdef HAVE_DRI3
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
10
+      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
11
+#else
12
       if (!getenv("LIBGL_DRI3_DISABLE"))
13
+#endif
14
          initialized = dri2_initialize_x11_dri3(drv, disp);
15
 #endif
16
 
(-)graphics/libGL/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c (-118 lines)
Lines 1-118 Link Here
1
Revert the following commit.
2
3
FreeBSD and DragonFly don't have the required render nodes.
4
5
-------
6
7
From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
8
From: Emil Velikov <emil.l.velikov@gmail.com>
9
Date: Mon, 29 Jun 2015 12:36:45 +0100
10
Subject: pipe-loader: drop support for non-render node devices
11
12
Render nodes have been around for quite some time. Removing support via
13
the master/primary node allows us to clean up the conditional
14
compilation and simplify the build greatly.
15
16
For example currently we the pipe-loader, which explicitly links against
17
xcb and friends (for X auth) if found at compile-time. That
18
would cause problems as one will be forced to use X/xcb, even if it's a
19
headless system that is used for opencl.
20
21
v2: Clarify the linking topic in the commit message.
22
23
Cc: Tom Stellard <thomas.stellard@amd.com>
24
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
25
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
26
27
28
--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig	2017-04-01 15:33:37 UTC
29
+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
30
@@ -225,6 +225,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
31
 }
32
 
33
 static int
34
+open_drm_minor(int minor)
35
+{
36
+   char path[PATH_MAX];
37
+   snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
38
+   return open(path, O_RDWR, 0);
39
+}
40
+
41
+static int
42
 open_drm_render_node_minor(int minor)
43
 {
44
    char path[PATH_MAX];
45
@@ -236,8 +244,15 @@ open_drm_render_node_minor(int minor)
46
 int
47
 pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
48
 {
49
-   int i, j, fd;
50
+   int i, k, fd, num_render_node_devs;
51
+   int j = 0;
52
+
53
+   struct {
54
+      unsigned vendor_id;
55
+      unsigned chip_id;
56
+   } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
57
 
58
+   /* Look for render nodes first */
59
    for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
60
         i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
61
       struct pipe_loader_device *dev;
62
@@ -251,6 +266,9 @@ pipe_loader_drm_probe(struct pipe_loader
63
          continue;
64
       }
65
 
66
+      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
67
+      render_node_devs[j].chip_id = dev->u.pci.chip_id;
68
+
69
       if (j < ndev) {
70
          devs[j] = dev;
71
       } else {
72
@@ -260,6 +278,46 @@ pipe_loader_drm_probe(struct pipe_loader
73
       j++;
74
    }
75
 
76
+   num_render_node_devs = j;
77
+
78
+   /* Next look for drm devices. */
79
+   for (i = 0; i < DRM_MAX_MINOR; i++) {
80
+      struct pipe_loader_device *dev;
81
+      boolean duplicate = FALSE;
82
+      fd = open_drm_minor(i);
83
+      if (fd < 0)
84
+         continue;
85
+
86
+      if (!pipe_loader_drm_probe_fd(&dev, fd)) {
87
+         close(fd);
88
+         continue;
89
+      }
90
+
91
+      /* Check to make sure we aren't already accessing this device via
92
+       * render nodes.
93
+       */
94
+      for (k = 0; k < num_render_node_devs; k++) {
95
+         if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
96
+             dev->u.pci.chip_id == render_node_devs[k].chip_id) {
97
+            close(fd);
98
+            dev->ops->release(&dev);
99
+            duplicate = TRUE;
100
+            break;
101
+         }
102
+      }
103
+
104
+      if (duplicate)
105
+         continue;
106
+
107
+      if (j < ndev) {
108
+         devs[j] = dev;
109
+      } else {
110
+         dev->ops->release(&dev);
111
+      }
112
+
113
+      j++;
114
+   }
115
+
116
    return j;
117
 }
118
 
(-)graphics/libGL/files/patch-src_gallium_auxiliary_util_u__network.c (-11 lines)
Lines 1-11 Link Here
1
--- src/gallium/auxiliary/util/u_network.c.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/auxiliary/util/u_network.c
3
@@ -6,7 +6,7 @@
4
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
5
 #  include <winsock2.h>
6
 #  include <windows.h>
7
-#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
8
+#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \
9
    defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
10
 #  include <sys/socket.h>
11
 #  include <netinet/in.h>
(-)graphics/libGL/files/patch-src_gallium_include_pipe_p__config.h (-38 lines)
Lines 1-38 Link Here
1
--- src/gallium/include/pipe/p_config.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/include/pipe/p_config.h
3
@@ -76,6 +76,13 @@
4
 #define PIPE_CC_ICL
5
 #endif
6
 
7
+#if defined(__sparc__) || defined(__sparc64__)
8
+#define PIPE_ARCH_SPARC
9
+#if defined(__sparc64__)
10
+#define PIPE_ARCH_SPARC_64
11
+#endif
12
+#endif
13
+
14
 
15
 /*
16
  * Processor architecture
17
@@ -130,7 +137,7 @@
18
 
19
 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
20
 #define PIPE_ARCH_LITTLE_ENDIAN
21
-#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
22
+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
23
 #define PIPE_ARCH_BIG_ENDIAN
24
 #endif
25
 
26
@@ -159,6 +166,12 @@
27
 #define PIPE_OS_ANDROID
28
 #endif
29
 
30
+#if defined(__DragonFly__)
31
+#define PIPE_OS_DRAGONFLY
32
+#define PIPE_OS_BSD
33
+#define PIPE_OS_UNIX
34
+#endif
35
+
36
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
37
 #define PIPE_OS_FREEBSD
38
 #define PIPE_OS_BSD
(-)graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp (-30 lines)
Lines 1-30 Link Here
1
# fix errors like the following
2
#
3
# llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
4
 const'
5
# /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
6
ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
7
# /usr/bin/ld: final link failed: Bad value
8
#
9
--- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig	2017-04-01 15:33:37 UTC
10
+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
11
@@ -93,6 +93,8 @@ namespace {
12
       return ctx;
13
    }
14
 
15
+   const char* cstr(const std::string& str) { return str.c_str(); }
16
+
17
    std::unique_ptr<clang::CompilerInstance>
18
    create_compiler_instance(const target &target,
19
                             const std::vector<std::string> &opts,
20
@@ -105,8 +107,8 @@ namespace {
21
       // Parse the compiler options.  A file name should be present at the end
22
       // and must have the .cl extension in order for the CompilerInvocation
23
       // class to recognize it as an OpenCL source file.
24
-      const std::vector<const char *> copts =
25
-         map(std::mem_fn(&std::string::c_str), opts);
26
+      std::vector<const char *> copts;
27
+      std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
28
 
29
       if (!clang::CompilerInvocation::CreateFromArgs(
30
              c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
(-)graphics/libGL/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp (-13 lines)
Lines 1-13 Link Here
1
# Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>' 
2
#
3
--- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig	2016-11-10 22:05:17 UTC
4
+++ src/gallium/state_trackers/clover/llvm/metadata.hpp
5
@@ -42,7 +42,7 @@ namespace clover {
6
          get_kernel_nodes(const ::llvm::Module &mod) {
7
             if (const ::llvm::NamedMDNode *n =
8
                    mod.getNamedMetadata("opencl.kernels"))
9
-               return { n->op_begin(), n->op_end() };
10
+               return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
11
             else
12
                return {};
13
          }
(-)graphics/libGL/files/patch-src_gallium_state__trackers_clover_util_range.hpp (-31 lines)
Lines 1-31 Link Here
1
From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
2
From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
3
Date: Fri, 7 Mar 2014 15:16:08 +0100
4
Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
5
6
See:
7
  https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
8
--- src/gallium/state_trackers/clover/util/range.hpp.orig	2016-11-10 22:05:17 UTC
9
+++ src/gallium/state_trackers/clover/util/range.hpp
10
@@ -362,6 +362,12 @@ namespace clover {
11
       return { i, i + n };
12
    }
13
 
14
+   namespace detail {
15
+      template<typename T>
16
+      using fixup_function_type =
17
+         typename std::conditional<std::is_function<T>::value, T &, T>::type;
18
+   }
19
+
20
    ///
21
    /// Create a range by transforming the contents of a number of
22
    /// source ranges \a rs element-wise using a provided functor \a f.
23
@@ -369,7 +375,7 @@ namespace clover {
24
    /// \sa adaptor_range.
25
    ///
26
    template<typename F, typename... Rs>
27
-   adaptor_range<F, Rs...>
28
+   adaptor_range<detail::fixup_function_type<F>, Rs...>
29
    map(F &&f, Rs &&... rs) {
30
       return { std::forward<F>(f), std::forward<Rs>(rs)... };
31
    }
(-)graphics/libGL/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c (-14 lines)
Lines 1-14 Link Here
1
--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
3
@@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio
4
    return region->size;
5
 }
6
 
7
+#if defined(__DragonFly__) || defined(__FreeBSD__) || \
8
+    defined(__NetBSD__) || defined(__OpenBSD__)
9
+#define ERESTART EINTR
10
+#endif
11
+
12
 uint32
13
 vmw_ioctl_context_create(struct vmw_winsys_screen *vws)
14
 {
(-)graphics/libGL/files/patch-src_glx_glxext.c (-16 lines)
Lines 1-16 Link Here
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
2
#
3
--- src/glx/glxext.c.orig	2017-04-01 15:33:37 UTC
4
+++ src/glx/glxext.c
5
@@ -906,7 +906,11 @@ __glXInitialize(Display * dpy)
6
 #if defined(GLX_USE_DRM)
7
    if (glx_direct && glx_accel) {
8
 #if defined(HAVE_DRI3)
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
10
+      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
11
+#else
12
       if (!getenv("LIBGL_DRI3_DISABLE"))
13
+#endif
14
          dpyPriv->dri3Display = dri3_create_display(dpy);
15
 #endif /* HAVE_DRI3 */
16
       dpyPriv->dri2Display = dri2CreateDisplay(dpy);
(-)graphics/libGL/files/patch-src_intel_tools_aubinator.c (-14 lines)
Lines 1-14 Link Here
1
# We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and
2
# hope for the best (this alloc is too big but it's only a test)
3
#
4
--- src/intel/tools/aubinator.c.orig	2017-04-01 15:33:37 UTC
5
+++ src/intel/tools/aubinator.c
6
@@ -1299,7 +1299,7 @@ int main(int argc, char *argv[])
7
    /* mmap a terabyte for our gtt space. */
8
    gtt_size = 1ull << 40;
9
    gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE,
10
-              MAP_PRIVATE | MAP_ANONYMOUS |  MAP_NORESERVE, -1, 0);
11
+              MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0);
12
    if (gtt == MAP_FAILED) {
13
       fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno));
14
       exit(EXIT_FAILURE);
(-)graphics/libGL/files/patch-src_mapi_glapi_gen_gl__gentable.py (-11 lines)
Lines 1-11 Link Here
1
--- src/mapi/glapi/gen/gl_gentable.py.orig	2017-01-06 02:14:06 UTC
2
+++ src/mapi/glapi/gen/gl_gentable.py
3
@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used
4
 #endif
5
 
6
 #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
7
-	|| (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
8
+	|| (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
9
 #define USE_BACKTRACE
10
 #endif
11
 
(-)graphics/libGL/files/patch-src_mesa_main_compiler.h (-12 lines)
Lines 1-12 Link Here
1
--- src/mesa/main/compiler.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/mesa/main/compiler.h
3
@@ -56,6 +56,9 @@ extern "C" {
4
 #if defined(__linux__)
5
 #include <byteswap.h>
6
 #define CPU_TO_LE32( x )	bswap_32( x )
7
+#elif defined(__FreeBSD__)
8
+#include <sys/endian.h>
9
+#define CPU_TO_LE32( x )	bswap32( x )
10
 #elif defined(__APPLE__)
11
 #include <CoreFoundation/CFByteOrder.h>
12
 #define CPU_TO_LE32( x )	CFSwapInt32HostToLittle( x )
(-)graphics/libGL/files/patch-src_util_ralloc.c (-18 lines)
Lines 1-18 Link Here
1
--- src/util/ralloc.c.orig	2017-04-01 15:33:37 UTC
2
+++ src/util/ralloc.c
3
@@ -338,6 +338,7 @@ ralloc_parent(const void *ptr)
4
 
5
 static void *autofree_context = NULL;
6
 
7
+__attribute__((destructor))
8
 static void
9
 autofree(void)
10
 {
11
@@ -349,7 +350,6 @@ ralloc_autofree_context(void)
12
 {
13
    if (unlikely(autofree_context == NULL)) {
14
       autofree_context = ralloc_context(NULL);
15
-      atexit(autofree);
16
    }
17
    return autofree_context;
18
 }
(-)graphics/libGL/files/patch-src_util_u__endian.h (-11 lines)
Lines 1-11 Link Here
1
--- src/util/u_endian.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/util/u_endian.h
3
@@ -54,7 +54,7 @@
4
 # define PIPE_ARCH_BIG_ENDIAN
5
 #endif
6
 
7
-#elif defined(__OpenBSD__) || defined(__NetBSD__)
8
+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
9
 #include <sys/types.h>
10
 #include <machine/endian.h>
11
 
(-)graphics/libGL/pkg-descr (-4 lines)
Lines 1-4 Link Here
1
This package contains the OpenGL library, which can perform rendering over GLX
2
or using the Direct Rendering Infrastructure.
3
4
WWW: http://www.freedesktop.org/Software/xorg
(-)graphics/libGL/pkg-plist (-11 lines)
Lines 1-11 Link Here
1
include/GL/gl.h
2
include/GL/gl_mangle.h
3
include/GL/glcorearb.h
4
include/GL/glext.h
5
include/GL/glx.h
6
include/GL/glx_mangle.h
7
include/GL/glxext.h
8
lib/libGL.so
9
lib/libGL.so.1
10
lib/libGL.so.1.2.0
11
libdata/pkgconfig/gl.pc
(-)graphics/libglapi/Makefile (-36 lines)
Lines 1-36 Link Here
1
# Created by: kwm@FreeBSD.org
2
# $FreeBSD$
3
4
PORTNAME=	libglapi
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
8
9
COMMENT=	Common GL api library used by Mesa based ports
10
11
LICENSE=	MIT
12
13
BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
14
15
USE_XORG=	x11 xau xcb xdmcp xvmc
16
17
# stuff not needed by libglapi but configure wants it
18
USE_XORG+=	dri2proto dri3proto glproto presentproto xdamage xext xfixes \
19
		xshmfence
20
LIB_DEPENDS+=	libexpat.so:textproc/expat2 \
21
		libdrm.so:graphics/libdrm
22
23
.include <bsd.port.options.mk>
24
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
25
26
MESA_BUILD_WRKSRC=	src/mapi
27
MESA_INSTALL_WRKSRC=	src/mapi
28
29
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
30
31
post-install:
32
	@${RM} -r ${STAGEDIR}${PREFIX}/include/GLES*
33
	@${RM} ${STAGEDIR}${PREFIX}/lib/libGLESv2.so*
34
	@${RM} ${STAGEDIR}${PREFIX}/libdata/pkgconfig/glesv2.pc
35
36
.include <bsd.port.mk>
(-)graphics/libglapi/pkg-descr (-3 lines)
Lines 1-3 Link Here
1
This package contains the GL API utility library.
2
3
WWW: http://mesa3d.org/
(-)graphics/libglapi/pkg-plist (-3 lines)
Lines 1-3 Link Here
1
lib/libglapi.so
2
lib/libglapi.so.0
3
lib/libglapi.so.0.0.0
(-)graphics/libglesv2/Makefile (-29 lines)
Lines 1-29 Link Here
1
# Created by: kwm@FreeBSD.org
2
# $FreeBSD$
3
4
PORTNAME=	libglesv2
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
8
9
COMMENT=	OpenGL ES v2 library
10
11
LICENSE=	MIT
12
13
LIB_DEPENDS+=	libdrm.so:graphics/libdrm \
14
		libglapi.so:graphics/libglapi \
15
		libexpat.so:textproc/expat2
16
17
# stuff not needed by libglesv2 but configure wants it
18
USE_XORG+=	dri2proto dri3proto glproto presentproto xdamage xext xfixes \
19
		xshmfence
20
21
.include <bsd.port.options.mk>
22
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
23
24
BUILD_WRKSRC=	${WRKSRC}/src/mapi
25
INSTALL_WRKSRC=	${WRKSRC}/src/mapi
26
27
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
28
29
.include <bsd.port.mk>
(-)graphics/libglesv2/pkg-descr (-3 lines)
Lines 1-3 Link Here
1
This package contains the GL ES v2 utility library.
2
3
WWW: http://mesa3d.org/
(-)graphics/libglesv2/pkg-plist (-15 lines)
Lines 1-15 Link Here
1
include/GLES2/gl2.h
2
include/GLES2/gl2ext.h
3
include/GLES2/gl2platform.h
4
include/GLES3/gl3.h
5
include/GLES3/gl31.h
6
include/GLES3/gl32.h
7
include/GLES3/gl3ext.h
8
include/GLES3/gl3platform.h
9
lib/libGLESv2.so
10
lib/libGLESv2.so.2
11
lib/libGLESv2.so.2.0.0
12
@comment lib/libglapi.so
13
@comment lib/libglapi.so.0
14
@comment lib/libglapi.so.0.0.0
15
libdata/pkgconfig/glesv2.pc
(-)graphics/libosmesa/Makefile (-9 / +14 lines)
Lines 3-29 Link Here
3
3
4
PORTNAME=	libosmesa
4
PORTNAME=	libosmesa
5
PORTVERSION=	${MESAVERSION}
5
PORTVERSION=	${MESAVERSION}
6
PORTREVISION=	0
7
CATEGORIES=	graphics
6
CATEGORIES=	graphics
8
7
9
COMMENT=	Off-Screen Mesa implementation of the OpenGL API
8
COMMENT=	Off-Screen Mesa implementation of the OpenGL API
10
9
11
LIB_DEPENDS=	libexpat.so:textproc/expat2 \
10
LIB_DEPENDS=	libexpat.so:textproc/expat2 \
12
		libglapi.so:graphics/libglapi
11
		libglapi.so:graphics/mesa-libs
13
12
14
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xau xcb xdmcp xvmc
13
USE_XORG=	glproto
15
# libosmesa doesn't link agains libGL but osmesa.h needs GL/gl.h
16
# and both headers are intalled by libGL ....
17
USE_GL=		gl
18
14
19
.include <bsd.port.options.mk>
15
.include <bsd.port.options.mk>
16
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common"
20
17
21
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
18
CONFIGURE_ARGS+=	--disable-dri --disable-egl --disable-gbm \
19
			--with-gallium-drivers=swrast
20
MESA_BUILD_WRKSRC=	src/util src/compiler src/mapi src/mesa
22
21
23
#MESA_BUILD_WRKSRC=	src/util src/glsl src/mesa #/drivers/osmesa
22
.if ${MESA_LLVM_VER} != ""
23
CONFGIURE_ARGS+=	--enable-osmesa-gallium
24
MESA_BUILD_WRKSRC+=	src/gallium
25
MESA_INSTALL_WRKSRC=	src/gallium/state_trackers/osmesa src/gallium/targets/osmesa
26
.else
27
CONFIGURE_ARGS+=	--enable-osmesa
24
MESA_INSTALL_WRKSRC=	src/mesa/drivers/osmesa
28
MESA_INSTALL_WRKSRC=	src/mesa/drivers/osmesa
29
.endif
25
30
26
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
31
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets"
27
32
28
post-install:
33
post-install:
29
	@${MKDIR} ${STAGEDIR}${PREFIX}/include/GL
34
	@${MKDIR} ${STAGEDIR}${PREFIX}/include/GL
(-)graphics/mesa-dri/Makefile (+76 lines)
Line 0 Link Here
1
# Created by: Eric Anholt <anholt@FreeBSD.org>
2
# $FreeBSD$
3
4
PORTNAME=	mesa-dri
5
PORTVERSION=	${MESAVERSION}
6
CATEGORIES=	graphics
7
8
COMMENT=	OpenGL hardware acceleration drivers for DRI2+
9
10
LIB_DEPENDS=	libdrm.so:graphics/libdrm \
11
		libexpat.so:textproc/expat2
12
RUN_DEPENDS=	${LOCALBASE}/lib/libtxc_dxtn.so:graphics/s2tc
13
14
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xdamage xext \
15
		xfixes xshmfence xv xvmc
16
17
OPTIONS_DEFINE=	TEXTURE VAAPI VDPAU
18
OPTIONS_DEFAULT=TEXTURE
19
OPTIONS_SUB=	yes
20
PKGHELP=	${.CURDIR}/pkg-help
21
22
TEXTURE_DESC=	Enable texture-float support (patent encumbered)
23
TEXTURE_CONFIGURE_ENABLE=	texture-float
24
25
VAAPI_CONFIGURE_ENABLE=	va
26
VAAPI_LIB_DEPENDS=	libva.so:multimedia/libva
27
VAAPI_USE=		XORG=xcb
28
29
VDPAU_CONFIGURE_ENABLE=	vdpau
30
VDPAU_LIB_DEPENDS=	libvdpau.so:multimedia/libvdpau
31
32
.include <bsd.port.options.mk>
33
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common"
34
35
ALL_DRI_DRIVERS=	I915 I965 RADEON R200 SWRAST
36
ALL_GALLIUM_DRIVERS=	FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4
37
38
DRI_DRIVERS=		SWRAST
39
GALLIUM_DRIVERS=	SWRAST
40
.if ${ARCH} == amd64 || ${ARCH} == i386 \
41
 || ${ARCH} == powerpc || ${ARCH} == powerpc64
42
DRI_DRIVERS+=		RADEON R200
43
GALLIUM_DRIVERS+=	R300 R600 RADEONSI
44
.elif ${ARCH} == armv6 || ${ARCH} == aarch64
45
GALLIUM_DRIVERS+=	FREEDRENO VC4
46
.endif
47
.if ${ARCH} == amd64 || ${ARCH} == i386
48
DRI_DRIVERS+=		I915 I965
49
GALLIUM_DRIVERS+=	SVGA
50
.endif
51
52
CONFIGURE_ARGS+=	--with-dri-drivers="${DRI_DRIVERS:tl}" \
53
			--with-gallium-drivers="${GALLIUM_DRIVERS:tl}"
54
55
.for _d in ${ALL_DRI_DRIVERS}
56
. if ${DRI_DRIVERS:M${_d}}
57
PLIST_SUB+=	${_d}_DRIVER=""
58
. else
59
PLIST_SUB+=	${_d}_DRIVER="@comment "
60
. endif
61
.endfor
62
63
.for _gd in ${ALL_GALLIUM_DRIVERS}
64
. if ${GALLIUM_DRIVERS:M${_gd}}
65
PLIST_SUB+=	${_gd}_GDRIVER=""
66
. else
67
PLIST_SUB+=	${_gd}_GDRIVER="@comment "
68
. endif
69
.endfor
70
71
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets"
72
73
post-install:
74
	@${RM} -r ${STAGEDIR}/etc/OpenCL
75
76
.include <bsd.port.mk>
(-)graphics/mesa-dri/Makefile.common (+90 lines)
Line 0 Link Here
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/libosmesa
8
#    - graphics/mesa-dri
9
#    - graphics/mesa-libs
10
#    - lang/clover
11
#
12
# $FreeBSD$
13
14
MESAVERSION=	${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/}
15
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/}
16
17
MESABASEVERSION=	17.0.4
18
# if there is a subversion, don't include the '-' between 7.11-rc2.
19
MESASUBVERSION=
20
21
MASTER_SITES=	https://mesa.freedesktop.org/archive/ \
22
		https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \
23
		ftp://ftp.freedesktop.org/pub/mesa/ \
24
		ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/
25
26
DISTFILES=	mesa-${MESADISTVERSION}${EXTRACT_SUFX}
27
28
MAINTAINER=	x11@FreeBSD.org
29
30
USES+=		compiler:c++11-lib bison gettext-tools gmake libtool \
31
		localbase pathfix pkgconfig python:2,build shebangfix tar:xz
32
USE_LDCONFIG=	yes
33
GNU_CONFIGURE=	yes
34
35
PKGINSTALL=	${.CURDIR}/pkg-install
36
PKGDEINSTALL=	${.CURDIR}/pkg-deinstall
37
38
# only have one port to check with portscout.
39
.if ${PORTNAME} != mesa-dri
40
PORTSCOUT=	ignore:1
41
.endif
42
43
python_OLD_CMD=	/usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python
44
SHEBANG_FILES=	src/gallium/*/*/*.py src/gallium/tools/trace/*.py \
45
		src/gallium/drivers/svga/svgadump/svga_dump.py \
46
		src/gallium/drivers/freedreno/ir3/ir3_nir_trig.py \
47
		src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \
48
		src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \
49
		src/mesa/main/get_*.py src/util/format_srgb.py \
50
		src/amd/*/*.py src/intel/genxml/gen_pack_header.py
51
52
MASTERDIR=	${.CURDIR}/../../graphics/mesa-dri
53
PATCHDIR=	${MASTERDIR}/files
54
WRKSRC=		${WRKDIR}/mesa-${MESADISTVERSION}
55
DESCR=		${.CURDIR}/pkg-descr
56
PLIST=		${.CURDIR}/pkg-plist
57
INSTALL_TARGET=	install-strip
58
59
COMPONENT=	${PORTNAME:tl:C/^lib//:C/mesa-//}
60
61
.if (${ARCH} != sparc64 && ${ARCH} != ia64)	# no working LLVM
62
MESA_LLVM_VER?=	40
63
.endif
64
65
.if ${MESA_LLVM_VER} != ""
66
BUILD_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
67
RUN_DEPENDS+=	llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER}
68
CONFIGURE_ENV+=	LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER}
69
LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib
70
# The gallium-llvm switch is the global llvm switch for historical reasons
71
CONFIGURE_ARGS+=	--enable-gallium-llvm
72
.else
73
CONFIGURE_ARGS+=	--disable-gallium-llvm
74
.endif
75
76
# There are issues that need to be fixed to use TLS model "initial-exec"
77
# So stick with "global-dynamic"'s model for now. kan@ is working on a
78
# patch for rtld. We might want to backport global-dynamic or
79
# pthread_setspecific which it uses now by default. But since this
80
# configure switch is going away ...
81
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
82
CONFIGURE_ARGS+=	--disable-glx-tls
83
84
# we don't care about GLes v1
85
CONFIGURE_ARGS+=	--disable-gles1
86
87
.if ${OPSYS} == DragonFly
88
LIB_DEPENDS+=	libelf.so:devel/libelf
89
.endif
90
(-)graphics/mesa-dri/Makefile.targets (+45 lines)
Line 0 Link Here
1
# $FreeBSD$
2
#
3
# this file holds common targets
4
5
post-patch:
6
.if ${OPSYS} == FreeBSD
7
	@${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
8
# Clang 3.4 in 10.x on i386 fails with the following error when using "GCC atomics"
9
#
10
# glsl/cache.c:613:4: error: cannot compile this atomic library call yet
11
#   p_atomic_add(cache->size, size); note: expanded from macro 'p_atomic_add'
12
# define p_atomic_add(v, i) (void) __atomic_add_fetch((v), (i), __ATOMIC_ACQ_REL)
13
#
14
.if ${OSVERSION} < 1100000 && ${ARCH} == "i386"
15
	@${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure
16
.endif
17
.endif # ${OPSYS}
18
	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
19
		${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c
20
21
pre-build: mesa-pre-build
22
23
#custom targets so we can build parts of Mesa
24
mesa-pre-build:
25
# do propper gmake target.
26
	@cd ${WRKSRC}/src && ${MAKE_CMD} git_sha1.h libglsl_util.la
27
	@cd ${WRKSRC}/src/mesa/drivers/dri/common/ && ${MAKE_CMD}
28
	@cd ${WRKSRC}/src/loader && ${MAKE_CMD}
29
# libloader.la
30
31
.if defined(MESA_BUILD_WRKSRC)
32
do-build:
33
. for dir in ${MESA_BUILD_WRKSRC}
34
	(cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};)
35
. endfor
36
.endif
37
38
.if defined(MESA_INSTALL_WRKSRC)
39
do-install:
40
. for dir in ${MESA_INSTALL_WRKSRC}
41
	(cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
42
		${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
43
. endfor
44
.endif
45
(-)graphics/mesa-dri/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1492459376
2
SHA256 (mesa-17.0.4.tar.xz) = 1269dc8545a193932a0779b2db5bce9be4a5f6813b98c38b93b372be8362a346
3
SIZE (mesa-17.0.4.tar.xz) = 9454976
(-)graphics/mesa-dri/files/configure.ac (+81 lines)
Line 0 Link Here
1
--- configure.ac.orig	2017-04-01 15:33:36 UTC
2
+++ configure.ac
3
@@ -942,19 +942,19 @@ llvm_add_target() {
4
 # Call this inside ` ` to get the return value.
5
 # $1 is the llvm-config command with arguments.
6
 strip_unwanted_llvm_flags() {
7
-    # Use \> (marks the end of the word)
8
-    echo " `$1`" | sed \
9
-        -e 's/\s\+-m\S*//g' \
10
-        -e 's/\s\+-DNDEBUG\>//g' \
11
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
12
-        -e 's/\s\+-pedantic\>//g' \
13
-        -e 's/\s\+-W\S*//g' \
14
-        -e 's/\s\+-O\S*//g' \
15
-        -e 's/\s\+-g\S*//g' \
16
-        -e 's/-fno-rtti\>/-Fno-rtti/g' \
17
-        -e 's/\s\+-f\S*//g' \
18
-        -e 's/-Fno-rtti\>/-fno-rtti/g' \
19
-        -e 's/^ //'
20
+    echo " `$1` " | sed -E \
21
+        -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
22
+        -e 's/[[[:space:]]]+-DNDEBUG[[[:space:]]]/ /g' \
23
+        -e 's/[[[:space:]]]+-D_GNU_SOURCE[[[:space:]]]/ /g' \
24
+        -e 's/[[[:space:]]]+-pedantic[[[:space:]]]/ /g' \
25
+        -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
26
+        -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
27
+        -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
28
+        -e 's/-fno-rtti[[[:space:]]]/-Fno-rtti /g' \
29
+        -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
30
+        -e 's/-Fno-rtti[[[:space:]]]/-fno-rtti /g' \
31
+        -e 's/^[[[:space:]]]//' \
32
+        -e 's/[[[:space:]]]$//'
33
 }
34
 
35
 llvm_set_environment_variables() {
36
@@ -1121,7 +1121,7 @@ fi
37
 AC_SUBST(LIBSENSORS_LIBS)
38
 
39
 case "$host_os" in
40
-linux*)
41
+linux* | freebsd*)
42
     dri3_default=yes
43
     ;;
44
 *)
45
@@ -1631,7 +1631,7 @@ dnl platform checks. Set DEFINES and LIB
46
 if test "x$enable_dri" = xyes; then
47
     # Platform specific settings and drivers to build
48
     case "$host_os" in
49
-    linux*)
50
+    linux* | freebsd*)
51
         if test "x$enable_dri3" = xyes; then
52
             DEFINES="$DEFINES -DHAVE_DRI3"
53
         fi
54
@@ -2002,9 +2002,18 @@ if test "x$enable_opencl" = xyes; then
55
         AC_MSG_ERROR([cannot enable OpenCL without Gallium])
56
     fi
57
 
58
+    if test "x$acv_mesa_CLANG" = xno; then
59
+
60
+    GCC_VERSION=`$CC -dumpversion`
61
+    if test $? -eq 0; then
62
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
63
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
64
+    fi
65
+
66
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
67
         AC_MSG_ERROR([gcc >= 4.7 is required to build clover])
68
     fi
69
+    fi # end of clang test
70
 
71
     if test "x$have_libclc" = xno; then
72
         AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
73
@@ -2061,8 +2070,6 @@ if test "x$enable_opencl" = xyes; then
74
         CLANG_LIBDIR=${LLVM_LIBDIR}
75
     fi
76
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
77
-    AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
78
-        [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
79
 fi
80
 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
81
 AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
(-)graphics/mesa-dri/files/patch-configure (+83 lines)
Line 0 Link Here
1
--- configure.orig	2017-04-01 15:33:50 UTC
2
+++ configure
3
@@ -22350,19 +22350,19 @@ llvm_add_target() {
4
 # Call this inside ` ` to get the return value.
5
 # $1 is the llvm-config command with arguments.
6
 strip_unwanted_llvm_flags() {
7
-    # Use \> (marks the end of the word)
8
-    echo " `$1`" | sed \
9
-        -e 's/\s\+-m\S*//g' \
10
-        -e 's/\s\+-DNDEBUG\>//g' \
11
-        -e 's/\s\+-D_GNU_SOURCE\>//g' \
12
-        -e 's/\s\+-pedantic\>//g' \
13
-        -e 's/\s\+-W\S*//g' \
14
-        -e 's/\s\+-O\S*//g' \
15
-        -e 's/\s\+-g\S*//g' \
16
-        -e 's/-fno-rtti\>/-Fno-rtti/g' \
17
-        -e 's/\s\+-f\S*//g' \
18
-        -e 's/-Fno-rtti\>/-fno-rtti/g' \
19
-        -e 's/^ //'
20
+    echo " `$1` " | sed -E \
21
+        -e 's/[[:space:]]+-m[^[:space:]]*//g' \
22
+        -e 's/[[:space:]]+-DNDEBUG[[:space:]]/ /g' \
23
+        -e 's/[[:space:]]+-D_GNU_SOURCE[[:space:]]/ /g' \
24
+        -e 's/[[:space:]]+-pedantic[[:space:]]/ /g' \
25
+        -e 's/[[:space:]]+-W[^[:space:]]*//g' \
26
+        -e 's/[[:space:]]+-O[^[:space:]]*//g' \
27
+        -e 's/[[:space:]]+-g[^[:space:]]*//g' \
28
+        -e 's/-fno-rtti[[:space:]]/-Fno-rtti /g' \
29
+        -e 's/[[:space:]]+-f[^[:space:]]*//g' \
30
+        -e 's/-Fno-rtti[[:space:]]/-fno-rtti /g' \
31
+        -e 's/^[[:space:]]//' \
32
+        -e 's/[[:space:]]$//'
33
 }
34
 
35
 llvm_set_environment_variables() {
36
@@ -22560,7 +22560,7 @@ fi
37
 
38
 
39
 case "$host_os" in
40
-linux*)
41
+linux* | freebsd*)
42
     dri3_default=yes
43
     ;;
44
 *)
45
@@ -24099,7 +24099,7 @@ fi
46
 if test "x$enable_dri" = xyes; then
47
     # Platform specific settings and drivers to build
48
     case "$host_os" in
49
-    linux*)
50
+    linux* | freebsd*)
51
         if test "x$enable_dri3" = xyes; then
52
             DEFINES="$DEFINES -DHAVE_DRI3"
53
         fi
54
@@ -25851,9 +25851,19 @@ if test "x$enable_opencl" = xyes; then
55
         as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
56
     fi
57
 
58
+    if test "x$acv_mesa_CLANG" = xno; then
59
+
60
+    GCC_VERSION=`$CC -dumpversion`
61
+    if test $? -eq 0; then
62
+        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
63
+        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
64
+    fi
65
+
66
     if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
67
         as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5
68
     fi
69
+# end of clang test.
70
+    fi
71
 
72
     if test "x$have_libclc" = xno; then
73
         as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
74
@@ -25916,9 +25926,6 @@ rm -f core conftest.err conftest.$ac_obj
75
         CLANG_LIBDIR=${LLVM_LIBDIR}
76
     fi
77
     CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
78
-    if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
79
-  as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
80
-fi
81
 fi
82
  if test "x$enable_opencl" = xyes; then
83
   HAVE_CLOVER_TRUE=
(-)graphics/mesa-dri/files/patch-include_GL_internal_dri__interface.h (+19 lines)
Line 0 Link Here
1
GCC on 9.x doesn't allow types to be overwritten, these types are defined
2
in drm.h also, which causes build issues in xorg-server.
3
4
--- include/GL/internal/dri_interface.h.orig	2016-11-10 22:05:17 UTC
5
+++ include/GL/internal/dri_interface.h
6
@@ -40,13 +40,7 @@
7
 #ifndef DRI_INTERFACE_H
8
 #define DRI_INTERFACE_H
9
 
10
-#ifdef HAVE_LIBDRM
11
 #include <drm.h>
12
-#else
13
-typedef unsigned int drm_context_t;
14
-typedef unsigned int drm_drawable_t;
15
-typedef struct drm_clip_rect drm_clip_rect_t;
16
-#endif
17
 
18
 /**
19
  * \name DRI interface structures
(-)graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c (+16 lines)
Line 0 Link Here
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
2
#
3
--- src/egl/drivers/dri2/platform_x11.c.orig	2017-04-01 15:33:36 UTC
4
+++ src/egl/drivers/dri2/platform_x11.c
5
@@ -1507,7 +1507,11 @@
6
 
7
    if (!getenv("LIBGL_ALWAYS_SOFTWARE")) {
8
 #ifdef HAVE_DRI3
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
10
+      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
11
+#else
12
       if (!getenv("LIBGL_DRI3_DISABLE"))
13
+#endif
14
          initialized = dri2_initialize_x11_dri3(drv, disp);
15
 #endif
16
 
(-)graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c (+118 lines)
Line 0 Link Here
1
Revert the following commit.
2
3
FreeBSD and DragonFly don't have the required render nodes.
4
5
-------
6
7
From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
8
From: Emil Velikov <emil.l.velikov@gmail.com>
9
Date: Mon, 29 Jun 2015 12:36:45 +0100
10
Subject: pipe-loader: drop support for non-render node devices
11
12
Render nodes have been around for quite some time. Removing support via
13
the master/primary node allows us to clean up the conditional
14
compilation and simplify the build greatly.
15
16
For example currently we the pipe-loader, which explicitly links against
17
xcb and friends (for X auth) if found at compile-time. That
18
would cause problems as one will be forced to use X/xcb, even if it's a
19
headless system that is used for opencl.
20
21
v2: Clarify the linking topic in the commit message.
22
23
Cc: Tom Stellard <thomas.stellard@amd.com>
24
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
25
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
26
27
28
--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig	2017-04-01 15:33:37 UTC
29
+++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
30
@@ -225,6 +225,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
31
 }
32
 
33
 static int
34
+open_drm_minor(int minor)
35
+{
36
+   char path[PATH_MAX];
37
+   snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
38
+   return open(path, O_RDWR, 0);
39
+}
40
+
41
+static int
42
 open_drm_render_node_minor(int minor)
43
 {
44
    char path[PATH_MAX];
45
@@ -236,8 +244,15 @@ open_drm_render_node_minor(int minor)
46
 int
47
 pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
48
 {
49
-   int i, j, fd;
50
+   int i, k, fd, num_render_node_devs;
51
+   int j = 0;
52
+
53
+   struct {
54
+      unsigned vendor_id;
55
+      unsigned chip_id;
56
+   } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
57
 
58
+   /* Look for render nodes first */
59
    for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
60
         i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
61
       struct pipe_loader_device *dev;
62
@@ -251,6 +266,9 @@ pipe_loader_drm_probe(struct pipe_loader
63
          continue;
64
       }
65
 
66
+      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
67
+      render_node_devs[j].chip_id = dev->u.pci.chip_id;
68
+
69
       if (j < ndev) {
70
          devs[j] = dev;
71
       } else {
72
@@ -260,6 +278,46 @@ pipe_loader_drm_probe(struct pipe_loader
73
       j++;
74
    }
75
 
76
+   num_render_node_devs = j;
77
+
78
+   /* Next look for drm devices. */
79
+   for (i = 0; i < DRM_MAX_MINOR; i++) {
80
+      struct pipe_loader_device *dev;
81
+      boolean duplicate = FALSE;
82
+      fd = open_drm_minor(i);
83
+      if (fd < 0)
84
+         continue;
85
+
86
+      if (!pipe_loader_drm_probe_fd(&dev, fd)) {
87
+         close(fd);
88
+         continue;
89
+      }
90
+
91
+      /* Check to make sure we aren't already accessing this device via
92
+       * render nodes.
93
+       */
94
+      for (k = 0; k < num_render_node_devs; k++) {
95
+         if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
96
+             dev->u.pci.chip_id == render_node_devs[k].chip_id) {
97
+            close(fd);
98
+            dev->ops->release(&dev);
99
+            duplicate = TRUE;
100
+            break;
101
+         }
102
+      }
103
+
104
+      if (duplicate)
105
+         continue;
106
+
107
+      if (j < ndev) {
108
+         devs[j] = dev;
109
+      } else {
110
+         dev->ops->release(&dev);
111
+      }
112
+
113
+      j++;
114
+   }
115
+
116
    return j;
117
 }
118
 
(-)graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c (+11 lines)
Line 0 Link Here
1
--- src/gallium/auxiliary/util/u_network.c.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/auxiliary/util/u_network.c
3
@@ -6,7 +6,7 @@
4
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
5
 #  include <winsock2.h>
6
 #  include <windows.h>
7
-#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
8
+#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \
9
    defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
10
 #  include <sys/socket.h>
11
 #  include <netinet/in.h>
(-)graphics/mesa-dri/files/patch-src_gallium_include_pipe_p__config.h (+38 lines)
Line 0 Link Here
1
--- src/gallium/include/pipe/p_config.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/include/pipe/p_config.h
3
@@ -76,6 +76,13 @@
4
 #define PIPE_CC_ICL
5
 #endif
6
 
7
+#if defined(__sparc__) || defined(__sparc64__)
8
+#define PIPE_ARCH_SPARC
9
+#if defined(__sparc64__)
10
+#define PIPE_ARCH_SPARC_64
11
+#endif
12
+#endif
13
+
14
 
15
 /*
16
  * Processor architecture
17
@@ -130,7 +137,7 @@
18
 
19
 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
20
 #define PIPE_ARCH_LITTLE_ENDIAN
21
-#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
22
+#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
23
 #define PIPE_ARCH_BIG_ENDIAN
24
 #endif
25
 
26
@@ -159,6 +166,12 @@
27
 #define PIPE_OS_ANDROID
28
 #endif
29
 
30
+#if defined(__DragonFly__)
31
+#define PIPE_OS_DRAGONFLY
32
+#define PIPE_OS_BSD
33
+#define PIPE_OS_UNIX
34
+#endif
35
+
36
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
37
 #define PIPE_OS_FREEBSD
38
 #define PIPE_OS_BSD
(-)graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp (+30 lines)
Line 0 Link Here
1
# fix errors like the following
2
#
3
# llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
4
 const'
5
# /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
6
ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
7
# /usr/bin/ld: final link failed: Bad value
8
#
9
--- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig	2017-04-01 15:33:37 UTC
10
+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
11
@@ -93,6 +93,8 @@ namespace {
12
       return ctx;
13
    }
14
 
15
+   const char* cstr(const std::string& str) { return str.c_str(); }
16
+
17
    std::unique_ptr<clang::CompilerInstance>
18
    create_compiler_instance(const target &target,
19
                             const std::vector<std::string> &opts,
20
@@ -105,8 +107,8 @@ namespace {
21
       // Parse the compiler options.  A file name should be present at the end
22
       // and must have the .cl extension in order for the CompilerInvocation
23
       // class to recognize it as an OpenCL source file.
24
-      const std::vector<const char *> copts =
25
-         map(std::mem_fn(&std::string::c_str), opts);
26
+      std::vector<const char *> copts;
27
+      std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
28
 
29
       if (!clang::CompilerInvocation::CreateFromArgs(
30
              c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
(-)graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp (+13 lines)
Line 0 Link Here
1
# Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>' 
2
#
3
--- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig	2016-11-10 22:05:17 UTC
4
+++ src/gallium/state_trackers/clover/llvm/metadata.hpp
5
@@ -42,7 +42,7 @@ namespace clover {
6
          get_kernel_nodes(const ::llvm::Module &mod) {
7
             if (const ::llvm::NamedMDNode *n =
8
                    mod.getNamedMetadata("opencl.kernels"))
9
-               return { n->op_begin(), n->op_end() };
10
+               return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
11
             else
12
                return {};
13
          }
(-)graphics/mesa-dri/files/patch-src_gallium_state__trackers_clover_util_range.hpp (+31 lines)
Line 0 Link Here
1
From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
2
From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
3
Date: Fri, 7 Mar 2014 15:16:08 +0100
4
Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
5
6
See:
7
  https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
8
--- src/gallium/state_trackers/clover/util/range.hpp.orig	2016-11-10 22:05:17 UTC
9
+++ src/gallium/state_trackers/clover/util/range.hpp
10
@@ -362,6 +362,12 @@ namespace clover {
11
       return { i, i + n };
12
    }
13
 
14
+   namespace detail {
15
+      template<typename T>
16
+      using fixup_function_type =
17
+         typename std::conditional<std::is_function<T>::value, T &, T>::type;
18
+   }
19
+
20
    ///
21
    /// Create a range by transforming the contents of a number of
22
    /// source ranges \a rs element-wise using a provided functor \a f.
23
@@ -369,7 +375,7 @@ namespace clover {
24
    /// \sa adaptor_range.
25
    ///
26
    template<typename F, typename... Rs>
27
-   adaptor_range<F, Rs...>
28
+   adaptor_range<detail::fixup_function_type<F>, Rs...>
29
    map(F &&f, Rs &&... rs) {
30
       return { std::forward<F>(f), std::forward<Rs>(rs)... };
31
    }
(-)graphics/mesa-dri/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c (+14 lines)
Line 0 Link Here
1
--- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig	2016-11-10 22:05:17 UTC
2
+++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
3
@@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio
4
    return region->size;
5
 }
6
 
7
+#if defined(__DragonFly__) || defined(__FreeBSD__) || \
8
+    defined(__NetBSD__) || defined(__OpenBSD__)
9
+#define ERESTART EINTR
10
+#endif
11
+
12
 uint32
13
 vmw_ioctl_context_create(struct vmw_winsys_screen *vws)
14
 {
(-)graphics/mesa-dri/files/patch-src_glx_glxext.c (+16 lines)
Line 0 Link Here
1
# work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
2
#
3
--- src/glx/glxext.c.orig	2017-04-01 15:33:37 UTC
4
+++ src/glx/glxext.c
5
@@ -906,7 +906,11 @@ __glXInitialize(Display * dpy)
6
 #if defined(GLX_USE_DRM)
7
    if (glx_direct && glx_accel) {
8
 #if defined(HAVE_DRI3)
9
+#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
10
+      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
11
+#else
12
       if (!getenv("LIBGL_DRI3_DISABLE"))
13
+#endif
14
          dpyPriv->dri3Display = dri3_create_display(dpy);
15
 #endif /* HAVE_DRI3 */
16
       dpyPriv->dri2Display = dri2CreateDisplay(dpy);
(-)graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c (+14 lines)
Line 0 Link Here
1
# We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and
2
# hope for the best (this alloc is too big but it's only a test)
3
#
4
--- src/intel/tools/aubinator.c.orig	2017-04-01 15:33:37 UTC
5
+++ src/intel/tools/aubinator.c
6
@@ -1299,7 +1299,7 @@ int main(int argc, char *argv[])
7
    /* mmap a terabyte for our gtt space. */
8
    gtt_size = 1ull << 40;
9
    gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE,
10
-              MAP_PRIVATE | MAP_ANONYMOUS |  MAP_NORESERVE, -1, 0);
11
+              MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0);
12
    if (gtt == MAP_FAILED) {
13
       fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno));
14
       exit(EXIT_FAILURE);
(-)graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py (+11 lines)
Line 0 Link Here
1
--- src/mapi/glapi/gen/gl_gentable.py.orig	2017-01-06 02:14:06 UTC
2
+++ src/mapi/glapi/gen/gl_gentable.py
3
@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used
4
 #endif
5
 
6
 #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
7
-	|| (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
8
+	|| (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
9
 #define USE_BACKTRACE
10
 #endif
11
 
(-)graphics/mesa-dri/files/patch-src_mesa_main_compiler.h (+12 lines)
Line 0 Link Here
1
--- src/mesa/main/compiler.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/mesa/main/compiler.h
3
@@ -56,6 +56,9 @@ extern "C" {
4
 #if defined(__linux__)
5
 #include <byteswap.h>
6
 #define CPU_TO_LE32( x )	bswap_32( x )
7
+#elif defined(__FreeBSD__)
8
+#include <sys/endian.h>
9
+#define CPU_TO_LE32( x )	bswap32( x )
10
 #elif defined(__APPLE__)
11
 #include <CoreFoundation/CFByteOrder.h>
12
 #define CPU_TO_LE32( x )	CFSwapInt32HostToLittle( x )
(-)graphics/mesa-dri/files/patch-src_util_ralloc.c (+18 lines)
Line 0 Link Here
1
--- src/util/ralloc.c.orig	2017-04-01 15:33:37 UTC
2
+++ src/util/ralloc.c
3
@@ -338,6 +338,7 @@ ralloc_parent(const void *ptr)
4
 
5
 static void *autofree_context = NULL;
6
 
7
+__attribute__((destructor))
8
 static void
9
 autofree(void)
10
 {
11
@@ -349,7 +350,6 @@ ralloc_autofree_context(void)
12
 {
13
    if (unlikely(autofree_context == NULL)) {
14
       autofree_context = ralloc_context(NULL);
15
-      atexit(autofree);
16
    }
17
    return autofree_context;
18
 }
(-)graphics/mesa-dri/files/patch-src_util_u__endian.h (+11 lines)
Line 0 Link Here
1
--- src/util/u_endian.h.orig	2016-11-10 22:05:17 UTC
2
+++ src/util/u_endian.h
3
@@ -54,7 +54,7 @@
4
 # define PIPE_ARCH_BIG_ENDIAN
5
 #endif
6
 
7
-#elif defined(__OpenBSD__) || defined(__NetBSD__)
8
+#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
9
 #include <sys/types.h>
10
 #include <machine/endian.h>
11
 
(-)graphics/mesa-dri/pkg-descr (+7 lines)
Line 0 Link Here
1
This package contains the current stable release of the client drivers for DRI2+
2
3
With a X Server configured for DRI, they allow direct rendering of hardware-
4
accelerated OpenGL. This package also includes the software renderer, either
5
llvmpipe or classic SWrast.
6
7
WWW: http://www.mesa3d.org/
(-)graphics/mesa-dri/pkg-help (+15 lines)
Line 0 Link Here
1
VAAPI and VDPAU options enable building Gallium based VA-API and VDPAU
2
drivers to decode video on the GPU via libva and libvdpau, respectively.
3
Gallium based VAAPI and VDPAU drivers are only available for Radeon GPUs.
4
5
Both GPU decode options require newer drm drivers than are currently present
6
in a released FreeBSD kernel. These are options for DRM-next and DragonFly.
7
8
The TEXTURE option enables texture-float support, which SGI claims requires
9
US Patent #6,650,327 [1], filed Jun 16, 1998 thus expiring on Jun 16, 2018.
10
Use may require a license depending on jurisdiction, consult a lawyer.
11
12
See docs/patents.txt in the Mesa tarball or the following URLs:
13
14
[1] https://www.google.com/patents/US6650327
15
[2] http://www.opengl.org/registry/specs/ARB/texture_float.txt
(-)graphics/mesa-dri/pkg-plist (+89 lines)
Line 0 Link Here
1
etc/drirc
2
@comment include/EGL/egl.h
3
@comment include/EGL/eglext.h
4
@comment include/EGL/eglextchromium.h
5
@comment include/EGL/eglmesaext.h
6
@comment include/EGL/eglplatform.h
7
@comment include/GL/gl.h
8
@comment include/GL/gl_mangle.h
9
@comment include/GL/glcorearb.h
10
@comment include/GL/glext.h
11
@comment include/GL/glx.h
12
@comment include/GL/glx_mangle.h
13
@comment include/GL/glxext.h
14
include/GL/internal/dri_interface.h
15
@comment include/GL/osmesa.h
16
@comment include/GLES2/gl2.h
17
@comment include/GLES2/gl2ext.h
18
@comment include/GLES2/gl2platform.h
19
@comment include/GLES3/gl3.h
20
@comment include/GLES3/gl31.h
21
@comment include/GLES3/gl32.h
22
@comment include/GLES3/gl3ext.h
23
@comment include/GLES3/gl3platform.h
24
@comment include/KHR/khrplatform.h
25
@comment include/gbm.h
26
%%I915_DRIVER%%lib/dri/i915_dri.so
27
%%I965_DRIVER%%lib/dri/i965_dri.so
28
%%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so
29
%%R200_DRIVER%%lib/dri/r200_dri.so
30
%%R300_GDRIVER%%lib/dri/r300_dri.so
31
%%R600_GDRIVER%%lib/dri/r600_dri.so
32
%%VAAPI%%%%R600_GDRIVER%%lib/dri/r600_drv_video.so
33
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
34
%%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so
35
%%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so
36
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
37
%%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so
38
@comment lib/gallium-pipe/pipe_r300.so
39
@comment lib/gallium-pipe/pipe_r600.so
40
@comment lib/gallium-pipe/pipe_radeonsi.so
41
@comment lib/gallium-pipe/pipe_swrast.so
42
@comment lib/gallium-pipe/pipe_vmwgfx.so
43
@comment lib/libEGL.so
44
@comment lib/libEGL.so.1
45
@comment lib/libEGL.so.1.0.0
46
@comment lib/libGL.so
47
@comment lib/libGL.so.1
48
@comment lib/libGL.so.1.2.0
49
@comment lib/libGLESv2.so
50
@comment lib/libGLESv2.so.2
51
@comment lib/libGLESv2.so.2.0.0
52
@comment lib/libMesaOpenCL.so
53
@comment lib/libMesaOpenCL.so.1
54
@comment lib/libMesaOpenCL.so.1.0.0
55
@comment lib/libOSMesa.so
56
@comment lib/libOSMesa.so.8
57
@comment lib/libOSMesa.so.8.0.0
58
%%R600_GDRIVER%%lib/libXvMCr600.so
59
%%R600_GDRIVER%%lib/libXvMCr600.so.1
60
%%R600_GDRIVER%%lib/libXvMCr600.so.1.0
61
%%R600_GDRIVER%%lib/libXvMCr600.so.1.0.0
62
@comment lib/libgbm.so
63
@comment lib/libgbm.so.1
64
@comment lib/libgbm.so.1.0.0
65
@comment lib/libglapi.so
66
@comment lib/libglapi.so.0
67
@comment lib/libglapi.so.0.0.0
68
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so
69
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1
70
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0
71
%%VDPAU%%%%R300_GDRIVER%%lib/vdpau/libvdpau_r300.so.1.0.0
72
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so
73
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1
74
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0
75
%%VDPAU%%%%R600_GDRIVER%%lib/vdpau/libvdpau_r600.so.1.0.0
76
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so
77
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1
78
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
79
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
80
@comment lib/libwayland-egl.so
81
@comment lib/libwayland-egl.so.1
82
@comment lib/libwayland-egl.so.1.0.0
83
libdata/pkgconfig/dri.pc
84
@comment libdata/pkgconfig/egl.pc
85
@comment libdata/pkgconfig/gbm.pc
86
@comment libdata/pkgconfig/gl.pc
87
@comment libdata/pkgconfig/glesv2.pc
88
@comment libdata/pkgconfig/osmesa.pc
89
@comment libdata/pkgconfig/wayland-egl.pc
(-)graphics/mesa-libs/Makefile (+67 lines)
Line 0 Link Here
1
# Created by: Eric Anholt <anholt@FreeBSD.org>
2
# $FreeBSD$
3
4
PORTNAME=	mesa-libs
5
PORTVERSION=	${MESAVERSION}
6
CATEGORIES=	graphics
7
8
COMMENT=	OpenGL libraries that support GLX and EGL clients
9
10
BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
11
LIB_DEPENDS+=	libdrm.so:graphics/libdrm \
12
		libexpat.so:textproc/expat2
13
14
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xcb xdamage xext \
15
		xfixes xshmfence xxf86vm
16
17
OPTIONS_DEFINE=	WAYLAND
18
OPTIONS_SUB=	yes
19
20
WAYLAND_DESC=		Enable support for the Wayland platform in EGL
21
WAYLAND_LIB_DEPENDS=	libwayland-client.so:graphics/wayland \
22
			libwayland-server.so:graphics/wayland
23
24
.include <bsd.port.options.mk>
25
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common"
26
27
CONFIGURE_ARGS+=	--with-dri-drivers=swrast --with-gallium-drivers=swrast
28
29
# libEGL needs gallium enabled which depends on llvm
30
.if ${MESA_LLVM_VER} != ""
31
.if ${PORT_OPTIONS:MWAYLAND}
32
CONFIGURE_ARGS+=	--with-egl-platforms=x11,drm,wayland
33
.else
34
CONFIGURE_ARGS+=        --with-egl-platforms=x11,drm
35
.endif
36
PLIST_SUB+=		EGL=""	
37
.else
38
CONFIGURE_ARGS+=        --disable-egl
39
PLIST_SUB+=		EGL="@comment "
40
.if ${PORT_OPTIONS:MWAYLAND}
41
IGNORE= WAYLAND is an option for EGL and thus only valid on platforms with LLVM
42
.endif
43
.endif 
44
45
MESA_BUILD_WRKSRC=	src/mapi
46
MESA_INSTALL_WRKSRC=	src/mapi
47
48
.if ${PORT_OPTIONS:MWAYLAND}
49
MESA_BUILD_WRKSRC+=	src/egl/wayland/wayland-drm src/egl/wayland/wayland-egl
50
MESA_INSTALL_WRKSRC+=	src/egl/wayland/wayland-egl
51
.endif
52
53
MESA_BUILD_WRKSRC+=	src/gbm src/glx
54
MESA_INSTALL_WRKSRC+=	src/gbm src/glx
55
56
.if ${MESA_LLVM_VER} != ""
57
MESA_BUILD_WRKSRC+=	src/egl
58
MESA_INSTALL_WRKSRC+=	src/egl
59
.endif
60
61
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets"
62
63
post-install:
64
	@cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \
65
		${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS
66
67
.include <bsd.port.mk>
(-)graphics/mesa-libs/pkg-descr (+5 lines)
Line 0 Link Here
1
This package contains the Mesa OpenGL libraries for GLX and EGL clients.
2
These include libEGL, libGL, and libglesv2 as well as utlity libraries
3
libglapi and gbm.
4
5
WWW: http://www.mesa3d.org/
(-)graphics/mesa-libs/pkg-plist (+45 lines)
Line 0 Link Here
1
%%EGL%%include/EGL/egl.h
2
%%EGL%%include/EGL/eglext.h
3
%%EGL%%include/EGL/eglextchromium.h
4
%%EGL%%include/EGL/eglmesaext.h
5
%%EGL%%include/EGL/eglplatform.h
6
include/GL/gl.h
7
include/GL/gl_mangle.h
8
include/GL/glcorearb.h
9
include/GL/glext.h
10
include/GL/glx.h
11
include/GL/glx_mangle.h
12
include/GL/glxext.h
13
include/GLES2/gl2.h
14
include/GLES2/gl2ext.h
15
include/GLES2/gl2platform.h
16
include/GLES3/gl3.h
17
include/GLES3/gl31.h
18
include/GLES3/gl32.h
19
include/GLES3/gl3ext.h
20
include/GLES3/gl3platform.h
21
%%EGL%%include/KHR/khrplatform.h
22
include/gbm.h
23
%%EGL%%lib/libEGL.so
24
%%EGL%%lib/libEGL.so.1
25
%%EGL%%lib/libEGL.so.1.0.0
26
lib/libGL.so
27
lib/libGL.so.1
28
lib/libGL.so.1.2.0
29
lib/libGLESv2.so
30
lib/libGLESv2.so.2
31
lib/libGLESv2.so.2.0.0
32
lib/libgbm.so
33
lib/libgbm.so.1
34
lib/libgbm.so.1.0.0
35
lib/libglapi.so
36
lib/libglapi.so.0
37
lib/libglapi.so.0.0.0
38
%%WAYLAND%%lib/libwayland-egl.so
39
%%WAYLAND%%lib/libwayland-egl.so.1
40
%%WAYLAND%%lib/libwayland-egl.so.1.0.0
41
%%EGL%%libdata/pkgconfig/egl.pc
42
libdata/pkgconfig/gbm.pc
43
libdata/pkgconfig/gl.pc
44
libdata/pkgconfig/glesv2.pc
45
%%WAYLAND%%libdata/pkgconfig/wayland-egl.pc
(-)graphics/s2tc/Makefile (-1 / +1 lines)
Lines 11-17 Link Here
11
LICENSE=	MIT
11
LICENSE=	MIT
12
LICENSE_FILE=	${WRKSRC}/COPYING
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
13
14
BUILD_DEPENDS=	libGL>=9.1.7:graphics/libGL
14
BUILD_DEPENDS=	mesa-libs>=0:graphics/mesa-libs
15
TEST_DEPENDS=	convert:graphics/ImageMagick \
15
TEST_DEPENDS=	convert:graphics/ImageMagick \
16
		nvcompress:graphics/nvidia-texture-tools \
16
		nvcompress:graphics/nvidia-texture-tools \
17
		wget:ftp/wget
17
		wget:ftp/wget
(-)lang/clover/Makefile (-12 / +22 lines)
Lines 2-32 Link Here
2
2
3
PORTNAME=	clover
3
PORTNAME=	clover
4
PORTVERSION=	${MESAVERSION}
4
PORTVERSION=	${MESAVERSION}
5
PORTREVISION=	0
6
CATEGORIES=	lang
5
CATEGORIES=	lang
7
6
8
COMMENT=	Mesa "Clover" OpenCL library
7
COMMENT=	Mesa "Clover" OpenCL library
9
8
10
BUILD_DEPENDS=	opencl>=0:devel/opencl
9
BUILD_DEPENDS=	libclc>=0.2.0.20160915:devel/libclc \
10
		opencl>=0:devel/opencl \
11
		${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
11
LIB_DEPENDS=	libdrm.so:graphics/libdrm \
12
LIB_DEPENDS=	libdrm.so:graphics/libdrm \
12
		libOpenCL.so:devel/ocl-icd \
13
		libexpat.so:textproc/expat2 \
13
		libexpat.so:textproc/expat2
14
		libOpenCL.so:devel/ocl-icd
14
RUN_DEPENDS=	opencl>=0:devel/opencl
15
RUN_DEPENDS=	opencl>=0:devel/opencl
15
16
16
USE_XORG=	dri2proto dri3proto glproto presentproto x11 xdamage xext \
17
ONLY_FOR_ARCHS=		i386 amd64
17
		xfixes xshmfence xvmc xxf86vm
18
ONLY_FOR_ARCHS_REASON=	Clover needs a GPU supported by the Radeon KMS driver
18
19
19
ONLY_FOR_ARCHS=	i386 amd64
20
ONLY_FOR_ARCHS_REASON=	Clover needs a graphics driver supported by the Radeon KMS driver
21
22
.include <bsd.port.options.mk>
20
.include <bsd.port.options.mk>
23
.include "${.CURDIR}/../../graphics/libGL/Makefile.common"
21
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common"
24
22
25
#MESA_BUILD_WRKSRC=	src/util src/glsl src/mesa src/gallium
23
CONFIGURE_ARGS+=	--enable-opencl --enable-opencl-icd --disable-dri \
24
			--disable-egl --disable-gbm --disable-glx \
25
			--disable-va --disable-vdpau --disable-xvmc \
26
			--with-gallium-drivers=r600,radeonsi
27
28
#MESA_BUILD_WRKSRC=	src/util src/compiler src/mesa src/gallium
26
MESA_INSTALL_WRKSRC=	src/gallium/targets/opencl src/gallium/targets/pipe-loader
29
MESA_INSTALL_WRKSRC=	src/gallium/targets/opencl src/gallium/targets/pipe-loader
27
30
28
.include "${.CURDIR}/../../graphics/libGL/Makefile.targets"
31
.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets"
29
32
33
pre-configure:
34
	@if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \
35
		! [ -e ${LOCALBASE}/bin/clang${MESA_LLVM_VER} ]; then \
36
		${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not built with clang support, which is required."; \
37
		${FALSE}; \
38
	fi
39
30
post-install:
40
post-install:
31
	@${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/
41
	@${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/
32
42
(-)lang/clover/pkg-descr (-3 / +2 lines)
Lines 1-5 Link Here
1
This package contains the Mesa "Clover" libOpenCL implementation. This
1
This package contains Mesa's libOpenCL implementation "Clover".
2
implementation is build onto GALLIUM and as such can only be used on Radeon
2
It is built upon GALLIUM and currently only supports Radeon GPUs.
3
cards.
4
3
5
WWW: http://dri.freedesktop.org/wiki/GalliumCompute/
4
WWW: http://dri.freedesktop.org/wiki/GalliumCompute/
(-)lang/clover/pkg-plist (-3 lines)
Lines 1-9 Link Here
1
etc/OpenCL/vendors/mesa.icd
1
etc/OpenCL/vendors/mesa.icd
2
lib/gallium-pipe/pipe_r300.so
3
lib/gallium-pipe/pipe_r600.so
2
lib/gallium-pipe/pipe_r600.so
4
lib/gallium-pipe/pipe_radeonsi.so
3
lib/gallium-pipe/pipe_radeonsi.so
5
lib/gallium-pipe/pipe_swrast.so
6
lib/gallium-pipe/pipe_vmwgfx.so
7
lib/libMesaOpenCL.so
4
lib/libMesaOpenCL.so
8
lib/libMesaOpenCL.so.1
5
lib/libMesaOpenCL.so.1
9
lib/libMesaOpenCL.so.1.0.0
6
lib/libMesaOpenCL.so.1.0.0
(-)net/tigervnc/Makefile (-1 / +1 lines)
Lines 14-20 Link Here
14
LICENSE_FILE=	${WRKSRC}/LICENCE.TXT
14
LICENSE_FILE=	${WRKSRC}/LICENCE.TXT
15
15
16
PATCH_DEPENDS=	${NONEXISTENT}:x11-servers/xorg-server:patch
16
PATCH_DEPENDS=	${NONEXISTENT}:x11-servers/xorg-server:patch
17
BUILD_DEPENDS=	${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/dri \
17
BUILD_DEPENDS=	${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/mesa-dri \
18
		${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
18
		${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
19
		bash:shells/bash
19
		bash:shells/bash
20
# almost equivalent to x11-servers/xorg-server's
20
# almost equivalent to x11-servers/xorg-server's
(-)net/tigervnc-devel/Makefile (-1 / +1 lines)
Lines 15-21 Link Here
15
LICENSE_FILE=	${WRKSRC}/LICENCE.TXT
15
LICENSE_FILE=	${WRKSRC}/LICENCE.TXT
16
16
17
PATCH_DEPENDS=	${NONEXISTENT}:x11-servers/xorg-server:patch
17
PATCH_DEPENDS=	${NONEXISTENT}:x11-servers/xorg-server:patch
18
BUILD_DEPENDS=	${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/dri \
18
BUILD_DEPENDS=	${LOCALBASE}/include/GL/internal/dri_interface.h:graphics/mesa-dri \
19
		${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
19
		${LOCALBASE}/libdata/pkgconfig/fontutil.pc:x11-fonts/font-util \
20
		bash:shells/bash
20
		bash:shells/bash
21
# almost equivalent to x11-servers/xorg-server's
21
# almost equivalent to x11-servers/xorg-server's
(-)science/iboview/Makefile (-6 / +4 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	iboview
4
PORTNAME=	iboview
5
PORTVERSION=	20150427
5
PORTVERSION=	20150427
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	science
7
CATEGORIES=	science
8
MASTER_SITES=	http://www.iboview.org/bin/
8
MASTER_SITES=	http://www.iboview.org/bin/
9
DISTNAME=	ibo-view.20150427
9
DISTNAME=	ibo-view.20150427
Lines 15-31 Link Here
15
LICENSE_FILE=	${WRKSRC}/LICENSE
15
LICENSE_FILE=	${WRKSRC}/LICENSE
16
16
17
BUILD_DEPENDS=	qt5-buildtools>=0:devel/qt5-buildtools \
17
BUILD_DEPENDS=	qt5-buildtools>=0:devel/qt5-buildtools \
18
		libGLU>=0:graphics/libGLU \
19
		boost-libs>=0:devel/boost-libs
18
		boost-libs>=0:devel/boost-libs
20
LIB_DEPENDS=	libgcc_s.so:lang/gcc \
19
LIB_DEPENDS=	libgcc_s.so:lang/gcc
21
		libGL.so:graphics/libGL
20
RUN_DEPENDS=	boost-libs>=0:devel/boost-libs
22
RUN_DEPENDS=	libGLU>=0:graphics/libGLU \
23
		boost-libs>=0:devel/boost-libs
24
21
25
ONLY_FOR_ARCHS=	amd64
22
ONLY_FOR_ARCHS=	amd64
26
ONLY_FOR_ARCHS_REASON_amd64=	only builds and is supported on amd64
23
ONLY_FOR_ARCHS_REASON_amd64=	only builds and is supported on amd64
27
24
28
USES=		tar:bz2 qmake:outsource blaslapack:openblas
25
USES=		tar:bz2 qmake:outsource blaslapack:openblas
26
USE_GL=		gl glu
29
USE_QT5=	core gui widgets opengl script svg
27
USE_QT5=	core gui widgets opengl script svg
30
28
31
PLIST_FILES=	bin/iboview
29
PLIST_FILES=	bin/iboview
(-)x11/xorg/Makefile (-2 / +2 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	xorg
4
PORTNAME=	xorg
5
PORTVERSION=	7.7
5
PORTVERSION=	7.7
6
PORTREVISION=	2
6
PORTREVISION=	3
7
CATEGORIES=	x11
7
CATEGORIES=	x11
8
8
9
MAINTAINER=	x11@FreeBSD.org
9
MAINTAINER=	x11@FreeBSD.org
Lines 11-17 Link Here
11
11
12
USES=		metaport
12
USES=		metaport
13
13
14
RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/dri
14
RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri
15
15
16
# data
16
# data
17
RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/xbitmaps.pc:x11/xbitmaps \
17
RUN_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/xbitmaps.pc:x11/xbitmaps \
(-)x11-toolkits/gtkada3/Makefile (-1 / +1 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	gtkada
4
PORTNAME=	gtkada
5
PORTVERSION=	3.14.2
5
PORTVERSION=	3.14.2
6
PORTREVISION=	1
6
CATEGORIES=	x11-toolkits
7
CATEGORIES=	x11-toolkits
7
PKGNAMESUFFIX=	3
8
PKGNAMESUFFIX=	3
8
9
Lines 16-22 Link Here
16
		libfontconfig.so:x11-fonts/fontconfig \
17
		libfontconfig.so:x11-fonts/fontconfig \
17
		libharfbuzz.so:print/harfbuzz \
18
		libharfbuzz.so:print/harfbuzz \
18
		libdrm.so:graphics/libdrm \
19
		libdrm.so:graphics/libdrm \
19
		libglapi.so:graphics/libglapi \
20
		libatk-bridge-2.0.so:accessibility/at-spi2-atk \
20
		libatk-bridge-2.0.so:accessibility/at-spi2-atk \
21
		libepoxy.so:graphics/libepoxy \
21
		libepoxy.so:graphics/libepoxy \
22
		libpng16.so:graphics/png \
22
		libpng16.so:graphics/png \

Return to bug 218799