summaryrefslogtreecommitdiff
path: root/extra/chromium/PKGBUILD
blob: 12564c0296c23db800bb05fa74f2856d7916700a (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
# work around linker errors, see https://bbs.archlinux32.org/viewtopic.php?pid=4894#p4894
eval "$(
declare -f build | \
  sed '
    /_flags/ a _flags+=('fatal_linker_warnings=false')
  '
)"

# fix regression uintptr_t in vaapi
source+=(chromium-vaapi-uintptr.patch)
sha256sums+=('c1b2285dec2acae6108a496cba9230680cd5eedf3467d4563ec4b546fc8224aa')

eval "$(
  declare -f prepare | \
    sed '
      /chromium-vaapi-fix-the/a patch -Np1 -i ../chromium-vaapi-uintptr.patch
    '
)"

# no SAMUFLAGS, see https://www.mail-archive.com/pacman-dev@archlinux.org/msg17258.html
# going the sed-way
eval "$(
  declare -f build | \
    sed '
      s/ninja/ninja -j 1/
    '
)"

# can't create dynamic relocation R_386_32 against local symbol in readonly segment
eval "$(
  declare -f build | \
    sed '
      /gn gen/ i \
        sed -i '\''s/ldflags += [[] "-m32" []]/ldflags += [ "-m32", "-Wl,-z,notext" ]/'\'' build/config/compiler/BUILD.gn
    '
)"

# disable SSE2 for i686 (no i486 yet, flags are in the same place for MMX and SSE math, but
# we don't even have a gui yet), also disable SSE math as this is not supported with march=i686
# (at least  gcc)
if [ "$CARCH" = 'i686' ]; then
  eval "$(
    declare -f build | \
      sed '
        /gn gen/ i \
          sed -i '\''s/"-msse2"/""/'\'' build/config/compiler/BUILD.gn \
          sed -i '\''s/"-mfpmath=sse"/""/'\'' build/config/compiler/BUILD.gn
      '
  )"
fi

# for for 64-bit time functions in seccomp sanbox (thanks to schnitzeltony)
# https://github.com/schnitzeltony/meta-browser/blob/master/recipes-browser/chromium/files/0003-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch
source+=('chromium-81.0.4044.122-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch')
sha256sums+=('4837f797a910795bf3161805a3302d5f3701573ca90da8af32b2f4aa62510d20')
eval "$(
  declare -f prepare | \
    sed '
      /patch.*skia.*/a patch -Np1 -i "$srcdir/chromium-81.0.4044.122-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch"
    '
)"