archrelease: copy trunk to extra-x86_64
[arch-packages.git] / mesa / trunk / PKGBUILD
blobdc13832bb279308c337c78ef4bb5ba5379504068
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>
6 pkgbase=mesa
7 pkgname=(
8   'vulkan-mesa-layers'
9   'opencl-mesa'
10   'vulkan-intel'
11   'vulkan-radeon'
12   'vulkan-swrast'
13   'vulkan-virtio'
14   'libva-mesa-driver'
15   'mesa-vdpau'
16   'mesa'
18 pkgver=23.1.0
19 pkgrel=1
20 pkgdesc="An open-source implementation of the OpenGL specification"
21 url="https://www.mesa3d.org/"
22 arch=('x86_64')
23 license=('custom')
24 makedepends=(
25   'clang'
26   'expat'
27   'libdrm'
28   'libelf'
29   'libglvnd'
30   'libunwind'
31   'libva'
32   'libvdpau'
33   'libx11'
34   'libxdamage'
35   'libxml2'
36   'libxrandr'
37   'libxshmfence'
38   'libxxf86vm'
39   'llvm'
40   'lm_sensors'
41   'systemd'
42   'vulkan-icd-loader'
43   'wayland'
44   'zstd'
46   # shared with lib32-mesa
47   'clang'
48   'cmake'
49   'elfutils'
50   'glslang'
51   'libclc'
52   'meson'
53   'python-mako'
54   'wayland-protocols'
55   'xorgproto'
57   # valgrind deps
58   'valgrind'
60   # d3d12 deps
61   'directx-headers'
63   # gallium-omx deps
64   'libomxil-bellagio'
66   # gallium-rusticl deps
67   'rust'
68   'rust-bindgen'
69   'spirv-tools'
71   # intel-clc deps
72   'python-ply'
73   'spirv-llvm-translator'
75 source=(
76   https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz{,.sig}
77   LICENSE
79 sha256sums=('a9dde3c76571c4806245a05bda1cceee347c3267127e9e549e4f4e225d92e992'
80             'SKIP'
81             '7052ba73bb07ea78873a2431ee4e828f4e72bda7d176d07f770fa48373dec537')
82 b2sums=('47cc90da14a2c33bb54c7811e99b439fadef81a15b63e535210a329bad5e2524fcb415cc5ed51a8deb65ccc9a341af78f02178c93758f09946978179e494382c'
83         'SKIP'
84         '1ecf007b82260710a7bf5048f47dd5d600c168824c02c595af654632326536a6527fbe0738670ee7b921dd85a70425108e0f471ba85a8e1ca47d294ad74b4adb')
85 validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D'  # Emil Velikov <emil.l.velikov@gmail.com>
86               '946D09B5E4C9845E63075FF1D961C596A7203456'  # Andres Gomez <tanty@igalia.com>
87               'E3E8F480C52ADD73B278EE78E1ECBE07D7D70895'  # Juan Antonio Suárez Romero (Igalia, S.L.) <jasuarez@igalia.com>
88               'A5CC9FEC93F2F837CB044912336909B6B25FADFA'  # Juan A. Suarez Romero <jasuarez@igalia.com>
89               '71C4B75620BC75708B4BDB254C95FAAB3EB073EC'  # Dylan Baker <dylan@pnwbakers.com>
90               '57551DE15B968F6341C248F68D8E31AFC32428A6') # Eric Engestrom <eric@engestrom.ch>
92 prepare() {
93   cd mesa-$pkgver
96 _libdir=usr/lib
98 build() {
99   local meson_options=(
100     --libdir=/$_libdir
101     -D android-libbacktrace=disabled
102     -D b_ndebug=true
103     -D dri3=enabled
104     -D egl=enabled
105     -D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,i915,iris,crocus,zink,d3d12
106     -D gallium-extra-hud=true
107     -D gallium-nine=true
108     -D gallium-omx=bellagio
109     -D gallium-opencl=icd
110     -D gallium-rusticl=true
111     -D gallium-va=enabled
112     -D gallium-vdpau=enabled
113     -D gallium-xa=enabled
114     -D gbm=enabled
115     -D gles1=disabled
116     -D gles2=enabled
117     -D glvnd=true
118     -D glx=dri
119     -D intel-clc=enabled
120     -D libunwind=enabled
121     -D llvm=enabled
122     -D lmsensors=enabled
123     -D microsoft-clc=disabled
124     -D osmesa=true
125     -D platforms=x11,wayland
126     -D rust_std=2021
127     -D shared-glapi=enabled
128     -D valgrind=enabled
129     -D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc
130     -D vulkan-drivers=amd,intel,intel_hasvk,swrast,virtio-experimental
131     -D vulkan-layers=device-select,intel-nullhw,overlay
132   )
134   # Build only minimal debug info to reduce size
135   CFLAGS+=' -g1'
136   CXXFLAGS+=' -g1'
138   arch-meson mesa-$pkgver build "${meson_options[@]}"
139   meson configure build # Print config
140   meson compile -C build
142   # fake installation to be seperated into packages
143   # outside of fakeroot but mesa doesn't need to chown/mod
144   DESTDIR="${srcdir}/fakeinstall" meson install -C build
147 _install() {
148   local src f dir
149   for src; do
150     f="${src#fakeinstall/}"
151     dir="${pkgdir}/${f%/*}"
152     install -m755 -d "${dir}"
153     mv -v "${src}" "${dir}/"
154   done
157 package_vulkan-mesa-layers() {
158   pkgdesc="Mesa's Vulkan layers"
159   depends=(
160     'libdrm'
161     'libxcb'
162     'wayland'
164     'python'
165   )
166   conflicts=('vulkan-mesa-layer')
167   replaces=('vulkan-mesa-layer')
169   _install fakeinstall/usr/share/vulkan/explicit_layer.d
170   _install fakeinstall/usr/share/vulkan/implicit_layer.d
171   _install fakeinstall/$_libdir/libVkLayer_*.so
172   _install fakeinstall/usr/bin/mesa-overlay-control.py
174   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
177 package_opencl-mesa() {
178   pkgdesc="OpenCL support with clover and rusticl for mesa drivers"
179   depends=(
180     'clang'
181     'expat'
182     'libdrm'
183     'libelf'
184     'zstd'
186     'libclc'
187     'spirv-llvm-translator'
188   )
189   optdepends=('opencl-headers: headers necessary for OpenCL development')
190   provides=('opencl-driver')
192   _install fakeinstall/etc/OpenCL
193   _install fakeinstall/$_libdir/lib*OpenCL*
194   _install fakeinstall/$_libdir/gallium-pipe
196   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
199 package_vulkan-intel() {
200   pkgdesc="Intel's Vulkan mesa driver"
201   depends=(
202     'libdrm'
203     'libx11'
204     'libxshmfence'
205     'systemd'
206     'wayland'
207     'zstd'
208   )
209   optdepends=('vulkan-mesa-layers: additional vulkan layers')
210   provides=('vulkan-driver')
212   _install fakeinstall/usr/share/vulkan/icd.d/intel_*.json
213   _install fakeinstall/$_libdir/libvulkan_intel*.so
215   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
218 package_vulkan-radeon() {
219   pkgdesc="Radeon's Vulkan mesa driver"
220   depends=(
221     'libdrm'
222     'libelf'
223     'libx11'
224     'libxshmfence'
225     'llvm-libs'
226     'systemd'
227     'wayland'
228     'zstd'
229   )
230   optdepends=('vulkan-mesa-layers: additional vulkan layers')
231   provides=('vulkan-driver')
233   _install fakeinstall/usr/share/drirc.d/00-radv-defaults.conf
234   _install fakeinstall/usr/share/vulkan/icd.d/radeon_icd*.json
235   _install fakeinstall/$_libdir/libvulkan_radeon.so
237   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
240 package_vulkan-swrast() {
241   pkgdesc="Vulkan software rasteriser driver"
242   depends=(
243     'libdrm'
244     'libunwind'
245     'libx11'
246     'libxshmfence'
247     'llvm-libs'
248     'systemd'
249     'wayland'
250     'zstd'
251   )
252   optdepends=('vulkan-mesa-layers: additional vulkan layers')
253   conflicts=('vulkan-mesa')
254   replaces=('vulkan-mesa')
255   provides=('vulkan-driver')
257   _install fakeinstall/usr/share/vulkan/icd.d/lvp_icd*.json
258   _install fakeinstall/$_libdir/libvulkan_lvp.so
260   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
263 package_vulkan-virtio() {
264   pkgdesc="Venus Vulkan mesa driver for Virtual Machines"
265   depends=(
266     'libdrm'
267     'libx11'
268     'libxshmfence'
269     'systemd'
270     'wayland'
271     'zstd'
272   )
273   optdepends=('vulkan-mesa-layers: additional vulkan layers')
274   provides=('vulkan-driver')
276   _install fakeinstall/usr/share/vulkan/icd.d/virtio_icd*.json
277   _install fakeinstall/$_libdir/libvulkan_virtio.so
279   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
282 package_libva-mesa-driver() {
283   pkgdesc="VA-API drivers"
284   depends=(
285     'expat'
286     'libdrm'
287     'libelf'
288     'libx11'
289     'libxshmfence'
290     'llvm-libs'
291     'zstd'
292   )
293   provides=('libva-driver')
295   _install fakeinstall/$_libdir/dri/*_drv_video.so
297   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
300 package_mesa-vdpau() {
301   pkgdesc="VDPAU drivers"
302   depends=(
303     'expat'
304     'libdrm'
305     'libelf'
306     'libx11'
307     'libxshmfence'
308     'llvm-libs'
309     'zstd'
310   )
311   provides=('vdpau-driver')
313   _install fakeinstall/$_libdir/vdpau
315   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
318 package_mesa() {
319   depends=(
320     'libdrm'
321     'libelf'
322     'libglvnd'
323     'libunwind'
324     'libxdamage'
325     'libxshmfence'
326     'libxxf86vm'
327     'llvm-libs'
328     'lm_sensors'
329     'vulkan-icd-loader'
330     'wayland'
331     'zstd'
333     'libomxil-bellagio'
334   )
335   optdepends=(
336     'libva-mesa-driver: for accelerated video playback'
337     'mesa-vdpau: for accelerated video playback'
338     'opengl-man-pages: for the OpenGL API man pages'
339   )
340   provides=(
341     'mesa-libgl'
342     'opengl-driver'
343   )
344   conflicts=('mesa-libgl')
345   replaces=('mesa-libgl')
347   _install fakeinstall/usr/share/drirc.d/00-mesa-defaults.conf
348   _install fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json
350   # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast, swr
351   _install fakeinstall/$_libdir/dri/*_dri.so
353   _install fakeinstall/$_libdir/bellagio
354   _install fakeinstall/$_libdir/d3d
355   _install fakeinstall/$_libdir/lib{gbm,glapi}.so*
356   _install fakeinstall/$_libdir/libOSMesa.so*
357   _install fakeinstall/$_libdir/libxatracker.so*
359   _install fakeinstall/usr/include
360   _install fakeinstall/$_libdir/pkgconfig
362   # libglvnd support
363   _install fakeinstall/$_libdir/libGLX_mesa.so*
364   _install fakeinstall/$_libdir/libEGL_mesa.so*
366   # indirect rendering
367   ln -sr "$pkgdir"/$_libdir/libGLX_{mesa,indirect}.so.0
369   # make sure there are no files left to install
370   find fakeinstall -depth -print0 | xargs -0 rmdir
372   install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE