# disable LTO (breaks with too few registers in error: 'asm' operand has impossible constraints
# also disable mfx - libmfx does not compile
eval "$(
declare -f build | \
  sed '
	s/--enable-lto/--disable-lto/
	s/--enable-libmfx/--disable-libmfx/
  '
)"
depends=(${depends[@]//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

# still required dependencies on i486:
# sdl2
# - ibus
#   - gtk3
#   - libnotify
#   - python-gobject
#   - gtk2
#   - qt5-base
#   - unicode-cldr
# - fcitx
# v4l-utils
# - qt5-base
#   - mariadb-libs
#   - qtk3