summaryrefslogtreecommitdiff
path: root/extra/mesa/PKGBUILD
blob: db37eccecce9f7f26ac5e5b749f59af64ac0aa7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# disable openswf as it requires AVX, makes no sense with old CPUs
# disable every new software rasterizer and take the old ones
# see also FS32#39
eval "$(
  declare -f build | \
    sed '
      /arch-meson/s/\(gallium-drivers=.*\),swrast,swr/\1,swrast/
      /arch-meson/s/\(-D swr-arches=\)avx,avx2/\1/
    '
  declare -f package_mesa | \
    sed '
      s@_install fakeinstall/usr/lib/libswrAVX.*@#\0@g
    '
)"

# do not build/package vulkan on i486
# do not build i915,i965 on i486
if [ "$CARCH" = 'i486' ]; then
  eval "$(
    declare -f build | \
      sed '
        s/\(-D gallium-drivers=\)\S\+ /\1 /
        s/-D gallium-omx=bellagio //
        s/-D gallium-opencl=\S\+ //
        s/-D osmesa=gallium //
        s/\(-D gallium-\S\+=\)enabled /\1disabled /g
        s/\(-D gallium-nine=\)true /\1false /g
        s/\(-D vulkan-drivers=\)\S\+ /\1 /
        s/\(-D dri-drivers=\(\S\+,\)\?\)i915,/\1/
        s/\(-D dri-drivers=\(\S\+,\)\?\)i965,/\1/
      '
    declare -f package_mesa | \
      sed '
        \,rm .*/vulkan;,d
        \,bellagio,d
        \,fakeinstall/usr/lib/d3d,d
        \,fakeinstall/usr/lib/libOSMesa\.so\*,d
        \,fakeinstall/usr/lib/libxatracker\.so\*,d
      '
  )"
fi
eval "$(
  declare -f package_vulkan-intel package_vulkan-radeon | \
    sed '
      /^\s*{\s*$/ a arch=('"$(
        printf '%s\n' "${arch[@]}" | \
          grep -vxF 'i486' | \
          tr '\n' ' '
      )"')
    '
)"
for _pkgn in $(
  printf '%s\n' "${pkgname[@]}" \
  | grep -x 'vulkan-\S\+\|opencl-mesa\|libva-mesa-driver\|mesa-vdpau'
); do
  eval "$(
    declare -f "package_${_pkgn}" \
    | sed '
      2a [ "${CARCH}" != i486 ] || return
    '
  )"
done