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' '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 url="https://www.mesa3d.org/"
18 options=('debug' '!lto')
19 source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig}
20 0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch
21 0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch
23 sha512sums=('fa4aa916e57137c758052ee5190d291e6d637f9ec809de54b64bddf5d2fdeafeb3389cd60d44203502e3d93b2563c84182b77a0d4d180bc438fc8064864426c6'
25 '9bf47019a7c1da6724393cf571c6e1ce6b56ca24fe32045bc056d2e1bb2584f6a81e886dd8b2f1b1aabb953367dd068f9833f520fa41a9b2bbce20fdc15d07b4'
26 '3df104f4abbecb12fcf9631cabdc7fe883b6c529abebaf36a0d47933ebd0c57235f11767060604dec71acefdf55f2f025eb997b1dd1cf0b92c02af0a604cae98'
27 'f9f0d0ccf166fe6cb684478b6f1e1ab1f2850431c06aa041738563eb1808a004e52cdec823c103c9e180f03ffc083e95974d291353f0220fe52ae6d4897fecc7')
28 validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov <emil.l.velikov@gmail.com>
29 '946D09B5E4C9845E63075FF1D961C596A7203456' # Andres Gomez <tanty@igalia.com>
30 'E3E8F480C52ADD73B278EE78E1ECBE07D7D70895' # Juan Antonio Suárez Romero (Igalia, S.L.) <jasuarez@igalia.com>
31 'A5CC9FEC93F2F837CB044912336909B6B25FADFA' # Juan A. Suarez Romero <jasuarez@igalia.com>
32 '71C4B75620BC75708B4BDB254C95FAAB3EB073EC' # Dylan Baker <dylan@pnwbakers.com>
33 '57551DE15B968F6341C248F68D8E31AFC32428A6') # Eric Engestrom <eric@engestrom.ch>
38 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/7111
39 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17247
40 # https://github.com/HansKristian-Work/vkd3d-proton/issues/1200
41 patch -Np1 -i ../0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch
42 patch -Np1 -i ../0002-intel-fs-always-mask-the-bottom-bits-of-the-sampler-.patch
46 # Build only minimal debug info to reduce size
50 arch-meson mesa-$pkgver build \
53 -D platforms=x11,wayland \
54 -D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,crocus,zink,d3d12 \
55 -D vulkan-drivers=amd,intel,swrast \
56 -D vulkan-layers=device-select,intel-nullhw,overlay \
59 -D gallium-extra-hud=true \
60 -D gallium-nine=true \
61 -D gallium-omx=bellagio \
62 -D gallium-opencl=icd \
63 -D gallium-va=enabled \
64 -D gallium-vdpau=enabled \
65 -D gallium-xa=enabled \
66 -D gallium-xvmc=disabled \
72 -D libunwind=enabled \
74 -D lmsensors=enabled \
76 -D shared-glapi=enabled \
77 -D microsoft-clc=disabled \
78 -D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
85 meson compile -C build
87 # fake installation to be seperated into packages
88 # outside of fakeroot but mesa doesn't need to chown/mod
89 DESTDIR="${srcdir}/fakeinstall" meson install -C build
95 f="${src#fakeinstall/}"
96 dir="${pkgdir}/${f%/*}"
97 install -m755 -d "${dir}"
98 mv -v "${src}" "${dir}/"
102 package_vulkan-mesa-layers() {
103 pkgdesc="Mesa's Vulkan layers"
104 depends=('libdrm' 'libxcb' 'wayland' 'python')
105 conflicts=('vulkan-mesa-layer')
106 replaces=('vulkan-mesa-layer')
108 _install fakeinstall/usr/share/vulkan/explicit_layer.d
109 _install fakeinstall/usr/share/vulkan/implicit_layer.d
110 _install fakeinstall/usr/lib/libVkLayer_*.so
111 _install fakeinstall/usr/bin/mesa-overlay-control.py
113 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
116 package_opencl-mesa() {
117 pkgdesc="OpenCL support for AMD/ATI Radeon mesa drivers"
118 depends=('libdrm' 'libclc' 'clang' 'expat')
119 optdepends=('opencl-headers: headers necessary for OpenCL development')
120 provides=('opencl-driver')
122 _install fakeinstall/etc/OpenCL
123 _install fakeinstall/usr/lib/lib*OpenCL*
124 _install fakeinstall/usr/lib/gallium-pipe
126 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
129 package_vulkan-intel() {
130 pkgdesc="Intel's Vulkan mesa driver"
131 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'systemd-libs')
132 optdepends=('vulkan-mesa-layers: additional vulkan layers')
133 provides=('vulkan-driver')
135 _install fakeinstall/usr/share/vulkan/icd.d/intel_icd*.json
136 _install fakeinstall/usr/lib/libvulkan_intel.so
138 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
141 package_vulkan-radeon() {
142 pkgdesc="Radeon's Vulkan mesa driver"
143 depends=('wayland' 'libx11' 'libxshmfence' 'libelf' 'libdrm' 'llvm-libs' 'systemd-libs')
144 optdepends=('vulkan-mesa-layers: additional vulkan layers')
145 provides=('vulkan-driver')
147 _install fakeinstall/usr/share/drirc.d/00-radv-defaults.conf
148 _install fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json
149 _install fakeinstall/usr/lib/libvulkan_radeon.so
151 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
154 package_vulkan-swrast() {
155 pkgdesc="Vulkan software rasteriser driver"
156 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'llvm-libs' 'systemd-libs' 'libunwind')
157 optdepends=('vulkan-mesa-layers: additional vulkan layers')
158 conflicts=('vulkan-mesa')
159 replaces=('vulkan-mesa')
160 provides=('vulkan-driver')
162 _install fakeinstall/usr/share/vulkan/icd.d/lvp_icd*.json
163 _install fakeinstall/usr/lib/libvulkan_lvp.so
165 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
168 package_libva-mesa-driver() {
169 pkgdesc="VA-API implementation for gallium"
170 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
171 depends+=('libexpat.so')
173 _install fakeinstall/usr/lib/dri/*_drv_video.so
175 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
178 package_mesa-vdpau() {
179 pkgdesc="Mesa VDPAU drivers"
180 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
181 depends+=('libexpat.so')
183 _install fakeinstall/usr/lib/vdpau
185 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
189 depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf'
190 'libomxil-bellagio' 'libunwind' 'llvm-libs' 'lm_sensors' 'libglvnd'
191 'zstd' 'vulkan-icd-loader')
192 depends+=('libsensors.so' 'libexpat.so' 'libvulkan.so')
193 optdepends=('opengl-man-pages: for the OpenGL API man pages'
194 'mesa-vdpau: for accelerated video playback'
195 'libva-mesa-driver: for accelerated video playback')
196 provides=('mesa-libgl' 'opengl-driver')
197 conflicts=('mesa-libgl')
198 replaces=('mesa-libgl')
200 _install fakeinstall/usr/share/drirc.d/00-mesa-defaults.conf
201 _install fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json
203 # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast, swr
204 _install fakeinstall/usr/lib/dri/*_dri.so
206 _install fakeinstall/usr/lib/bellagio
207 _install fakeinstall/usr/lib/d3d
208 _install fakeinstall/usr/lib/lib{gbm,glapi}.so*
209 _install fakeinstall/usr/lib/libOSMesa.so*
210 _install fakeinstall/usr/lib/libxatracker.so*
212 _install fakeinstall/usr/include
213 _install fakeinstall/usr/lib/pkgconfig
216 _install fakeinstall/usr/lib/libGLX_mesa.so*
217 _install fakeinstall/usr/lib/libEGL_mesa.so*
220 ln -s /usr/lib/libGLX_mesa.so.0 "${pkgdir}/usr/lib/libGLX_indirect.so.0"
222 # make sure there are no files left to install
223 find fakeinstall -depth -print0 | xargs -0 rmdir
225 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE