summaryrefslogtreecommitdiff
path: root/extra/ffmpeg/PKGBUILD
blob: 531700667dd9e791e006f7c4fb0d88df545a0d97 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# disable LTO (breaks with too few registers in error: 'asm' operand has impossible constraints
eval "$(
declare -f build | \
  sed '
	s/--enable-lto/--disable-lto/
  '
)"

# also disable mfx - libmfx does not compile
depends=(${depends[@]//libmfx/})
eval "$(
  declare -f build | \
    sed '
      s/--enable-libmfx/--disable-libmfx/
    '
)"

# no vamf for non-pentium4
if [ "$CARCH" == 'i686' ] || [ "$CARCH" == 'i486' ]; then
  depends=(${depends[@]//vmaf/})
  
  eval "$(
    declare -f prepare | \
      sed '
        /vmaf/d
      '
  )"

  eval "$(
    declare -f build | \
      sed '
        s/--enable-libvmaf/--disable-libvmaf/
      '
  )"

fi

# force picking of a modern libvpx and not libvpx1.3 needed for steam
makedepends+=('libvpx>=1.8.2')

# no AviSynthPlus on i486 (uses Intel intrinsics and cmake support for
# disabling it is broken)
makedepends=(${makedepends[@]//avisynthplus/})
makedepends_i686+=(avisynthplus)
makedepends_pentium4=("${makedepends_i686[@]}")
if [ "$CARCH" == 'i486' ]; then
  eval "$(
    declare -f build | \
      sed '
        s/--enable-avisynth/--disable-avisynth/
      '
  )"
fi

# no rav1e on i486, no Rust (yet)
if [ "$CARCH" == 'i486' ]; then
  depends=(${depends[@]//librav1e.so/})
  eval "$(
    declare -f build | \
      sed '
        s@--enable-librav1e@--disable-librav1e@
      '
  )"
fi

# svt-av1 is 64-bit only
depends=(${depends[@]//svt-av1/})
eval "$(
  declare -f build | \
    sed '
      s@--enable-libsvtav1@--disable-libsvtav1@
    '
)"

# -latomic on i486
if [ "$CARCH" == 'i486' ]; then
  depends=(${depends[@]//librav1e.so/})
  eval "$(
    declare -f build | \
      sed '
        s@make[^ ]@make EXTRALIBS-ffmpeg=-latomic EXTRALIBS-ffplay=-latomic EXTRALIBS-ffprobe=-latomic@
      '
  )"
fi

# disable all modern optimizations
eval "$(
  declare -f build | \
    sed '
      s|./configure|./configure --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-mmxext --disable-avx --disable-avx2 --disable-avx512|
    '
)"
# disabled specific assembly per subarchitecture
if [ "$CARCH" == 'i486' ]; then
  eval "$(
    declare -f build | \
      sed '
        s|./configure|./configure --disable-sse --disable-sse2 --disable-mmx|
      '
  )"
fi
if [ "$CARCH" == 'i686' ]; then
  eval "$(
    declare -f build | \
      sed '
        s|./configure|./configure --disable-sse --disable-mmx|
      '
  )"
fi

# see FS32#239, basically everything breaks otherwise
eval "$(
  declare -f build | \
    sed '
      s|./configure|./configure --disable-asm|
    '
)"

# see FS32#239, x264 and i486 result in missing symbols, no clue
if [ "$CARCH" == 'i486' ]; then
  eval "$(
    declare -f build | \
      sed '
        s|--enable-libx264|--disable-libx264|
      '
  )"
fi

# no Rust and librsvg on i486 (for now), use librsvg-og instead
if [ "$CARCH" == 'i486' ]; then
  makedepends+=(librsvg-og)
fi