summaryrefslogtreecommitdiff
path: root/extra/mesa/PKGBUILD
blob: 1d7b118b9f06e29f608516fc7b51177fdc65025e (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 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
      '
  )"
  pkgname=(
    $(
      printf '%s\n' "${pkgname[@]}" \
      | grep -v '^vulkan-' \
      | grep -vxF opencl-mesa \
      | grep -vxF libva-mesa-driver \
      | grep -vxF mesa-vdpau
    )
  )
fi
eval "$(
  declare -f package_vulkan-intel package_vulkan-radeon package_opencl-mesa package_libva-mesa-driver package_mesa-vdpau | \
    sed '
      /^\s*{\s*$/ a arch=('"$(
        printf '%s\n' "${arch[@]}" | \
          grep -vxF 'i486' | \
          tr '\n' ' '
      )"')
    '
)"

# break cycle with conflicting installation files between mesa and libglvnd
# (indirect dependency via libva)
# i486-specific
makedepends=(${makedepends[@]//libva/})
makedepends_i686+=(libva)
makedepends_pentium4=("${makedepends_i686[@]}")
makedepends=(${makedepends[@]//libglvnd/})
makedepends_i686+=(libglvnd)
makedepends_pentium4=("${makedepends_i686[@]}")
if [ "$CARCH" = 'i486' ]; then
  eval "$(
    declare -f build | \
      sed '
        s/\(-D glvnd=\)true /\1false /g
      '
    declare -f package_mesa | \
      sed '
        s/'libglvnd'//g
        s/.*glvnd.*//g
        s/.*libGLX_mesa.so.*//g
        s/.*libEGL_mesa.so.*//g
        s/.*find fakeinstall.*//g
      '
    )
    package_vulkan-mesa-layers()
    {
       true
    }
    package_vulkan-swrast()
    {
       true
    }
  "
fi