1 # Maintainer: Laurent Carlier <lordheavym@gmail.com>
2 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Jan de Groot <jgc@archlinux.org>
4 # Contributor: Andreas Radke <andyrtr@archlinux.org>
7 pkgname=('vulkan-mesa-layers' 'opencl-mesa' 'vulkan-intel' 'vulkan-radeon' 'vulkan-swrast' 'vulkan-virtio' 'libva-mesa-driver' 'mesa-vdpau' 'mesa')
8 pkgdesc="An open-source implementation of the OpenGL specification"
12 makedepends=('python-mako' 'libxml2' 'libx11' 'xorgproto' 'libdrm' 'libxshmfence' 'libxxf86vm'
13 'libxdamage' 'libvdpau' 'libva' 'wayland' 'wayland-protocols' 'zstd' 'elfutils' 'llvm'
14 'libomxil-bellagio' 'libclc' 'clang' 'libglvnd' 'libunwind' 'lm_sensors' 'libxrandr'
15 'systemd' 'valgrind' 'glslang' 'vulkan-icd-loader' 'directx-headers' 'cmake' 'meson')
16 makedepends+=('python-ply' 'spirv-llvm-translator') # intel-clc dependencies
17 makedepends+=('rust' 'rust-bindgen' 'spirv-tools') # rusticl dependencies
18 url="https://www.mesa3d.org/"
20 source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig}
21 0001-intel-fs-fix-scheduling-of-HALT-instructions.patch
22 0002-egl-wayland-Fix-destruction-of-event-queue-with-prox.patch
23 0003-vulkan-wsi-wayland-Fix-destruction-of-event-queue-wi.patch
24 0004-rusticl-Fix-bindgen-invocation.patch
26 sha256sums=('386362a5d80df3b096636b67f340e1ce67b705b44767d5bdd11d2ed1037192d5'
28 'dc6790b5be0e80c23e74ae18ca1a2b40f57f4211cc7b645bf22b63af3b790e40'
29 'c25493de3e5930702acf833d182aeca0895d6a9d9e830dca15c42d130e25c41c'
30 'db2be7ae0540d65e77449eda1af66200e27af382183fdcd0c87f99db3520b80a'
31 'b3aaccd6ce5c6d417801baafa056d4dfb2a13bf9b480fb980e9af6d0d071cedb'
32 '7052ba73bb07ea78873a2431ee4e828f4e72bda7d176d07f770fa48373dec537')
33 b2sums=('e716d9ddce3da649239c1bc37ec208b9669f316f6b547ca0c69937043f371f0d59ead34fec427297171916045061ddb8783d126f6dec5ece90a0719003fe2c40'
35 '37d1d070c45c85bce8abe3524a3f8d9ac9ed6326a3eec653cd89fffce3630b08eb9b96b11aeb495488230449c99f9b508f73a15e53265d2b159286b0e2dda7cc'
36 'ae891637318fdbb8dd58285098af7bea709fb032969a5671eb225a4a471bf9422fac2a6cb0fd188aad96ea5a03eb043f646f5d371dd655a100046adb1c91bd7d'
37 'a7312e0931904e659b3d33fcb37b13bcadab943c6040dd2b58ea191db350b50c1ba588e334b7e59b513bd6155797e29dc1bd1a6a35a278b3824d06534f2c9d17'
38 '58c374ae45f84996a7bf248d0f2dd97fb003f30b2ecda5654561679b90c53830efdff10f990295390cdf8d9d676deeb756b3037c070966a6441670bf8dcb2223'
39 '1ecf007b82260710a7bf5048f47dd5d600c168824c02c595af654632326536a6527fbe0738670ee7b921dd85a70425108e0f471ba85a8e1ca47d294ad74b4adb')
40 validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov <emil.l.velikov@gmail.com>
41 '946D09B5E4C9845E63075FF1D961C596A7203456' # Andres Gomez <tanty@igalia.com>
42 'E3E8F480C52ADD73B278EE78E1ECBE07D7D70895' # Juan Antonio Suárez Romero (Igalia, S.L.) <jasuarez@igalia.com>
43 'A5CC9FEC93F2F837CB044912336909B6B25FADFA' # Juan A. Suarez Romero <jasuarez@igalia.com>
44 '71C4B75620BC75708B4BDB254C95FAAB3EB073EC' # Dylan Baker <dylan@pnwbakers.com>
45 '57551DE15B968F6341C248F68D8E31AFC32428A6') # Eric Engestrom <eric@engestrom.ch>
50 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/7110
51 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20765
52 patch -Np1 -i ../0001-intel-fs-fix-scheduling-of-HALT-instructions.patch
54 # https://bugs.archlinux.org/task/78137
55 # https://bugzilla.mozilla.org/show_bug.cgi?id=1826583
56 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646
57 patch -Np1 -i ../0002-egl-wayland-Fix-destruction-of-event-queue-with-prox.patch
59 # https://bugs.archlinux.org/task/78142
60 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21647
61 patch -Np1 -i ../0003-vulkan-wsi-wayland-Fix-destruction-of-event-queue-wi.patch
63 # Fix build failure with rust-bindgen 0.65.1
64 patch -Np1 -i ../0004-rusticl-Fix-bindgen-invocation.patch
68 # Build only minimal debug info to reduce size
72 arch-meson mesa-$pkgver build \
74 -D platforms=x11,wayland \
75 -D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,i915,iris,crocus,zink,d3d12 \
76 -D vulkan-drivers=amd,intel,intel_hasvk,swrast,virtio-experimental \
77 -D vulkan-layers=device-select,intel-nullhw,overlay \
80 -D gallium-extra-hud=true \
81 -D gallium-nine=true \
82 -D gallium-omx=bellagio \
83 -D gallium-opencl=icd \
84 -D gallium-va=enabled \
85 -D gallium-vdpau=enabled \
86 -D gallium-xa=enabled \
87 -D gallium-rusticl=true \
94 -D libunwind=enabled \
96 -D lmsensors=enabled \
98 -D shared-glapi=enabled \
99 -D intel-clc=enabled \
100 -D microsoft-clc=disabled \
101 -D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
105 meson configure build
108 meson compile -C build
110 # fake installation to be seperated into packages
111 # outside of fakeroot but mesa doesn't need to chown/mod
112 DESTDIR="${srcdir}/fakeinstall" meson install -C build
118 f="${src#fakeinstall/}"
119 dir="${pkgdir}/${f%/*}"
120 install -m755 -d "${dir}"
121 mv -v "${src}" "${dir}/"
125 package_vulkan-mesa-layers() {
126 pkgdesc="Mesa's Vulkan layers"
127 depends=('libdrm' 'libxcb' 'wayland' 'python')
128 conflicts=('vulkan-mesa-layer')
129 replaces=('vulkan-mesa-layer')
131 _install fakeinstall/usr/share/vulkan/explicit_layer.d
132 _install fakeinstall/usr/share/vulkan/implicit_layer.d
133 _install fakeinstall/usr/lib/libVkLayer_*.so
134 _install fakeinstall/usr/bin/mesa-overlay-control.py
136 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
139 package_opencl-mesa() {
140 pkgdesc="OpenCL support with clover and rusticl for mesa drivers"
141 depends=('libdrm' 'libclc' 'clang' 'expat' 'spirv-llvm-translator')
142 optdepends=('opencl-headers: headers necessary for OpenCL development')
143 provides=('opencl-driver')
145 _install fakeinstall/etc/OpenCL
146 _install fakeinstall/usr/lib/lib*OpenCL*
147 _install fakeinstall/usr/lib/gallium-pipe
149 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
152 package_vulkan-intel() {
153 pkgdesc="Intel's Vulkan mesa driver"
154 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'systemd-libs')
155 optdepends=('vulkan-mesa-layers: additional vulkan layers')
156 provides=('vulkan-driver')
158 _install fakeinstall/usr/share/vulkan/icd.d/intel_*.json
159 _install fakeinstall/usr/lib/libvulkan_intel*.so
161 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
164 package_vulkan-radeon() {
165 pkgdesc="Radeon's Vulkan mesa driver"
166 depends=('wayland' 'libx11' 'libxshmfence' 'libelf' 'libdrm' 'llvm-libs' 'systemd-libs')
167 optdepends=('vulkan-mesa-layers: additional vulkan layers')
168 provides=('vulkan-driver')
170 _install fakeinstall/usr/share/drirc.d/00-radv-defaults.conf
171 _install fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json
172 _install fakeinstall/usr/lib/libvulkan_radeon.so
174 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
177 package_vulkan-swrast() {
178 pkgdesc="Vulkan software rasteriser driver"
179 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'llvm-libs' 'systemd-libs' 'libunwind')
180 optdepends=('vulkan-mesa-layers: additional vulkan layers')
181 conflicts=('vulkan-mesa')
182 replaces=('vulkan-mesa')
183 provides=('vulkan-driver')
185 _install fakeinstall/usr/share/vulkan/icd.d/lvp_icd*.json
186 _install fakeinstall/usr/lib/libvulkan_lvp.so
188 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
191 package_vulkan-virtio() {
192 pkgdesc="Venus Vulkan mesa driver for Virtual Machines"
193 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'systemd-libs')
194 optdepends=('vulkan-mesa-layers: additional vulkan layers')
195 provides=('vulkan-driver')
197 _install fakeinstall/usr/share/vulkan/icd.d/virtio_icd*.json
198 _install fakeinstall/usr/lib/libvulkan_virtio.so
200 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
203 package_libva-mesa-driver() {
204 pkgdesc="VA-API drivers"
205 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
206 depends+=('libexpat.so')
207 provides=('libva-driver')
209 _install fakeinstall/usr/lib/dri/*_drv_video.so
211 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
214 package_mesa-vdpau() {
215 pkgdesc="VDPAU drivers"
216 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
217 depends+=('libexpat.so')
218 provides=('vdpau-driver')
220 _install fakeinstall/usr/lib/vdpau
222 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
226 depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf'
227 'libomxil-bellagio' 'libunwind' 'llvm-libs' 'lm_sensors' 'libglvnd'
228 'zstd' 'vulkan-icd-loader')
229 depends+=('libsensors.so' 'libexpat.so')
230 optdepends=('opengl-man-pages: for the OpenGL API man pages'
231 'mesa-vdpau: for accelerated video playback'
232 'libva-mesa-driver: for accelerated video playback')
233 provides=('mesa-libgl' 'opengl-driver')
234 conflicts=('mesa-libgl')
235 replaces=('mesa-libgl')
237 _install fakeinstall/usr/share/drirc.d/00-mesa-defaults.conf
238 _install fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json
240 # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast, swr
241 _install fakeinstall/usr/lib/dri/*_dri.so
243 _install fakeinstall/usr/lib/bellagio
244 _install fakeinstall/usr/lib/d3d
245 _install fakeinstall/usr/lib/lib{gbm,glapi}.so*
246 _install fakeinstall/usr/lib/libOSMesa.so*
247 _install fakeinstall/usr/lib/libxatracker.so*
249 _install fakeinstall/usr/include
250 _install fakeinstall/usr/lib/pkgconfig
253 _install fakeinstall/usr/lib/libGLX_mesa.so*
254 _install fakeinstall/usr/lib/libEGL_mesa.so*
257 ln -s /usr/lib/libGLX_mesa.so.0 "${pkgdir}/usr/lib/libGLX_indirect.so.0"
259 # make sure there are no files left to install
260 find fakeinstall -depth -print0 | xargs -0 rmdir
262 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE