Ravenports generated: 08 Sep 2017 12:34
[ravenports.git] / bucket_F0 / mesa
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               mesa
4 VERSION=                17.2.0
5 KEYWORDS=               graphics
6 VARIANTS=               standard
7 SDESC[standard]=        Mesa 3D Graphics Library
8 HOMEPAGE=               https://www.mesa3d.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            https://mesa.freedesktop.org/archive/
13                         https://mesa.freedesktop.org/archive/17.2.0/
14                         ftp://ftp.freedesktop.org/pub/mesa/17.2.0/
15 DISTFILE[1]=            mesa-17.2.0.tar.xz:main
16 DF_INDEX=               1
17 SPKGS[standard]=        complete
18                         libs
19                         clover
20                         drivers
21                         osmesa
22
23 OPTIONS_AVAILABLE=      X86_DRIVERS ARM_DRIVERS
24 OPTIONS_STANDARD=       X86_DRIVERS ARM_DRIVERS
25 OPT_ON[aarch64]=        ARM_DRIVERS
26 OPT_ON[x86_64]=         X86_DRIVERS
27 OPT_ON[i386]=           X86_DRIVERS
28
29 BUILD_DEPENDS=          libpthread-stubs:single:standard
30                         libclc:single:standard
31                         llvm40:llvm:standard
32                         llvm40:clang:standard
33                         zlib:complete:standard
34                         libelf:single:standard
35                         libvdpau:single:standard
36                         libva:single:standard
37                         expat:static:standard
38 BUILDRUN_DEPENDS=       expat:shared:standard
39                         libdrm:single:standard
40                         ocl-icd:primary:standard
41                         opencl:single:standard
42 EXRUN[clover]=          llvm40:llvm:standard
43                         zlib:shared:standard
44                         libelf:single:standard
45                         expat:shared:standard
46                         libdrm:single:standard
47 EXRUN[drivers]=         llvm40:llvm:standard
48                         mesa:libs:standard
49                         zlib:shared:standard
50                         libelf:single:standard
51 EXRUN[osmesa]=          llvm40:llvm:standard
52                         mesa:libs:standard
53                         zlib:shared:standard
54
55 USES=                   bison gettext-tools gmake libtool pkgconfig
56                         python:py27,build shebangfix
57                         c++:clover,drivers,osmesa
58 XORG_COMPONENTS=        dri2proto dri3proto glproto presentproto x11 xcb
59                         xdamage xext xfixes xshmfence xxf86vm xv xvmc
60
61 FPC_EQUIVALENT=         graphics/mesa-libs
62 SHEBANG_FILES=          src/gallium/*/*/*.py
63                         src/gallium/tools/trace/*.py
64                         src/gallium/drivers/svga/svgadump/svga_dump.py
65                         src/mapi/glapi/gen/*.py
66                         src/mapi/mapi_abi.py
67                         src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py
68                         src/mesa/main/get_*.py
69                         src/util/format_srgb.py
70                         src/amd/*/*.py
71                         src/intel/genxml/gen_pack_header.py
72 SHEBANG_OLD_PYTHON=     /usr/bin/env[[:space:]]python2
73                         /usr/bin/python2
74                         /bin/env[[:space:]]python
75
76 MUST_CONFIGURE=         gnu
77 CONFIGURE_ARGS=         --enable-llvm
78                         --enable-texture-float
79                         --enable-vdpau
80                         --enable-va
81                         --enable-xvmc
82                         --disable-glx-tls
83                         --disable-gles1
84                         --disable-libunwind
85                         --with-platforms=x11,drm
86                         --enable-gallium-osmesa
87                         --with-llvm-prefix={{LOCALBASE}}/llvm40
88                         --with-dri-drivers="{{DRI_DRIVERS:tl}}"
89                         --with-gallium_drivers="{{GALLIUM_DRIVERS:tl}}"
90
91 INSTALL_TARGET=         install-strip
92 INSTALL_REQ_TOOLCHAIN=  yes
93
94 LDFLAGS=                -Wl,-rpath={{LOCALBASE}}/llvm40/lib
95
96 [ARM_DRIVERS].DESCRIPTION=              Build drivers for aarch64 architecture
97 [ARM_DRIVERS].MAKEFILE_ON=              GALLIUM_DRIVERS+=FREEDRENO
98                                         GALLIUM_DRIVERS+=VC4
99
100 [X86_DRIVERS].DESCRIPTION=              Build drivers for i386 and x86_64 architectures
101 [X86_DRIVERS].CONFIGURE_ENABLE_BOTH=    opencl
102                                         opencl-icd
103 [X86_DRIVERS].MAKEFILE_ON=              DRI_DRIVERS+=RADEON
104                                         DRI_DRIVERS+=R200
105                                         DRI_DRIVERS+=I915
106                                         DRI_DRIVERS+=I965
107                                         GALLIUM_DRIVERS+=R300
108                                         GALLIUM_DRIVERS+=R600
109                                         GALLIUM_DRIVERS+=RADEONSI
110                                         GALLIUM_DRIVERS+=SVGA
111
112 post-install-X86_DRIVERS-OFF:
113         ${RM} -r ${STAGEDIR}/etc/OpenCL
114
115 post-patch:
116         @${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
117                 ${WRKSRC}/src/mesa/drivers/dri/common/xmlconfig.c
118
119 post-install-X86_DRIVERS-ON:
120         ${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/
121         ${RMDIR} ${STAGEDIR}/etc
122
123 post-patch-freebsd:
124         @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
125
126 [FILE:808:descriptions/desc.libs]
127 The Mesa project began as an open-source implementation of the OpenGL
128 specification - a system for rendering interactive 3D graphics.
129
130 Over the years the project has grown to implement more graphics APIs,
131 including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
132 XvMC and Vulkan.
133
134 A variety of device drivers allows the Mesa libraries to be used in many
135 different environments ranging from software emulation to complete
136 hardware acceleration for modern GPUs.
137
138 Mesa ties into several other open-source projects: the Direct Rendering
139 Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD
140 and other operating systems.
141
142 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
143 These include libEGL, libGL, and libglesv2 as well as utlity libraries
144 libglapi and gbm.
145
146
147 [FILE:130:descriptions/desc.clover]
148 This package contains Mesa's libOpenCL implementation "Clover".
149 It is built upon GALLIUM and currently only supports Radeon GPUs.
150
151
152 [FILE:162:descriptions/desc.drivers]
153 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
154 These include libEGL, libGL, and libglesv2 as well as utlity libraries
155 libglapi and gbm.
156
157
158 [FILE:591:descriptions/desc.osmesa]
159 Mesa is a 3-D graphics library with an API which is very similar to that
160 of OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax or
161 state machine, it is being used with authorization from Silicon Graphics,
162 Inc.  However, the author makes no claim that Mesa is in any way a
163 compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
164
165 This is a Off-Screen version of Mesa in order to do off-screen rendering in
166 other packages like VTK. Offscreen rendering is useful for a
167 number of things, such as batch processing, parallel processing, and
168 remote processing.
169
170
171 [FILE:97:distinfo]
172 3123448f770eae58bc73e15480e78909defb892f10ab777e9116c9b218094943     10335284 mesa-17.2.0.tar.xz
173
174
175 [FILE:721:manifests/plist.libs]
176 include/EGL/
177  egl.h
178  eglext.h
179  eglextchromium.h
180  eglmesaext.h
181  eglplatform.h
182 include/GL/
183  gl.h
184  gl_mangle.h
185  glcorearb.h
186  glext.h
187  glx.h
188  glx_mangle.h
189  glxext.h
190 include/GLES2/
191  gl2.h
192  gl2ext.h
193  gl2platform.h
194 include/GLES3/
195  gl3.h
196  gl31.h
197  gl32.h
198  gl3ext.h
199  gl3platform.h
200 include/KHR/khrplatform.h
201 include/gbm.h
202 lib/
203  libEGL.so
204  libEGL.so.1
205  libEGL.so.1.0.0
206  libGL.so
207  libGL.so.1
208  libGL.so.1.2.0
209  libGLESv2.so
210  libGLESv2.so.2
211  libGLESv2.so.2.0.0
212  libgbm.so
213  libgbm.so.1
214  libgbm.so.1.0.0
215  libglapi.so
216  libglapi.so.0
217  libglapi.so.0.0.0
218 @comment lib/libwayland-egl.so
219 @comment lib/libwayland-egl.so.1
220 @comment lib/libwayland-egl.so.1.0.0
221 lib/pkgconfig/
222  egl.pc
223  gbm.pc
224  gl.pc
225  glesv2.pc
226 @comment lib/pkgconfig/wayland-egl.pc
227
228
229 [FILE:245:manifests/plist.clover]
230 %%X86_DRIVERS-ON%%etc/OpenCL/vendors/mesa.icd
231 %%X86_DRIVERS-ON%%lib/gallium-pipe/
232  pipe_r300.so
233  pipe_r600.so
234  pipe_radeonsi.so
235  pipe_swrast.so
236  pipe_vmwgfx.so
237 %%X86_DRIVERS-ON%%lib/
238  libMesaOpenCL.so
239  libMesaOpenCL.so.1
240  libMesaOpenCL.so.1.0.0
241
242
243 [FILE:868:manifests/plist.drivers]
244 etc/drirc
245 include/GL/internal/dri_interface.h
246 %%X86_DRIVERS-ON%%lib/dri/
247  i915_dri.so
248  i965_dri.so
249 %%ARM_DRIVERS-ON%%lib/dri/
250  kgsl_dri.so
251 lib/dri/
252  kms_swrast_dri.so
253 %%ARM_DRIVERS-ON%%lib/dri/
254  msm_dri.so
255 %%X86_DRIVERS-ON%%lib/dri/
256  r200_dri.so
257  r300_dri.so
258  r600_dri.so
259  r600_drv_video.so
260  radeon_dri.so
261  radeonsi_dri.so
262  radeonsi_drv_video.so
263 lib/dri/
264  swrast_dri.so
265 %%ARM_DRIVERS-ON%%lib/dri/
266  vc4_dri.so
267 %%X86_DRIVERS-ON%%lib/dri/
268  vmwgfx_dri.so
269 %%X86_DRIVERS-ON%%lib/
270  libXvMCr600.so
271  libXvMCr600.so.1
272  libXvMCr600.so.1.0
273  libXvMCr600.so.1.0.0
274 %%X86_DRIVERS-ON%%lib/vdpau/
275  libvdpau_r300.so
276  libvdpau_r300.so.1
277  libvdpau_r300.so.1.0
278  libvdpau_r300.so.1.0.0
279  libvdpau_r600.so
280  libvdpau_r600.so.1
281  libvdpau_r600.so.1.0
282  libvdpau_r600.so.1.0.0
283  libvdpau_radeonsi.so
284  libvdpau_radeonsi.so.1
285  libvdpau_radeonsi.so.1.0
286  libvdpau_radeonsi.so.1.0.0
287 lib/pkgconfig/dri.pc
288
289
290 [FILE:99:manifests/plist.osmesa]
291 include/GL/osmesa.h
292 lib/
293  libOSMesa.so
294  libOSMesa.so.8
295  libOSMesa.so.8.0.0
296 lib/pkgconfig/osmesa.pc
297
298
299 [FILE:1408:patches/patch-configure]
300 --- configure.orig      2017-09-04 17:20:37 UTC
301 +++ configure
302 @@ -22746,7 +22746,7 @@ fi
303  
304  
305  case "$host_os" in
306 -linux*)
307 +linux* | freebsd* | dragonfly*)
308      dri3_default=yes
309      ;;
310  *)
311 @@ -26299,9 +26299,19 @@ if test "x$enable_opencl" = xyes; then
312          as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5
313      fi
314  
315 +    if test "x$acv_mesa_CLANG" = xno; then
316 +
317 +    GCC_VERSION=`$CC -dumpversion`
318 +    if test $? -eq 0; then
319 +        GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
320 +        GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
321 +    fi
322 +
323      if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then
324          as_fn_error $? "gcc >= 4.7 is required to build clover" "$LINENO" 5
325      fi
326 +# end of clang test.
327 +    fi
328  
329      if test "x$have_libclc" = xno; then
330          as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover.
331 @@ -26364,9 +26374,6 @@ rm -f core conftest.err conftest.$ac_obj
332          CLANG_LIBDIR=${LLVM_LIBDIR}
333      fi
334      CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
335 -    if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
336 -  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
337 -fi
338  fi
339   if test "x$enable_opencl" = xyes; then
340    HAVE_CLOVER_TRUE=
341
342
343 [FILE:529:patches/patch-include_GL_internal_dri__interface.h]
344 GCC on 9.x doesn't allow types to be overwritten, these types are defined
345 in drm.h also, which causes build issues in xorg-server.
346
347 --- include/GL/internal/dri_interface.h.orig    2016-11-10 22:05:17 UTC
348 +++ include/GL/internal/dri_interface.h
349 @@ -40,13 +40,7 @@
350  #ifndef DRI_INTERFACE_H
351  #define DRI_INTERFACE_H
352  
353 -#ifdef HAVE_LIBDRM
354  #include <drm.h>
355 -#else
356 -typedef unsigned int drm_context_t;
357 -typedef unsigned int drm_drawable_t;
358 -typedef struct drm_clip_rect drm_clip_rect_t;
359 -#endif
360  
361  /**
362   * \name DRI interface structures
363
364
365 [FILE:596:patches/patch-src_egl_drivers_dri2_platform__x11.c]
366 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
367 #
368 --- src/egl/drivers/dri2/platform_x11.c.orig    2017-09-04 17:20:31 UTC
369 +++ src/egl/drivers/dri2/platform_x11.c
370 @@ -1488,7 +1488,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG
371  
372     if (!getenv("LIBGL_ALWAYS_SOFTWARE")) {
373  #ifdef HAVE_DRI3
374 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
375 +      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
376 +#else
377        if (!getenv("LIBGL_DRI3_DISABLE"))
378 +#endif
379           initialized = dri2_initialize_x11_dri3(drv, disp);
380  #endif
381  
382
383
384 [FILE:3256:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c]
385 Revert the following commit.
386
387 FreeBSD and DragonFly don't have the required render nodes.
388
389 -------
390
391 From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
392 From: Emil Velikov <emil.l.velikov@gmail.com>
393 Date: Mon, 29 Jun 2015 12:36:45 +0100
394 Subject: pipe-loader: drop support for non-render node devices
395
396 Render nodes have been around for quite some time. Removing support via
397 the master/primary node allows us to clean up the conditional
398 compilation and simplify the build greatly.
399
400 For example currently we the pipe-loader, which explicitly links against
401 xcb and friends (for X auth) if found at compile-time. That
402 would cause problems as one will be forced to use X/xcb, even if it's a
403 headless system that is used for opencl.
404
405 v2: Clarify the linking topic in the commit message.
406
407 Cc: Tom Stellard <thomas.stellard@amd.com>
408 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
409 Reviewed-by: Francisco Jerez <currojerez@riseup.net>
410
411
412 --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig    2017-09-04 17:20:31 UTC
413 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
414 @@ -214,6 +214,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
415  }
416  
417  static int
418 +open_drm_minor(int minor)
419 +{
420 +   char path[PATH_MAX];
421 +   snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
422 +   return open(path, O_RDWR, 0);
423 +}
424 +
425 +static int
426  open_drm_render_node_minor(int minor)
427  {
428     char path[PATH_MAX];
429 @@ -225,8 +233,15 @@ open_drm_render_node_minor(int minor)
430  int
431  pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
432  {
433 -   int i, j, fd;
434 +   int i, k, fd, num_render_node_devs;
435 +   int j = 0;
436 +
437 +   struct {
438 +      unsigned vendor_id;
439 +      unsigned chip_id;
440 +   } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
441  
442 +   /* Look for render nodes first */
443     for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
444          i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
445        struct pipe_loader_device *dev;
446 @@ -240,6 +255,9 @@ pipe_loader_drm_probe(struct pipe_loader
447           continue;
448        }
449  
450 +      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
451 +      render_node_devs[j].chip_id = dev->u.pci.chip_id;
452 +
453        if (j < ndev) {
454           devs[j] = dev;
455        } else {
456 @@ -249,6 +267,46 @@ pipe_loader_drm_probe(struct pipe_loader
457        j++;
458     }
459  
460 +   num_render_node_devs = j;
461 +
462 +   /* Next look for drm devices. */
463 +   for (i = 0; i < DRM_MAX_MINOR; i++) {
464 +      struct pipe_loader_device *dev;
465 +      boolean duplicate = FALSE;
466 +      fd = open_drm_minor(i);
467 +      if (fd < 0)
468 +         continue;
469 +
470 +      if (!pipe_loader_drm_probe_fd(&dev, fd)) {
471 +         close(fd);
472 +         continue;
473 +      }
474 +
475 +      /* Check to make sure we aren't already accessing this device via
476 +       * render nodes.
477 +       */
478 +      for (k = 0; k < num_render_node_devs; k++) {
479 +         if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
480 +             dev->u.pci.chip_id == render_node_devs[k].chip_id) {
481 +            close(fd);
482 +            dev->ops->release(&dev);
483 +            duplicate = TRUE;
484 +            break;
485 +         }
486 +      }
487 +
488 +      if (duplicate)
489 +         continue;
490 +
491 +      if (j < ndev) {
492 +         devs[j] = dev;
493 +      } else {
494 +         dev->ops->release(&dev);
495 +      }
496 +
497 +      j++;
498 +   }
499 +
500     return j;
501  }
502  
503
504
505 [FILE:504:patches/patch-src_gallium_auxiliary_util_u__network.c]
506 --- src/gallium/auxiliary/util/u_network.c.orig 2016-11-10 22:05:17 UTC
507 +++ src/gallium/auxiliary/util/u_network.c
508 @@ -6,7 +6,7 @@
509  #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
510  #  include <winsock2.h>
511  #  include <windows.h>
512 -#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
513 +#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_HAIKU) || \
514     defined(PIPE_OS_APPLE) || defined(PIPE_OS_CYGWIN) || defined(PIPE_OS_SOLARIS)
515  #  include <sys/socket.h>
516  #  include <netinet/in.h>
517
518
519 [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c]
520 # define ETIME as ETIMEOUT same as in intel driver
521 #
522 --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig   2017-05-10 14:13:57 UTC
523 +++ src/gallium/drivers/vc4/vc4_bufmgr.c
524 @@ -27,6 +27,9 @@
525  #include <fcntl.h>
526  #include <xf86drm.h>
527  #include <xf86drmMode.h>
528 +#ifndef ETIME
529 +#define ETIME ETIMEDOUT
530 +#endif
531  
532  #include "util/u_hash_table.h"
533  #include "util/u_memory.h"
534
535
536 [FILE:1043:patches/patch-src_gallium_include_pipe_p__config.h]
537 --- src/gallium/include/pipe/p_config.h.orig    2017-09-04 17:20:31 UTC
538 +++ src/gallium/include/pipe/p_config.h
539 @@ -77,6 +77,13 @@
540  #define PIPE_CC_ICL
541  #endif
542  
543 +#if defined(__sparc__) || defined(__sparc64__)
544 +#define PIPE_ARCH_SPARC
545 +#if defined(__sparc64__)
546 +#define PIPE_ARCH_SPARC_64
547 +#endif
548 +#endif
549 +
550  
551  /*
552   * Processor architecture
553 @@ -131,7 +138,7 @@
554  
555  #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
556  #define PIPE_ARCH_LITTLE_ENDIAN
557 -#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390)
558 +#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64) || defined(PIPE_ARCH_S390) || defined(PIPE_ARCH_SPARC) || defined(PIPE_ARCH_SPARC_64)
559  #define PIPE_ARCH_BIG_ENDIAN
560  #endif
561  
562 @@ -160,6 +167,12 @@
563  #define PIPE_OS_ANDROID
564  #endif
565  
566 +#if defined(__DragonFly__)
567 +#define PIPE_OS_DRAGONFLY
568 +#define PIPE_OS_BSD
569 +#define PIPE_OS_UNIX
570 +#endif
571 +
572  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
573  #define PIPE_OS_FREEBSD
574  #define PIPE_OS_BSD
575
576
577 [FILE:1577:patches/patch-src_gallium_state__trackers_clover_llvm_invocation.cpp]
578 # fix errors like the following
579 #
580 # llvm/invocation.cpp:(.text+0x1275): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::c_str()
581  const'
582 # /usr/bin/ld: ../../../../src/gallium/state_trackers/clover/.libs/libclover.a(libclllvm_la-invocation.o): relocation R_X86_64_PC32 against `_ZNKSt3__112bas
583 ic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5c_strEv' can not be used when making a shared object; recompile with -fPIC
584 # /usr/bin/ld: final link failed: Bad value
585 #
586 --- src/gallium/state_trackers/clover/llvm/invocation.cpp.orig  2017-04-01 15:33:37 UTC
587 +++ src/gallium/state_trackers/clover/llvm/invocation.cpp
588 @@ -93,6 +93,8 @@ namespace {
589        return ctx;
590     }
591  
592 +   const char* cstr(const std::string& str) { return str.c_str(); }
593 +
594     std::unique_ptr<clang::CompilerInstance>
595     create_compiler_instance(const target &target,
596                              const std::vector<std::string> &opts,
597 @@ -105,8 +107,8 @@ namespace {
598        // Parse the compiler options.  A file name should be present at the end
599        // and must have the .cl extension in order for the CompilerInvocation
600        // class to recognize it as an OpenCL source file.
601 -      const std::vector<const char *> copts =
602 -         map(std::mem_fn(&std::string::c_str), opts);
603 +      std::vector<const char *> copts(opts.size());
604 +      std::transform(opts.begin(), opts.end(), copts.begin(), cstr);
605  
606        if (!clang::CompilerInvocation::CreateFromArgs(
607               c->getInvocation(), copts.data(), copts.data() + copts.size(), diag))
608
609
610 [FILE:635:patches/patch-src_gallium_state__trackers_clover_llvm_metadata.hpp]
611 # Fix error: no matching constructor for initialization of 'std::vector<const ::llvm::MDNode *>' 
612 #
613 --- src/gallium/state_trackers/clover/llvm/metadata.hpp.orig    2016-11-10 22:05:17 UTC
614 +++ src/gallium/state_trackers/clover/llvm/metadata.hpp
615 @@ -42,7 +42,7 @@ namespace clover {
616           get_kernel_nodes(const ::llvm::Module &mod) {
617              if (const ::llvm::NamedMDNode *n =
618                     mod.getNamedMetadata("opencl.kernels"))
619 -               return { n->op_begin(), n->op_end() };
620 +               return { n->getOperand(0), n->getOperand(n->getNumOperands()) };
621              else
622                 return {};
623           }
624
625
626 [FILE:1150:patches/patch-src_gallium_state__trackers_clover_util_range.hpp]
627 From b95533b981af9a6687b41418e7cc2a5652fc2bdb Mon Sep 17 00:00:00 2001
628 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= <dumbbell@FreeBSD.org>
629 Date: Fri, 7 Mar 2014 15:16:08 +0100
630 Subject: [PATCH 3/3] Work around for clang 3.4 which fails to build Clover
631
632 See:
633   https://bugs.freedesktop.org/show_bug.cgi?id=74098#c3
634 --- src/gallium/state_trackers/clover/util/range.hpp.orig       2016-11-10 22:05:17 UTC
635 +++ src/gallium/state_trackers/clover/util/range.hpp
636 @@ -362,6 +362,12 @@ namespace clover {
637        return { i, i + n };
638     }
639  
640 +   namespace detail {
641 +      template<typename T>
642 +      using fixup_function_type =
643 +         typename std::conditional<std::is_function<T>::value, T &, T>::type;
644 +   }
645 +
646     ///
647     /// Create a range by transforming the contents of a number of
648     /// source ranges \a rs element-wise using a provided functor \a f.
649 @@ -369,7 +375,7 @@ namespace clover {
650     /// \sa adaptor_range.
651     ///
652     template<typename F, typename... Rs>
653 -   adaptor_range<F, Rs...>
654 +   adaptor_range<detail::fixup_function_type<F>, Rs...>
655     map(F &&f, Rs &&... rs) {
656        return { std::forward<F>(f), std::forward<Rs>(rs)... };
657     }
658
659
660 [FILE:429:patches/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c]
661 --- src/gallium/winsys/svga/drm/vmw_screen_ioctl.c.orig 2016-11-10 22:05:17 UTC
662 +++ src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
663 @@ -70,6 +70,11 @@ vmw_region_size(struct vmw_region *regio
664     return region->size;
665  }
666  
667 +#if defined(__DragonFly__) || defined(__FreeBSD__) || \
668 +    defined(__NetBSD__) || defined(__OpenBSD__)
669 +#define ERESTART EINTR
670 +#endif
671 +
672  uint32
673  vmw_ioctl_context_create(struct vmw_winsys_screen *vws)
674  {
675
676
677 [FILE:633:patches/patch-src_glx_glxext.c]
678 # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627
679 #
680 --- src/glx/glxext.c.orig       2017-04-01 15:33:37 UTC
681 +++ src/glx/glxext.c
682 @@ -906,7 +906,11 @@ __glXInitialize(Display * dpy)
683  #if defined(GLX_USE_DRM)
684     if (glx_direct && glx_accel) {
685  #if defined(HAVE_DRI3)
686 +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined (__DRM_NEXT__)
687 +      if (getenv("LIBGL_DRI3_ENABLE") && !getenv("LIBGL_DRI3_DISABLE"))
688 +#else
689        if (!getenv("LIBGL_DRI3_DISABLE"))
690 +#endif
691           dpyPriv->dri3Display = dri3_create_display(dpy);
692  #endif /* HAVE_DRI3 */
693        dpyPriv->dri2Display = dri2CreateDisplay(dpy);
694
695
696 [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c]
697 # expose getline in FreeBSD's stdio.h
698 #
699 --- src/intel/tools/aubinator_error_decode.c.orig       2017-05-10 14:13:57 UTC
700 +++ src/intel/tools/aubinator_error_decode.c
701 @@ -22,6 +22,9 @@
702   *
703   */
704  
705 +#ifdef __FreeBSD__
706 +#define _WITH_GETLINE
707 +#endif
708  #include <stdbool.h>
709  #include <stdio.h>
710  #include <stdlib.h>
711
712
713 [FILE:619:patches/patch-src_mapi_glapi_gen_gl__gentable.py]
714 --- src/mapi/glapi/gen/gl_gentable.py.orig      2017-05-15 12:05:59 UTC
715 +++ src/mapi/glapi/gen/gl_gentable.py
716 @@ -43,7 +43,7 @@ header = """/* GLXEXT is the define used
717  #endif
718  
719  #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
720 -       || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
721 +       || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__))
722  #define USE_BACKTRACE
723  #endif
724  
725
726
727 [FILE:406:patches/patch-src_mesa_main_compiler.h]
728 --- src/mesa/main/compiler.h.orig       2017-05-10 14:13:57 UTC
729 +++ src/mesa/main/compiler.h
730 @@ -51,6 +51,9 @@
731  #if defined(__linux__)
732  #include <byteswap.h>
733  #define CPU_TO_LE32( x )       bswap_32( x )
734 +#elif defined(__FreeBSD__)
735 +#include <sys/endian.h>
736 +#define CPU_TO_LE32( x )       bswap32( x )
737  #elif defined(__APPLE__)
738  #include <CoreFoundation/CFByteOrder.h>
739  #define CPU_TO_LE32( x )       CFSwapInt32HostToLittle( x )
740
741
742 [FILE:377:patches/patch-src_util_build__id.c]
743 # Elf_ doesn't exist, use Elf32_ or Elf64_
744 #
745 --- src/util/build_id.c.orig    2017-05-10 14:13:58 UTC
746 +++ src/util/build_id.c
747 @@ -33,7 +33,11 @@
748  #endif
749  
750  #ifndef ElfW
751 -#define ElfW(type) Elf_##type
752 +#ifdef __LP64__
753 +#define ElfW(type) Elf64_##type
754 +#else
755 +#define ElfW(type) Elf32_##type
756 +#endif
757  #endif
758  
759  #define ALIGN(val, align)      (((val) + (align) - 1) & ~((align) - 1))
760
761
762 [FILE:343:patches/patch-src_util_u__endian.h]
763 --- src/util/u_endian.h.orig    2016-11-10 22:05:17 UTC
764 +++ src/util/u_endian.h
765 @@ -54,7 +54,7 @@
766  # define PIPE_ARCH_BIG_ENDIAN
767  #endif
768  
769 -#elif defined(__OpenBSD__) || defined(__NetBSD__)
770 +#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
771  #include <sys/types.h>
772  #include <machine/endian.h>
773  
774
775
776 [FILE:47:files/special.mk]
777 DRI_DRIVERS+=           SWRAST
778 GALLIUM_DRIVERS+=       SWRAST
779
780
781 [FILE:686:dragonfly/patch-src_intel_tools_aubinator.c]
782 # We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and
783 # hope for the best (this alloc is too big but it's only a test)
784 #
785 --- src/intel/tools/aubinator.c.orig    2017-09-04 17:20:31 UTC
786 +++ src/intel/tools/aubinator.c
787 @@ -1237,7 +1237,7 @@ int main(int argc, char *argv[])
788     /* mmap a terabyte for our gtt space. */
789     gtt_size = 1ull << 40;
790     gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE,
791 -              MAP_PRIVATE | MAP_ANONYMOUS |  MAP_NORESERVE, -1, 0);
792 +              MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0);
793     if (gtt == MAP_FAILED) {
794        fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno));
795        exit(EXIT_FAILURE);
796
797
798 [FILE:686:freebsd/patch-src_intel_tools_aubinator.c]
799 # We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and
800 # hope for the best (this alloc is too big but it's only a test)
801 #
802 --- src/intel/tools/aubinator.c.orig    2017-05-10 14:13:57 UTC
803 +++ src/intel/tools/aubinator.c
804 @@ -1221,7 +1221,7 @@ int main(int argc, char *argv[])
805     /* mmap a terabyte for our gtt space. */
806     gtt_size = 1ull << 40;
807     gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE,
808 -              MAP_PRIVATE | MAP_ANONYMOUS |  MAP_NORESERVE, -1, 0);
809 +              MAP_PRIVATE | MAP_ANONYMOUS | MAP_NOSYNC | MAP_NOCORE, -1, 0);
810     if (gtt == MAP_FAILED) {
811        fprintf(stderr, "failed to alloc gtt space: %s\n", strerror(errno));
812        exit(EXIT_FAILURE);
813