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/"
19 source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig}
21 sha512sums=('1aa72cd5b61635d489904944e5d80b1d923a38ffbd295341e6b30c492e469463bc4d0b63f74b071580572aec3a2cdfe19b3f2919ebc0fb4bcc35e114db925abc'
23 'f9f0d0ccf166fe6cb684478b6f1e1ab1f2850431c06aa041738563eb1808a004e52cdec823c103c9e180f03ffc083e95974d291353f0220fe52ae6d4897fecc7')
24 validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D' # Emil Velikov <emil.l.velikov@gmail.com>
25 '946D09B5E4C9845E63075FF1D961C596A7203456' # Andres Gomez <tanty@igalia.com>
26 'E3E8F480C52ADD73B278EE78E1ECBE07D7D70895' # Juan Antonio Suárez Romero (Igalia, S.L.) <jasuarez@igalia.com>
27 'A5CC9FEC93F2F837CB044912336909B6B25FADFA' # Juan A. Suarez Romero <jasuarez@igalia.com>
28 '71C4B75620BC75708B4BDB254C95FAAB3EB073EC' # Dylan Baker <dylan@pnwbakers.com>
29 '57551DE15B968F6341C248F68D8E31AFC32428A6') # Eric Engestrom <eric@engestrom.ch>
37 # Build only minimal debug info to reduce size
41 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/6229
42 CFLAGS+=' -mtls-dialect=gnu'
43 CXXFLAGS+=' -mtls-dialect=gnu'
45 arch-meson mesa-$pkgver build \
47 -D platforms=x11,wayland \
48 -D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,crocus,zink,d3d12 \
49 -D vulkan-drivers=amd,intel,swrast \
50 -D vulkan-layers=device-select,intel-nullhw,overlay \
53 -D gallium-extra-hud=true \
54 -D gallium-nine=true \
55 -D gallium-omx=bellagio \
56 -D gallium-opencl=icd \
57 -D gallium-va=enabled \
58 -D gallium-vdpau=enabled \
59 -D gallium-xa=enabled \
60 -D gallium-xvmc=disabled \
66 -D libunwind=enabled \
68 -D lmsensors=enabled \
70 -D shared-glapi=enabled \
71 -D microsoft-clc=disabled \
78 meson compile -C build
80 # fake installation to be seperated into packages
81 # outside of fakeroot but mesa doesn't need to chown/mod
82 DESTDIR="${srcdir}/fakeinstall" meson install -C build
88 f="${src#fakeinstall/}"
89 dir="${pkgdir}/${f%/*}"
90 install -m755 -d "${dir}"
91 mv -v "${src}" "${dir}/"
95 package_vulkan-mesa-layers() {
96 pkgdesc="Mesa's Vulkan layers"
97 depends=('libdrm' 'libxcb' 'wayland' 'python')
98 conflicts=('vulkan-mesa-layer')
99 replaces=('vulkan-mesa-layer')
101 _install fakeinstall/usr/share/vulkan/explicit_layer.d
102 _install fakeinstall/usr/share/vulkan/implicit_layer.d
103 _install fakeinstall/usr/lib/libVkLayer_*.so
104 _install fakeinstall/usr/bin/mesa-overlay-control.py
106 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
109 package_opencl-mesa() {
110 pkgdesc="OpenCL support for AMD/ATI Radeon mesa drivers"
111 depends=('libdrm' 'libclc' 'clang' 'expat')
112 optdepends=('opencl-headers: headers necessary for OpenCL development')
113 provides=('opencl-driver')
115 _install fakeinstall/etc/OpenCL
116 _install fakeinstall/usr/lib/lib*OpenCL*
117 _install fakeinstall/usr/lib/gallium-pipe
119 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
122 package_vulkan-intel() {
123 pkgdesc="Intel's Vulkan mesa driver"
124 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'systemd-libs')
125 optdepends=('vulkan-mesa-layers: additional vulkan layers')
126 provides=('vulkan-driver')
128 _install fakeinstall/usr/share/vulkan/icd.d/intel_icd*.json
129 _install fakeinstall/usr/lib/libvulkan_intel.so
131 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
134 package_vulkan-radeon() {
135 pkgdesc="Radeon's Vulkan mesa driver"
136 depends=('wayland' 'libx11' 'libxshmfence' 'libelf' 'libdrm' 'llvm-libs' 'systemd-libs')
137 optdepends=('vulkan-mesa-layers: additional vulkan layers')
138 provides=('vulkan-driver')
140 _install fakeinstall/usr/share/drirc.d/00-radv-defaults.conf
141 _install fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json
142 _install fakeinstall/usr/lib/libvulkan_radeon.so
144 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
147 package_vulkan-swrast() {
148 pkgdesc="Vulkan software rasteriser driver"
149 depends=('wayland' 'libx11' 'libxshmfence' 'libdrm' 'zstd' 'llvm-libs' 'systemd-libs' 'libunwind')
150 optdepends=('vulkan-mesa-layers: additional vulkan layers')
151 conflicts=('vulkan-mesa')
152 replaces=('vulkan-mesa')
153 provides=('vulkan-driver')
155 _install fakeinstall/usr/share/vulkan/icd.d/lvp_icd*.json
156 _install fakeinstall/usr/lib/libvulkan_lvp.so
158 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
161 package_libva-mesa-driver() {
162 pkgdesc="VA-API implementation for gallium"
163 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
164 depends+=('libexpat.so')
166 _install fakeinstall/usr/lib/dri/*_drv_video.so
168 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
171 package_mesa-vdpau() {
172 pkgdesc="Mesa VDPAU drivers"
173 depends=('libdrm' 'libx11' 'llvm-libs' 'expat' 'libelf' 'libxshmfence')
174 depends+=('libexpat.so')
176 _install fakeinstall/usr/lib/vdpau
178 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
182 depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf'
183 'libomxil-bellagio' 'libunwind' 'llvm-libs' 'lm_sensors' 'libglvnd'
184 'zstd' 'vulkan-icd-loader')
185 depends+=('libsensors.so' 'libexpat.so' 'libvulkan.so')
186 optdepends=('opengl-man-pages: for the OpenGL API man pages'
187 'mesa-vdpau: for accelerated video playback'
188 'libva-mesa-driver: for accelerated video playback')
189 provides=('mesa-libgl' 'opengl-driver')
190 conflicts=('mesa-libgl')
191 replaces=('mesa-libgl')
193 _install fakeinstall/usr/share/drirc.d/00-mesa-defaults.conf
194 _install fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json
196 # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast, swr
197 _install fakeinstall/usr/lib/dri/*_dri.so
199 _install fakeinstall/usr/lib/bellagio
200 _install fakeinstall/usr/lib/d3d
201 _install fakeinstall/usr/lib/lib{gbm,glapi}.so*
202 _install fakeinstall/usr/lib/libOSMesa.so*
203 _install fakeinstall/usr/lib/libxatracker.so*
205 _install fakeinstall/usr/include
206 _install fakeinstall/usr/lib/pkgconfig
209 _install fakeinstall/usr/lib/libGLX_mesa.so*
210 _install fakeinstall/usr/lib/libEGL_mesa.so*
213 ln -s /usr/lib/libGLX_mesa.so.0 "${pkgdir}/usr/lib/libGLX_indirect.so.0"
215 # make sure there are no files left to install
216 find fakeinstall -depth -print0 | xargs -0 rmdir
218 install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE