Ravenports generated: 12 Feb 2024 04:56
[ravenports.git] / bucket_F0 / mesa
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               mesa
4 VERSION=                23.1.9
5 REVISION=               1
6 KEYWORDS=               graphics
7 VARIANTS=               standard
8 SDESC[standard]=        Mesa 3D Graphics Library
9 HOMEPAGE=               https://www.mesa3d.org/
10 CONTACT=                nobody
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            https://mesa.freedesktop.org/archive/
14                         ftp://ftp.freedesktop.org/pub/mesa/
15 DISTFILE[1]=            mesa-23.1.9.tar.xz:main
16 DF_INDEX=               1
17 SPKGS[standard]=        complete
18                         primary
19                         drivers
20                         dev
21
22 OPTIONS_AVAILABLE=      X86_DRIVERS ARM_DRIVERS LLVMPIPE WAYLAND
23 OPTIONS_STANDARD=       X86_DRIVERS ARM_DRIVERS LLVMPIPE
24 OPT_ON[freebsd]=        LLVMPIPE//i386|x86_64
25 OPT_ON[aarch64]=        ARM_DRIVERS
26 OPT_ON[linux]=          LLVMPIPE//i386|x86_64
27 OPT_ON[x86_64]=         X86_DRIVERS
28 OPT_ON[netbsd]=         LLVMPIPE//i386|x86_64
29 OPT_ON[dragonfly]=      LLVMPIPE//i386|x86_64
30 OPT_ON[i386]=           X86_DRIVERS
31 OPT_ON[midnightbsd]=    LLVMPIPE//i386|x86_64
32
33 BUILD_DEPENDS=          libdrm:dev:standard
34                         libelf:dev:standard
35                         libelf:primary:standard
36                         libva:dev:standard
37                         libvdpau:dev:standard
38                         python-Mako:single:python_used
39 BUILDRUN_DEPENDS=       libdrm:primary:standard
40 EXRUN[drivers]=         mesa:primary:standard
41                         libelf:primary:standard
42
43 USES=                   cpe bison gettext:build gmake meson pkgconfig zstd
44                         zlib expat shebangfix solaris-funcs python:build
45                         c++:primary,drivers
46 XORG_COMPONENTS=        x11 xdamage xext xfixes xshmfence xxf86vm xv xrandr
47                         xcb
48
49 LICENSE=                MIT:primary CUSTOM1:primary CUSTOM2:primary
50 LICENSE_NAME=           CUSTOM1:"Kronos License (MIT with modifications)"
51                         CUSTOM2:"SGI Free Software License B"
52 LICENSE_FILE=           MIT:{{WRKDIR}}/LICENSE_MIT
53                         CUSTOM1:{{WRKDIR}}/LICENSE_KHRONOS
54                         CUSTOM2:{{WRKDIR}}/LICENSE_SGI
55 LICENSE_AWK=            MIT:"^$$"
56                         CUSTOM2:"^$$"
57 LICENSE_SOURCE=         MIT:{{WRKSRC}}/include/GL/gl.h
58                         CUSTOM2:{{WRKSRC}}/src/glx/eval.c
59 LICENSE_SCHEME=         multi
60
61 CPE_VENDOR=             mesa3d
62 FPC_EQUIVALENT=         graphics/mesa-libs
63 MESON_ARGS=             -Dplatforms=x11{{WAYPLAT}}
64                         -Dzstd=enabled
65                         -Ddri3=enabled
66                         -Dgallium-drivers={{GALLIUM_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
67                         -Dosmesa=true
68                         -Dlibunwind=disabled
69                         -Dgles1=disabled
70                         -Dgles2=disabled
71                         -Dglx=auto
72                         -Dopengl=true
73                         -Degl=disabled
74                         -Dvulkan-drivers={{VULKAN_DRIVERS:tW:tl:C/[[:space:]]/,/g}}
75 SHEBANG_FILES=          src/gallium/*/*/*.py
76                         src/gallium/tools/trace/*.py
77                         src/gallium/drivers/svga/svgadump/svga_dump.py
78                         src/mapi/glapi/gen/*.py
79                         src/mapi/mapi_abi.py
80                         src/mesa/main/get_*.py
81                         src/util/format_srgb.py
82                         src/amd/*/*.py
83                         src/intel/genxml/gen_pack_header.py
84 SHEBANG_OLD_PYTHON=     /usr/bin/env[[:space:]]python2
85                         /usr/bin/python2
86                         /bin/env[[:space:]]python
87 SOL_FUNCTIONS=          dirfd:src/util/disk_cache.c
88                         asprintf:src/util/anon_file.c
89                         asprintf:src/mesa/drivers/dri/common/megadriver_stub.c
90                         asprintf:src/loader/loader.c
91                         asprintf:src/egl/main/eglcurrent.c
92                         asprintf:src/util/u_string.h
93                         asprintf:src/amd/common/ac_rtld.c
94                         strnlen:src/util/ralloc.c
95                         strnlen:src/mesa/main/errors.c
96                         strndup:src/loader/loader.c
97                         strndup:src/egl/drivers/dri2/platform_x11.c
98                         strndup:src/gallium/drivers/r600/evergreen_compute.c
99                         strndup:src/gallium/drivers/radeonsi/si_debug.c
100
101 CONFIGURE_ENV=          ax_cv_check_cflags___Wno_initializer_overrides=no
102
103 INSTALL_TARGET=         install-strip
104 INSTALL_REQ_TOOLCHAIN=  yes
105
106 CFLAGS=                 -Wno-pointer-sign
107 VAR_OPSYS[sunos]=       CPPFLAGS=-D__EXTENSIONS__=1
108                         CPPFLAGS=-Wno-unused-function
109                         CXXFLAGS=-Drestrict=__restrict__
110                         CFLAGS=-D_POSIX_PTHREAD_SEMANTICS
111                         CFLAGS=-DF_DUPFD_CLOEXEC=F_DUPFD
112                         CFLAGS=-Wno-incompatible-pointer-types
113                         LDFLAGS=-lsocket
114                         LDFLAGS=-lnsl
115                         MAKEFILE_LINE=MESON_ARGS+=-Dshader-cache=false
116
117 [ARM_DRIVERS].DESCRIPTION=              Build drivers for aarch64 architecture
118 [ARM_DRIVERS].MAKEFILE_ON=              GALLIUM_DRIVERS+=FREEDRENO
119                                         GALLIUM_DRIVERS+=VC4
120
121 [X86_DRIVERS].DESCRIPTION=              Build drivers for i386 and x86_64 architectures
122 [X86_DRIVERS].MAKEFILE_ON=              GALLIUM_DRIVERS+=R300
123                                         GALLIUM_DRIVERS+=SVGA
124                                         VULKAN_DRIVERS+={{VULKAN_DRIVERS_X86}}
125
126 [WAYLAND].DESCRIPTION=                  Build Vulkan drivers for Wayland platform
127 [WAYLAND].BUILDRUN_DEPENDS_ON=          wayland:primary:standard
128 [WAYLAND].BUILD_DEPENDS_ON=             wayland-protocols:single:standard
129                                         python-Mako:single:python_default
130                                         wayland:dev:standard
131 [WAYLAND].MAKEFILE_ON=                  WAYPLAT=,wayland
132                                         VULKAN_DRIVERS+=INTEL
133                                         VULKAN_DRIVERS_X86+=RADEON
134
135 [LLVMPIPE].DESCRIPTION=                 Build LLVM-based drivers and libraries
136 [LLVMPIPE].BUILDRUN_DEPENDS_ON=         llvm16:primary:standard
137                                         ocl-icd:primary:standard
138 [LLVMPIPE].BUILD_DEPENDS_ON=            libclc:single:standard
139                                         opencl-headers:single:standard
140                                         ocl-icd:dev:standard
141                                         llvm16:tools:standard
142                                         llvm16:dev:standard
143                                         clang16:complete:standard
144 [LLVMPIPE].MAKEFILE_OFF=                MESON_ARGS+=-Dgallium-opencl=disabled
145 [LLVMPIPE].MAKEFILE_ON=                 GALLIUM_LLVM_DRIVERS+=R600
146                                         GALLIUM_LLVM_DRIVERS+=RADEONSI
147                                         GALLIUM_DRIVERS+={{GALLIUM_LLVM_DRIVERS}}
148                                         MESON_ARGS+=-Dllvm=true
149                                         MESON_ARGS+=-Dgallium-va=enabled
150                                         MESON_ARGS+=-Dgallium-opencl=icd
151                                         MESON_ARGS+=-Dgallium-vdpau=enabled
152 [LLVMPIPE].RUN_DEPENDS_ON=              clang16:dynlibs:standard
153
154 pre-patch-linux:
155         # qsort fixes for BSD break linux
156         ${RM} ${PATCHDIR}/patch-meson.build
157
158 post-install:
159         ${RM} ${STAGEDIR}${PREFIX}/lib/libGL.so*
160         ${RM} ${STAGEDIR}${PREFIX}/include/GL/g*.h
161         ${RM} ${STAGEDIR}${PREFIX}/lib/pkgconfig/gl.pc
162         ${RM} -r ${STAGEDIR}${PREFIX}/include/KHR
163         ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \
164                 ${STAGEDIR}${PREFIX}/share/drirc.d
165
166 pre-configure:
167         ${REINPLACE_CMD} \
168                 -e '/SYSCONFDIR/ s|/etc|${PREFIX}/etc|g' \
169                 -e '/DATADIR/ s|/usr/share|${PREFIX}/share|g' \
170                 ${WRKSRC}/src/util/xmlconfig.c
171
172 post-extract:
173         ${AWK} '/Copyright/,/DEALINGS/' ${WRKSRC}/include/GL/glext.h \
174                 > ${WRKDIR}/LICENSE_KHRONOS
175
176 [FILE:1198:descriptions/desc.primary]
177 The Mesa project began as an open-source implementation of the OpenGL
178 specification - a system for rendering interactive 3D graphics.
179
180 Over the years the project has grown to implement more graphics APIs,
181 including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
182 XvMC and Vulkan.
183
184 A variety of device drivers allows the Mesa libraries to be used in many
185 different environments ranging from software emulation to complete
186 hardware acceleration for modern GPUs.
187
188 Mesa ties into several other open-source projects: the Direct Rendering
189 Infrastructure and X.org to provide OpenGL support on Linux, FreeBSD
190 and other operating systems.
191
192 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
193 These include libOSMesa, libEGL, libGL, and libglesv2 as well as utility
194 libraries libglapi and gbm.  The OSMesa library is an Off-Screen version
195 of Mesa in order to do off-screen rendering in other packages like VTK.
196 Offscreen rendering is useful for a number of things, such as batch
197 processing, parallel processing, and remote processing.
198
199 This package also contains Mesa's libOpenCL implementation "Clover".  It is
200 built upon GALLIUM and currently only supports Radeon GPUs.
201
202
203 [FILE:162:descriptions/desc.drivers]
204 This package contains the Mesa OpenGL libraries for GLX and EGL clients.
205 These include libEGL, libGL, and libglesv2 as well as utlity libraries
206 libglapi and gbm.
207
208
209 [FILE:97:distinfo]
210 295ba27c28146ed09214e8ce79afa1659edf9d142decc3c91f804552d64f7510     18589464 mesa-23.1.9.tar.xz
211
212
213 [FILE:365:manifests/plist.primary]
214 %%LLVMPIPE-ON%%etc/OpenCL/vendors/mesa.icd
215 %%LLVMPIPE-ON%%lib/
216  libMesaOpenCL.so.1
217  libMesaOpenCL.so.1.0.0
218 %%LLVMPIPE-ON%%lib/gallium-pipe/
219  pipe_r300.so
220  pipe_r600.so
221  pipe_radeonsi.so
222  pipe_swrast.so
223  pipe_vmwgfx.so
224 lib/
225  libOSMesa.so.8
226  libOSMesa.so.8.0.0
227  libgbm.so.1
228  libgbm.so.1.0.0
229  libglapi.so.0
230  libglapi.so.0.0.0
231  libxatracker.so.2
232  libxatracker.so.2.5.0
233
234
235 [FILE:483:manifests/plist.drivers]
236 %%ARM_DRIVERS-ON%%lib/dri/
237  kgsl_dri.so
238  msm_dri.so
239  vc4_dri.so
240 %%LLVMPIPE-ON%%lib/dri/
241  r600_dri.so
242  r600_drv_video.so
243  radeonsi_dri.so
244  radeonsi_drv_video.so
245 %%LLVMPIPE-ON%%lib/vdpau/
246  libvdpau_r600.so.1
247  libvdpau_r600.so.1.0
248  libvdpau_r600.so.1.0.0
249  libvdpau_radeonsi.so.1
250  libvdpau_radeonsi.so.1.0
251  libvdpau_radeonsi.so.1.0.0
252 %%X86_DRIVERS-ON%%lib/dri/
253  r300_dri.so
254  vmwgfx_dri.so
255 lib/dri/
256  kms_swrast_dri.so
257  swrast_dri.so
258 share/drirc.d/
259  00-mesa-defaults.conf
260  01-freebsd.conf
261
262
263 [FILE:334:manifests/plist.dev]
264 %%LLVMPIPE-ON%%lib/libMesaOpenCL.so
265 %%LLVMPIPE-ON%%lib/vdpau/
266  libvdpau_r600.so
267  libvdpau_radeonsi.so
268 include/
269  gbm.h
270  xa_composite.h
271  xa_context.h
272  xa_tracker.h
273 include/GL/osmesa.h
274 include/GL/internal/dri_interface.h
275 lib/
276  libOSMesa.so
277  libgbm.so
278  libglapi.so
279  libxatracker.so
280 lib/pkgconfig/
281  dri.pc
282  gbm.pc
283  osmesa.pc
284  xatracker.pc
285
286
287 [FILE:2264:patches/patch-meson.build]
288 --- meson.build.orig    2023-10-04 13:53:02 UTC
289 +++ meson.build
290 @@ -121,7 +121,8 @@ with_any_opengl = with_opengl or with_gl
291  # Only build shared_glapi if at least one OpenGL API is enabled
292  with_shared_glapi = with_shared_glapi and with_any_opengl
293  
294 -system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system())
295 +system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly',
296 +'linux', 'sunos', 'android', 'midnightbsd'].contains(host_machine.system())
297  
298  gallium_drivers = get_option('gallium-drivers')
299  if gallium_drivers.contains('auto')
300 @@ -1025,7 +1026,7 @@ else
301    endif
302  
303    # FreeBSD annotated <pthread.h> but Mesa isn't ready
304 -  if not (cc.get_id() == 'clang' and host_machine.system() == 'freebsd')
305 +  if not (cc.get_id() == 'clang' and ['freebsd', 'midnightbsd'].contains(host_machine.system()))
306      _trial_c += ['-Werror=thread-safety']
307    endif
308  
309 @@ -1287,34 +1288,34 @@ foreach f, prefix: functions_to_detect
310  endforeach
311  
312  if cpp.links('''
313 -    #define _GNU_SOURCE
314      #include <stdlib.h>
315  
316 -    static int dcomp(const void *l, const void *r, void *t) { return 0; }
317 +    static int dcomp(void *t, const void *l, const void *r) { return 0; }
318  
319      int main(int ac, char **av) {
320        int arr[] = { 1 };
321        void *t = NULL;
322 -      qsort_r((void*)&arr[0], 1, 1, dcomp, t);
323 +      qsort_r((void*)&arr[0], 1, 1, t, dcomp);
324        return (0);
325      }''',
326      args : pre_args,
327 -    name : 'GNU qsort_r')
328 -  pre_args += '-DHAVE_GNU_QSORT_R'
329 +    name : 'BSD qsort_r')
330 +  pre_args += '-DHAVE_BSD_QSORT_R'
331  elif cpp.links('''
332 +    #define _GNU_SOURCE
333      #include <stdlib.h>
334  
335 -    static int dcomp(void *t, const void *l, const void *r) { return 0; }
336 +    static int dcomp(const void *l, const void *r, void *t) { return 0; }
337  
338      int main(int ac, char **av) {
339        int arr[] = { 1 };
340        void *t = NULL;
341 -      qsort_r((void*)&arr[0], 1, 1, t, dcomp);
342 +      qsort_r((void*)&arr[0], 1, 1, dcomp, t);
343        return (0);
344      }''',
345      args : pre_args,
346 -    name : 'BSD qsort_r')
347 -  pre_args += '-DHAVE_BSD_QSORT_R'
348 +    name : 'GNU qsort_r')
349 +  pre_args += '-DHAVE_GNU_QSORT_R'
350  endif
351  
352  if cc.has_header_symbol('time.h', 'struct timespec')
353
354
355 [FILE:227:patches/patch-src_amd_llvm_ac__llvm__build.h]
356 --- src/amd/llvm/ac_llvm_build.h.orig   2023-10-04 13:53:02 UTC
357 +++ src/amd/llvm/ac_llvm_build.h
358 @@ -35,6 +35,10 @@
359  
360  #include <stdbool.h>
361  
362 +#ifdef __sun
363 +#include <alloca.h>
364 +#endif
365 +
366  #ifdef __cplusplus
367  extern "C" {
368  #endif
369
370
371 [FILE:512:patches/patch-src_amd_vulkan_radv__device.c]
372 - Define CLOCK_MONOTONIC_RAW if missing
373
374 --- src/amd/vulkan/radv_device.c.orig   2023-10-04 13:53:02 UTC
375 +++ src/amd/vulkan/radv_device.c
376 @@ -443,6 +443,14 @@ radv_parse_force_vrs_config_file(const c
377  
378  #define BUF_LEN ((10 * (sizeof(struct inotify_event) + NAME_MAX + 1)))
379  
380 +#ifndef CLOCK_MONOTONIC_RAW
381 +# ifdef CLOCK_MONOTONIC_FAST
382 +#  define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
383 +# else
384 +#  define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
385 +# endif
386 +#endif
387 +
388  static int
389  radv_notifier_thread_run(void *data)
390  {
391
392
393 [FILE:354:patches/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c]
394 - Define ETIME if missing
395
396 --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c.orig  2023-10-04 13:53:02 UTC
397 +++ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
398 @@ -48,6 +48,10 @@
399  
400  enum { VIRTUAL_BUFFER_HASH_TABLE_SIZE = 1024 };
401  
402 +#ifndef ETIME
403 +#define ETIME ETIMEDOUT
404 +#endif
405 +
406  struct radv_amdgpu_ib {
407     struct radeon_winsys_bo *bo;
408     unsigned cdw;
409
410
411 [FILE:544:patches/patch-src_egl_drivers_dri2_egl__dri2.c]
412 --- src/egl/drivers/dri2/egl_dri2.c.orig        2023-10-04 13:53:02 UTC
413 +++ src/egl/drivers/dri2/egl_dri2.c
414 @@ -918,11 +918,13 @@ dri2_setup_screen(_EGLDisplay *disp)
415           disp->Extensions.KHR_gl_texture_3D_image = EGL_TRUE;
416  
417  #ifdef HAVE_LIBDRM
418 +# ifndef __DragonFly__
419        if (dri2_dpy->image->base.version >= 8 &&
420            dri2_dpy->image->createImageFromDmaBufs) {
421           disp->Extensions.EXT_image_dma_buf_import = EGL_TRUE;
422           disp->Extensions.EXT_image_dma_buf_import_modifiers = EGL_TRUE;
423        }
424 +# endif
425  #endif
426     }
427  
428
429
430 [FILE:796:patches/patch-src_egl_drivers_dri2_platform__wayland.c]
431 --- src/egl/drivers/dri2/platform_wayland.c.orig        2023-10-04 13:53:02 UTC
432 +++ src/egl/drivers/dri2/platform_wayland.c
433 @@ -2014,12 +2014,14 @@ registry_handle_global_drm(void *data, s
434     if (strcmp(interface, wl_drm_interface.name) == 0) {
435        dri2_dpy->wl_drm_version = MIN2(version, 2);
436        dri2_dpy->wl_drm_name = name;
437 +#ifndef __DragonFly__
438     } else if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
439        dri2_dpy->wl_dmabuf =
440           wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
441                            MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION));
442        zwp_linux_dmabuf_v1_add_listener(dri2_dpy->wl_dmabuf, &dmabuf_listener,
443                                         dri2_dpy);
444 +#endif
445     }
446  }
447  
448
449
450 [FILE:281:patches/patch-src_egl_main_eglglobals.c]
451 --- src/egl/main/eglglobals.c.orig      2023-10-04 13:53:02 UTC
452 +++ src/egl/main/eglglobals.c
453 @@ -41,6 +41,10 @@
454  #include "util/macros.h"
455  #include "util/os_misc.h"
456  
457 +#ifdef __DragonFly__
458 +#undef HAVE_MINCORE
459 +#endif
460 +
461  #ifdef HAVE_MINCORE
462  #include <unistd.h>
463  #include <sys/mman.h>
464
465
466 [FILE:3256:patches/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c]
467 Revert the following commit.
468
469 FreeBSD and DragonFly don't have the required render nodes.
470
471 -------
472
473 From 69a1b9959e59653da262185c4e2cf57d24939b19 Mon Sep 17 00:00:00 2001
474 From: Emil Velikov <emil.l.velikov@gmail.com>
475 Date: Mon, 29 Jun 2015 12:36:45 +0100
476 Subject: pipe-loader: drop support for non-render node devices
477
478 Render nodes have been around for quite some time. Removing support via
479 the master/primary node allows us to clean up the conditional
480 compilation and simplify the build greatly.
481
482 For example currently we the pipe-loader, which explicitly links against
483 xcb and friends (for X auth) if found at compile-time. That
484 would cause problems as one will be forced to use X/xcb, even if it's a
485 headless system that is used for opencl.
486
487 v2: Clarify the linking topic in the commit message.
488
489 Cc: Tom Stellard <thomas.stellard@amd.com>
490 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
491 Reviewed-by: Francisco Jerez <currojerez@riseup.net>
492
493
494 --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig    2023-10-04 13:53:02 UTC
495 +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
496 @@ -199,6 +199,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa
497  }
498  
499  static int
500 +open_drm_minor(int minor)
501 +{
502 +   char path[PATH_MAX];
503 +   snprintf(path, sizeof(path), DRM_DEV_NAME, DRM_DIR_NAME, minor);
504 +   return open(path, O_RDWR, 0);
505 +}
506 +
507 +static int
508  open_drm_render_node_minor(int minor)
509  {
510     char path[PATH_MAX];
511 @@ -210,8 +218,15 @@ open_drm_render_node_minor(int minor)
512  int
513  pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev)
514  {
515 -   int i, j, fd;
516 +   int i, k, fd, num_render_node_devs;
517 +   int j = 0;
518 +
519 +   struct {
520 +      unsigned vendor_id;
521 +      unsigned chip_id;
522 +   } render_node_devs[DRM_RENDER_NODE_MAX_NODES];
523  
524 +   /* Look for render nodes first */
525     for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0;
526          i <= DRM_RENDER_NODE_MAX_MINOR; i++) {
527        struct pipe_loader_device *dev;
528 @@ -225,6 +240,9 @@ pipe_loader_drm_probe(struct pipe_loader
529           continue;
530        }
531  
532 +      render_node_devs[j].vendor_id = dev->u.pci.vendor_id;
533 +      render_node_devs[j].chip_id = dev->u.pci.chip_id;
534 +
535        if (j < ndev) {
536           devs[j] = dev;
537        } else {
538 @@ -234,6 +252,46 @@ pipe_loader_drm_probe(struct pipe_loader
539        j++;
540     }
541  
542 +   num_render_node_devs = j;
543 +
544 +   /* Next look for drm devices. */
545 +   for (i = 0; i < DRM_MAX_MINOR; i++) {
546 +      struct pipe_loader_device *dev;
547 +      boolean duplicate = FALSE;
548 +      fd = open_drm_minor(i);
549 +      if (fd < 0)
550 +         continue;
551 +
552 +      if (!pipe_loader_drm_probe_fd(&dev, fd)) {
553 +         close(fd);
554 +         continue;
555 +      }
556 +
557 +      /* Check to make sure we aren't already accessing this device via
558 +       * render nodes.
559 +       */
560 +      for (k = 0; k < num_render_node_devs; k++) {
561 +         if (dev->u.pci.vendor_id == render_node_devs[k].vendor_id &&
562 +             dev->u.pci.chip_id == render_node_devs[k].chip_id) {
563 +            close(fd);
564 +            dev->ops->release(&dev);
565 +            duplicate = TRUE;
566 +            break;
567 +         }
568 +      }
569 +
570 +      if (duplicate)
571 +         continue;
572 +
573 +      if (j < ndev) {
574 +         devs[j] = dev;
575 +      } else {
576 +         dev->ops->release(&dev);
577 +      }
578 +
579 +      j++;
580 +   }
581 +
582     return j;
583  }
584  
585
586
587 [FILE:357:patches/patch-src_gallium_auxiliary_renderonly_renderonly.c]
588 --- src/gallium/auxiliary/renderonly/renderonly.c.orig  2023-10-04 13:53:02 UTC
589 +++ src/gallium/auxiliary/renderonly/renderonly.c
590 @@ -37,6 +37,10 @@
591  #include "util/u_inlines.h"
592  #include "util/u_memory.h"
593  
594 +#ifndef O_CLOEXEC
595 +#define O_CLOEXEC 0
596 +#endif
597 +
598  void
599  renderonly_scanout_destroy(struct renderonly_scanout *scanout,
600                            struct renderonly *ro)
601
602
603 [FILE:403:patches/patch-src_gallium_drivers_llvmpipe_lp__scene.c]
604 --- src/gallium/drivers/llvmpipe/lp_scene.c.orig        2023-10-04 13:53:02 UTC
605 +++ src/gallium/drivers/llvmpipe/lp_scene.c
606 @@ -25,6 +25,10 @@
607   *
608   **************************************************************************/
609  
610 +#ifdef __NetBSD__
611 +#define _OPENBSD_SOURCE
612 +#include <stdlib.h> /* for reallocarray */
613 +#endif
614  #include "util/u_framebuffer.h"
615  #include "util/u_math.h"
616  #include "util/u_memory.h"
617
618
619 [FILE:360:patches/patch-src_gallium_drivers_vc4_vc4__bufmgr.c]
620 # define ETIME as ETIMEOUT same as in intel driver
621 #
622 --- src/gallium/drivers/vc4/vc4_bufmgr.c.orig   2023-10-04 13:53:02 UTC
623 +++ src/gallium/drivers/vc4/vc4_bufmgr.c
624 @@ -27,6 +27,9 @@
625  #include <fcntl.h>
626  #include <xf86drm.h>
627  #include <xf86drmMode.h>
628 +#ifndef ETIME
629 +#define ETIME ETIMEDOUT
630 +#endif
631  
632  #include "util/u_hash_table.h"
633  #include "util/u_memory.h"
634
635
636 [FILE:271:patches/patch-src_gallium_winsys_amdgpu_drm_amdgpu__cs.c]
637 --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c.orig      2023-10-04 13:53:02 UTC
638 +++ src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
639 @@ -33,6 +33,10 @@
640  
641  #include "amd/common/sid.h"
642  
643 +#ifdef __sun__
644 +#include <alloca.h>
645 +#endif
646 +
647  /* FENCES */
648  
649  static struct pipe_fence_handle *
650
651
652 [FILE:1012:patches/patch-src_intel_common_intel__measure.c]
653 --- src/intel/common/intel_measure.c.orig       2023-10-04 13:53:02 UTC
654 +++ src/intel/common/intel_measure.c
655 @@ -41,6 +41,46 @@
656  #include "util/u_debug.h"
657  #include "util/macros.h"
658  
659 +#ifdef __sun
660 +static int
661 +mkfifoat(int fd, const char *path, mode_t mode)
662 +{
663 +       int     er, curfd = -1, newfd = -1;
664 +
665 +       /* Get our current directory then switch to the given one. */
666 +
667 +       if (fd != AT_FDCWD) {
668 +               if ((curfd = open(".", O_RDONLY, 0)) == -1)
669 +                       return -1;
670 +               if (fchdir(fd) == -1)
671 +                       goto out;
672 +       }
673 +
674 +       if ((newfd = mkfifo(path, mode)) == -1)
675 +               goto out;
676 +
677 +       /* This leaves the fifo if it fails. */
678 +
679 +       if (curfd != -1 && fchdir(curfd) == -1)
680 +               goto out;
681 +       if (curfd != -1)
682 +               close(curfd);
683 +
684 +       return newfd;
685 +out:
686 +       /* Ignore errors in close(2). */
687 +
688 +       er = errno;
689 +       if (curfd != -1)
690 +               fchdir(curfd);
691 +       if (curfd != -1)
692 +               close(curfd);
693 +       if (newfd != -1)
694 +               close(newfd);
695 +       errno = er;
696 +       return -1;
697 +}
698 +#endif
699  
700  static const struct debug_control debug_control[] = {
701     { "draw",            INTEL_MEASURE_DRAW       },
702
703
704 [FILE:1014:patches/patch-src_intel_compiler_brw__eu__validate.c]
705 --- src/intel/compiler/brw_eu_validate.c.orig   2023-10-04 13:53:02 UTC
706 +++ src/intel/compiler/brw_eu_validate.c
707 @@ -41,6 +41,39 @@
708  #include <stdlib.h>
709  #include "brw_eu.h"
710  
711 +#ifdef __sun__
712 +#include <string.h>
713 +
714 +static void *
715 +memmem(const void *l, size_t l_len, const void *s, size_t s_len)
716 +{
717 +       char *cur, *last;
718 +       const char *cl = (const char *)l;
719 +       const char *cs = (const char *)s;
720 +
721 +       /* we need something to compare */
722 +       if (l_len == 0 || s_len == 0)
723 +               return NULL;
724 +
725 +       /* "s" must be smaller or equal to "l" */
726 +       if (l_len < s_len)
727 +               return NULL;
728 +
729 +       /* special case where s_len == 1 */
730 +       if (s_len == 1)
731 +               return memchr(l, (int)*cs, l_len);
732 +
733 +       /* the last position where its possible to find "s" in "l" */
734 +       last = (char *)cl + l_len - s_len;
735 +
736 +       for (cur = (char *)cl; cur <= last; cur++)
737 +               if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
738 +                       return cur;
739 +
740 +       return NULL;
741 +}
742 +#endif
743 +
744  /* We're going to do lots of string concatenation, so this should help. */
745  struct string {
746     char *str;
747
748
749 [FILE:954:patches/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp]
750 --- src/intel/compiler/brw_fs_bank_conflicts.cpp.orig   2023-10-04 13:53:02 UTC
751 +++ src/intel/compiler/brw_fs_bank_conflicts.cpp
752 @@ -309,8 +309,13 @@ namespace {
753           const unsigned align = MAX2(sizeof(void *), __alignof__(vector_type));
754           const unsigned size = DIV_ROUND_UP(n, vector_width) * sizeof(vector_type);
755           void *p;
756 +#ifdef __sun
757 +       p = memalign(align, size);
758 +       if (p == NULL) return NULL;
759 +#else
760           if (posix_memalign(&p, align, size))
761              return NULL;
762 +#endif
763           memset(p, 0, size);
764           return reinterpret_cast<vector_type *>(p);
765        }
766 @@ -737,7 +742,7 @@ namespace {
767                     const weight_vector_type &conflicts)
768     {
769        const unsigned m = DIV_ROUND_UP(conflicts.size, vector_width);
770 -      vector_type s_p = {}, s_n = {};
771 +      vector_type s_p = {0}, s_n = {0};
772  
773        for (unsigned r = 0; r < m; r++) {
774           s_p = adds(s_p, mask(bank_mask_p.v[r], conflicts.v[r]));
775
776
777 [FILE:234:patches/patch-src_intel_isl_isl.h]
778 --- src/intel/isl/isl.h.orig    2023-10-04 13:53:02 UTC
779 +++ src/intel/isl/isl.h
780 @@ -47,6 +47,9 @@
781  #include "util/format/u_format.h"
782  
783  #ifdef __cplusplus
784 +# ifdef __sun__
785 +# define restrict      __restrict__
786 +# endif
787  extern "C" {
788  #endif
789  
790
791
792 [FILE:302:patches/patch-src_intel_tools_aubinator__error__decode.c]
793 # expose getline in FreeBSD's stdio.h
794 #
795 --- src/intel/tools/aubinator_error_decode.c.orig       2023-10-04 13:53:02 UTC
796 +++ src/intel/tools/aubinator_error_decode.c
797 @@ -22,6 +22,9 @@
798   *
799   */
800  
801 +#ifdef __FreeBSD__
802 +#define _WITH_GETLINE
803 +#endif
804  #include <stdbool.h>
805  #include <stdio.h>
806  #include <stdlib.h>
807
808
809 [FILE:238:patches/patch-src_intel_tools_error2aub.c]
810 --- src/intel/tools/error2aub.c.orig    2023-10-04 13:53:02 UTC
811 +++ src/intel/tools/error2aub.c
812 @@ -22,6 +22,9 @@
813   *
814   */
815  
816 +#ifdef __FreeBSD__
817 +#define _WITH_GETLINE
818 +#endif
819  #include <assert.h>
820  #include <getopt.h>
821  #include <inttypes.h>
822
823
824 [FILE:328:patches/patch-src_util_build__id.c]
825 # Elf_ doesn't exist, use Elf32_ or Elf64_
826 #
827 --- src/util/build_id.c.orig    2023-10-04 13:53:02 UTC
828 +++ src/util/build_id.c
829 @@ -35,7 +35,11 @@
830  #endif
831  
832  #ifndef ElfW
833 -#define ElfW(type) Elf_##type
834 +#ifdef __LP64__
835 +#define ElfW(type) Elf64_##type
836 +#else
837 +#define ElfW(type) Elf32_##type
838 +#endif
839  #endif
840  
841  struct build_id_note {
842
843
844 [FILE:235:patches/patch-src_util_libsync.h]
845 --- src/util/libsync.h.orig     2023-10-04 13:53:02 UTC
846 +++ src/util/libsync.h
847 @@ -38,6 +38,10 @@
848  #include <unistd.h>
849  #include <time.h>
850  
851 +#ifdef __sun__
852 +#include <sys/ioccom.h>
853 +#endif
854 +
855  #if defined(__cplusplus)
856  extern "C" {
857  #endif
858
859
860 [FILE:230:patches/patch-src_util_os__file.c]
861 --- src/util/os_file.c.orig     2023-10-04 13:53:02 UTC
862 +++ src/util/os_file.c
863 @@ -28,6 +28,9 @@
864  #endif
865  #endif
866  
867 +#ifndef ENODATA
868 +#define ENODATA ENOATTR
869 +#endif
870  
871  FILE *
872  os_file_create_unique(const char *filename, int filemode)
873
874
875 [FILE:592:patches/patch-src_util_os__memory__aligned.h]
876 --- src/util/os_memory_aligned.h.orig   2023-10-04 13:53:02 UTC
877 +++ src/util/os_memory_aligned.h
878 @@ -53,11 +53,16 @@ add_overflow_size_t(size_t a, size_t b,
879  static inline void *
880  os_malloc_aligned(size_t size, size_t alignment)
881  {
882 +#ifdef __sun__
883 +   alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
884 +   return memalign(alignment, size);
885 +#else
886     void *ptr;
887     alignment = (alignment + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
888     if(posix_memalign(&ptr, alignment, size) != 0)
889        return NULL;
890     return ptr;
891 +#endif
892  }
893  
894  #define os_free_aligned(_ptr) free(_ptr)
895
896
897 [FILE:853:patches/patch-src_util_strndup.h]
898 --- src/util/strndup.h.orig     2023-10-04 13:53:02 UTC
899 +++ src/util/strndup.h
900 @@ -24,7 +24,7 @@
901  #ifndef STRNDUP_H
902  #define STRNDUP_H
903  
904 -#if defined(_WIN32)
905 +#if defined(_WIN32) || defined(__sun)
906  
907  #include <stdlib.h> // size_t
908  #include <string.h>
909 @@ -34,6 +34,7 @@ extern "C" {
910  #endif
911  
912  static inline char *
913 +#if defined(_WIN32)
914  strndup(const char *str, size_t max)
915  {
916     size_t n;
917 @@ -50,6 +51,22 @@ strndup(const char *str, size_t max)
918     memcpy(ptr, str, n);
919     return ptr;
920  }
921 +#else  // version without strnlen
922 +strndup(const char *str, size_t n)
923 +{
924 +    size_t len;
925 +    char *copy;
926 +
927 +    len = strlen(str);
928 +    if (len <= n)
929 +        return (strdup(str));
930 +    if ((copy = (char *)malloc(len + 1)) == NULL)
931 +        return (NULL);
932 +    memcpy(copy, str, len);
933 +    copy[len] = '\0';
934 +    return (copy);
935 +}
936 +#endif
937  
938  #ifdef __cplusplus
939  }
940
941
942 [FILE:430:patches/patch-src_util_u__atomic.h]
943 --- src/util/u_atomic.h.orig    2023-10-04 13:53:02 UTC
944 +++ src/util/u_atomic.h
945 @@ -20,11 +20,7 @@
946   * locally coded assembly, compiler intrinsic or ultimately a
947   * mutex-based implementation.
948   */
949 -#if defined(__sun)
950 -#define PIPE_ATOMIC_OS_SOLARIS
951 -#elif defined(_MSC_VER)
952 -#define PIPE_ATOMIC_MSVC_INTRINSIC
953 -#elif defined(__GNUC__)
954 +#if defined(__GNUC__)
955  #define PIPE_ATOMIC_GCC_INTRINSIC
956  #else
957  #error "Unsupported platform"
958
959
960 [FILE:188:patches/patch-src_util_u__math.h]
961 --- src/util/u_math.h.orig      2023-10-04 13:53:02 UTC
962 +++ src/util/u_math.h
963 @@ -59,6 +59,7 @@
964  extern "C" {
965  #endif
966  
967 +#undef ALIGN
968  
969  #ifndef M_SQRT2
970  #define M_SQRT2 1.41421356237309504880
971
972
973 [FILE:442:patches/patch-src_util_u__thread.h]
974 --- src/util/u_thread.h.orig    2023-10-04 13:53:02 UTC
975 +++ src/util/u_thread.h
976 @@ -50,7 +50,7 @@
977   * but not with __thread
978   */
979  #define __THREAD_INITIAL_EXEC __thread
980 -#elif defined(__GLIBC__)
981 +#elif defined(__GLIBC__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__MidnightBSD__)
982  #define __THREAD_INITIAL_EXEC thread_local __attribute__((tls_model("initial-exec")))
983  #define REALLY_INITIAL_EXEC
984  #else
985
986
987 [FILE:458:files/01-freebsd.conf]
988 <driconf>
989     <device driver="iris">
990         <application name="kwin_x11" executable="kwin_x11">
991             <!-- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251836 -->
992             <option name="glx_extension_override" value="-GLX_EXT_buffer_age" />
993             <!-- https://gitlab.freedesktop.org/mesa/mesa/-/commit/580fbbb59a60 -->
994             <option name="glx_disable_ext_buffer_age" value="true" />
995         </application>
996     </device>
997 </driconf>
998
999
1000 [FILE:25:files/special.mk]
1001 GALLIUM_DRIVERS+=       SWRAST
1002
1003
1004 [FILE:911:sunos/patch-src_gallium_targets_dri_meson.build]
1005 --- src/gallium/targets/dri/meson.build.orig    2020-12-31 03:59:58 UTC
1006 +++ src/gallium/targets/dri/meson.build
1007 @@ -45,11 +45,12 @@ libgallium_dri = shared_library(
1008      inc_gallium_winsys, include_directories('../../frontends/dri'),
1009    ],
1010    gnu_symbol_visibility : 'hidden',
1011 -  link_args : [ld_args_build_id, ld_args_gc_sections, gallium_dri_ld_args],
1012 +  link_args : [ld_args_gc_sections, gallium_dri_ld_args],
1013    link_depends : gallium_dri_link_depends,
1014 +  link_whole : [libdri, libdricommon, libgallium, libr300, _libnir, libglsl, libglcpp], # libr600, libamd_common
1015    link_with : [
1016 -    libdri, libmesa_gallium, libdricommon, libmegadriver_stub, libgalliumvl,
1017 -    libgallium, libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1018 +    libmesa_gallium, libmegadriver_stub, libgalliumvl,
1019 +    libglapi, libpipe_loader_static, libws_null, libwsw, libswdri,
1020      libswkmsdri,
1021    ],
1022    dependencies : [
1023
1024
1025 [FILE:424:sunos/patch-src_gallium_targets_opencl_meson.build]
1026 --- src/gallium/targets/opencl/meson.build.orig 2021-01-29 18:33:19 UTC
1027 +++ src/gallium/targets/opencl/meson.build
1028 @@ -90,7 +90,7 @@ libopencl = shared_library(
1029    [],
1030    link_args : [ld_args_gc_sections, opencl_link_args],
1031    link_depends : opencl_link_deps,
1032 -  link_whole : libclover,
1033 +  link_whole : [libclover,libmesa_format],
1034    link_with : [libpipe_loader_dynamic, libgallium],
1035    dependencies : [
1036      idep_mesautil,
1037
1038
1039 [FILE:604:sunos/patch-src_gallium_targets_osmesa_meson.build]
1040 --- src/gallium/targets/osmesa/meson.build.orig 2020-12-31 03:59:58 UTC
1041 +++ src/gallium/targets/osmesa/meson.build
1042 @@ -49,9 +49,9 @@ libosmesa = shared_library(
1043      inc_gallium_drivers,
1044    ],
1045    link_depends : osmesa_link_deps,
1046 -  link_whole : [libosmesa_st, libglapi_static],
1047 +  link_whole : [libosmesa_st, libglapi_static, libsoftpipe, libgallium, _libnir, libglsl, libglcpp],
1048    link_with : [
1049 -    libmesa_gallium, libgallium, libws_null, osmesa_link_with,
1050 +    libmesa_gallium, libws_null, osmesa_link_with,
1051    ],
1052    dependencies : [
1053      dep_ws2_32, dep_selinux, dep_thread, dep_clock, dep_unwind,
1054
1055
1056 [FILE:2062:sunos/patch-src_gallium_targets_pipe-loader_meson.build]
1057 --- src/gallium/targets/pipe-loader/meson.build.orig    2021-01-29 18:33:19 UTC
1058 +++ src/gallium/targets/pipe-loader/meson.build
1059 @@ -57,16 +57,16 @@ if with_gallium_v3d
1060  endif
1061  
1062  pipe_loaders = [
1063 -  [with_gallium_i915, 'i915', driver_i915, []],
1064 -  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], []],
1065 -  [with_gallium_nouveau, 'nouveau', driver_nouveau, []],
1066 -  [with_gallium_r300, 'r300', driver_r300, []],
1067 -  [with_gallium_r600, 'r600', driver_r600, []],
1068 -  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi, idep_xmlconfig], []],
1069 -  [with_gallium_freedreno, 'msm', driver_freedreno, []],
1070 -  [with_gallium_kmsro, 'kmsro', _kmsro_targets, []],
1071 -  [with_gallium_svga, 'vmwgfx', driver_svga, []],
1072 -  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null]],
1073 +  [with_gallium_i915, 'i915', driver_i915, [], []],
1074 +  [with_gallium_iris, 'iris', [driver_iris, idep_xmlconfig], [], []],
1075 +  [with_gallium_nouveau, 'nouveau', driver_nouveau, [], []],
1076 +  [with_gallium_r300, 'r300', driver_r300, [], [libr300,libradeonwinsys,libmesa_format]],
1077 +  [with_gallium_r600, 'r600', driver_r600, [], [libr600,libradeonwinsys,libmesa_format,libgalliumvl]],
1078 +  [with_gallium_radeonsi, 'radeonsi', [driver_radeonsi], [], [libradeonsi,libradeonwinsys,libamd_common,libamd_common_llvm,libmesa_format,_libxmlconfig,libgalliumvl]],
1079 +  [with_gallium_freedreno, 'msm', driver_freedreno, [], []],
1080 +  [with_gallium_kmsro, 'kmsro', _kmsro_targets, [], []],
1081 +  [with_gallium_svga, 'vmwgfx', driver_svga, [], [libsvga,libsvgadrm,libmesa_format]],
1082 +  [with_gallium_softpipe, 'swrast', [driver_swrast, driver_swr], [libwsw, libws_null], [libllvmpipe,libmesa_format,libsoftpipe]],
1083  ]
1084  
1085  foreach x : pipe_loaders
1086 @@ -80,6 +80,7 @@ foreach x : pipe_loaders
1087        link_args : pipe_loader_link_args,
1088        link_depends : pipe_loader_link_deps,
1089        include_directories : pipe_loader_incs,
1090 +      link_whole : [x[4]],
1091        link_with : [pipe_loader_link_with, x[3]],
1092        dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
1093        name_prefix : '',
1094
1095
1096 [FILE:838:sunos/patch-src_gallium_targets_va_meson.build]
1097 --- src/gallium/targets/va/meson.build.orig     2021-01-29 18:33:19 UTC
1098 +++ src/gallium/targets/va/meson.build
1099 @@ -39,13 +39,14 @@ libva_gallium = shared_library(
1100    include_directories : [
1101      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1102    ],
1103 -  link_whole : [libva_st],
1104 +  link_whole : [libva_st, _libxmlconfig, libmesa_format, libloader, libpipe_loader_static],
1105    link_with : [
1106      libgalliumvlwinsys, libgalliumvl, libgallium,
1107 -    libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1108 +    libws_null, libwsw, libswdri, libswkmsdri,
1109 +    libr600, libradeonsi,
1110    ],
1111    dependencies : [
1112 -    dep_libdrm, driver_r600, driver_radeonsi, driver_nouveau,
1113 +    dep_libdrm, driver_nouveau,
1114      idep_mesautil,
1115    ],
1116    link_depends : va_link_depends,
1117
1118
1119 [FILE:784:sunos/patch-src_gallium_targets_vdpau_meson.build]
1120 --- src/gallium/targets/vdpau/meson.build.orig  2020-12-31 03:59:58 UTC
1121 +++ src/gallium/targets/vdpau/meson.build
1122 @@ -44,10 +44,10 @@ libvdpau_gallium = shared_library(
1123    include_directories : [
1124      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1125    ],
1126 -  link_whole : [libvdpau_st],
1127 +  link_whole : [libvdpau_st, libr300, libradeonwinsys, libmesa_format, _libxmlconfig, libpipe_loader_static, libgallium, _libnir], # libr600, libradeonsi, libamd_common, libamd_common_llvm,
1128    link_with : [
1129      libgalliumvlwinsys, libgalliumvl, libgallium,
1130 -    libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1131 +    libws_null, libwsw, libswdri, libswkmsdri,
1132    ],
1133    dependencies : [
1134      idep_mesautil,
1135
1136
1137 [FILE:670:sunos/patch-src_gallium_targets_xa_meson.build]
1138 --- src/gallium/targets/xa/meson.build.orig     2020-12-31 03:59:58 UTC
1139 +++ src/gallium/targets/xa/meson.build
1140 @@ -40,9 +40,9 @@ libxatracker = shared_library(
1141    include_directories : [
1142      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1143    ],
1144 -  link_whole : [libxa_st],
1145 +  link_whole : [libxa_st, libsvga, libsvgadrm, libpipe_loader_static, libmesa_format, _libxmlconfig, libgallium, _libnir],
1146    link_with : [
1147 -    libgalliumvl_stub, libgallium, libpipe_loader_static,
1148 +    libgalliumvl_stub, libgallium,
1149      libws_null, libwsw, libswdri, libswkmsdri,
1150    ],
1151    link_depends : xa_link_depends,
1152
1153
1154 [FILE:846:sunos/patch-src_gallium_targets_xvmc_meson.build]
1155 --- src/gallium/targets/xvmc/meson.build.orig   2021-01-29 18:33:19 UTC
1156 +++ src/gallium/targets/xvmc/meson.build
1157 @@ -39,12 +39,12 @@ libxvmc_gallium = shared_library(
1158    include_directories : [
1159      inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_winsys, inc_gallium_drivers,
1160    ],
1161 -  link_whole : [libxvmc_st],
1162 +  link_whole : [libxvmc_st,libradeonwinsys,libr600,_libxmlconfig,libmesa_format,libpipe_loader_static],
1163    link_with : [
1164      libgalliumvlwinsys, libgalliumvl, libgallium,
1165      libpipe_loader_static, libws_null, libwsw, libswdri, libswkmsdri,
1166    ],
1167 -  dependencies : [idep_mesautil, driver_r600, driver_nouveau],
1168 +  dependencies : [idep_mesautil, driver_nouveau],
1169    link_depends : xvmc_link_depends,
1170    # Will be deleted during installation, see install_megadrivers.py
1171    install : true,
1172
1173
1174 [FILE:510:sunos/patch-src_gbm_meson.build]
1175 --- src/gbm/meson.build.orig    2021-01-29 18:33:19 UTC
1176 +++ src/gbm/meson.build
1177 @@ -49,8 +49,8 @@ libgbm = shared_library(
1178    include_directories : incs_gbm,
1179    c_args : [args_gbm],
1180    link_args : [ld_args_gc_sections],
1181 -  link_with : libloader,
1182 -  dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil, idep_xmlconfig],
1183 +  link_with : [libloader, _libxmlconfig],
1184 +  dependencies : [deps_gbm, dep_dl, dep_thread, idep_mesautil],
1185    gnu_symbol_visibility : 'hidden',
1186    version : '1.0.0',
1187    install : true,
1188
1189
1190 [FILE:997:sunos/patch-src_mesa_drivers_dri_meson.build]
1191 --- src/mesa/drivers/dri/meson.build.orig       2020-12-31 03:59:58 UTC
1192 +++ src/mesa/drivers/dri/meson.build
1193 @@ -20,7 +20,7 @@
1194  
1195  subdir('common')
1196  
1197 -_dri_drivers = []
1198 +_dri_drivers = [ _libnir, libmesa_classic, libmesa_common, libintel_compiler, libglcpp, libdricommon ]
1199  _dri_link = []
1200  if with_dri_swrast
1201    subdir('swrast')
1202 @@ -59,14 +59,13 @@ if _dri_drivers != []
1203      [],
1204      link_whole : _dri_drivers,
1205      link_with : [
1206 -      libmegadriver_stub, libdricommon, libglapi,
1207 -      libmesa_classic,
1208 +      libmegadriver_stub, libglapi, libintel_dev,
1209      ],
1210      dependencies : [
1211        dep_selinux, dep_libdrm, dep_m, dep_thread, dep_dl,
1212 -      idep_nir, idep_xmlconfig, idep_mesautil,
1213 +      idep_xmlconfig, idep_mesautil,
1214      ],
1215 -    link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections],
1216 +    link_args : [ld_args_build_id, ld_args_gc_sections],
1217      # Will be deleted during installation, see install_megadrivers.py
1218      install : true,
1219      install_dir : dri_drivers_path,
1220