50-xavs2.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. SCRIPT_REPO="https://github.com/pkuvcl/xavs2.git"
  3. SCRIPT_COMMIT="eae1e8b9d12468059bdd7dee893508e470fa83d8"
  4. ffbuild_enabled() {
  5. [[ $VARIANT == lgpl* ]] && return -1
  6. [[ $TARGET == win32 ]] && return -1
  7. # xavs2 aarch64 support is broken
  8. [[ $TARGET == *arm64 ]] && return -1
  9. return 0
  10. }
  11. ffbuild_dockerdl() {
  12. echo "git clone \"$SCRIPT_REPO\" . && git checkout \"$SCRIPT_COMMIT\""
  13. }
  14. ffbuild_dockerbuild() {
  15. cd build/linux
  16. local myconf=(
  17. --disable-cli
  18. --enable-static
  19. --enable-pic
  20. --disable-avs
  21. --disable-swscale
  22. --disable-lavf
  23. --disable-ffms
  24. --disable-gpac
  25. --disable-lsmash
  26. --extra-asflags="-w-macro-params-legacy"
  27. --extra-cflags="-Wno-error=incompatible-pointer-types"
  28. --prefix="$FFBUILD_PREFIX"
  29. )
  30. if [[ $TARGET == win* || $TARGET == linux* ]]; then
  31. myconf+=(
  32. --host="$FFBUILD_TOOLCHAIN"
  33. --cross-prefix="$FFBUILD_CROSS_PREFIX"
  34. )
  35. else
  36. echo "Unknown target"
  37. return -1
  38. fi
  39. # Work around configure endian check failing on modern gcc/binutils.
  40. # Assumes all supported archs are little endian.
  41. sed -i -e 's/EGIB/bss/g' -e 's/naidnePF/bss/g' configure
  42. ./configure "${myconf[@]}"
  43. make -j$(nproc)
  44. make install
  45. }
  46. ffbuild_configure() {
  47. echo --enable-libxavs2
  48. }
  49. ffbuild_unconfigure() {
  50. echo --disable-libxavs2
  51. }