mpv: Rebuild after ffmpeg update
[termux-packages] / packages / ffmpeg / build.sh
CommitLineData
af52bea3 1TERMUX_PKG_HOMEPAGE=https://ffmpeg.org
351bc9db 2TERMUX_PKG_DESCRIPTION="Tools and libraries to manipulate a wide range of multimedia formats and protocols"
af52bea3 3# NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg.
49ac27c7 4TERMUX_PKG_VERSION=3.2.1
b55a2fee 5TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz
49ac27c7 6TERMUX_PKG_SHA256=1ecf93da5d601e6fb3096c65cbe33fdaf042d690a3c50c4efadb0a9b74f2badf
05f3b9f0 7TERMUX_PKG_FOLDERNAME=ffmpeg-$TERMUX_PKG_VERSION
351bc9db 8# libbz2 is used by matroska decoder:
49ac27c7
FF
9# libvpx is the VP8 & VP9 video encoder for WebM, see
10# https://trac.ffmpeg.org/wiki/Encode/VP8 and https://trac.ffmpeg.org/wiki/Encode/VP9
56862a32 11TERMUX_PKG_DEPENDS="openssl, libbz2, libx264, xvidcore, libvorbis, libmp3lame, libopus, libvpx"
351bc9db 12TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="share/ffmpeg/examples"
47b2c44e 13TERMUX_PKG_CONFLICTS="libav"
351bc9db
FF
14
15termux_step_configure () {
16 cd $TERMUX_PKG_BUILDDIR
a5be0489
FF
17
18 local _EXTRA_CONFIGURE_FLAGS=""
351bc9db
FF
19 if [ $TERMUX_ARCH = "arm" ]; then
20 _ARCH="armeabi-v7a"
a5be0489 21 _EXTRA_CONFIGURE_FLAGS="--enable-neon"
351bc9db
FF
22 elif [ $TERMUX_ARCH = "i686" ]; then
23 _ARCH="x86"
a5be0489
FF
24 # Specify --disable-asm to prevent text relocations on i686,
25 # see https://trac.ffmpeg.org/ticket/4928
26 _EXTRA_CONFIGURE_FLAGS="--disable-asm"
ed0fc1fd
FF
27 elif [ $TERMUX_ARCH = "x86_64" ]; then
28 _ARCH="x86_64"
a5be0489 29 elif [ $TERMUX_ARCH = "aarch64" ]; then
351bc9db 30 _ARCH=$TERMUX_ARCH
a5be0489
FF
31 _EXTRA_CONFIGURE_FLAGS="--enable-neon"
32 else
33 echo "Unsupported arch $TERMUX_ARCH"
34 exit 1
351bc9db 35 fi
a5be0489 36
45409e84
FF
37 # --disable-lzma to avoid problem with shared library clashes, see
38 # https://github.com/termux/termux-packages/issues/511
39 # Only used for LZMA compression support for tiff decoder.
351bc9db
FF
40 $TERMUX_PKG_SRCDIR/configure \
41 --arch=${_ARCH} \
42 --cross-prefix=${TERMUX_HOST_PLATFORM}- \
a5be0489 43 --disable-avdevice \
351bc9db
FF
44 --disable-ffserver \
45 --disable-static \
e73b0067 46 --disable-symver \
45409e84 47 --disable-lzma \
351bc9db
FF
48 --enable-cross-compile \
49 --enable-gpl \
bc0596c1 50 --enable-libmp3lame \
351bc9db 51 --enable-libvorbis \
c842d781 52 --enable-libopus \
351bc9db
FF
53 --enable-libx264 \
54 --enable-libxvid \
56862a32 55 --enable-libvpx \
351bc9db
FF
56 --enable-nonfree \
57 --enable-openssl \
58 --enable-shared \
59 --prefix=$TERMUX_PREFIX \
5794a3f9 60 --target-os=android \
a5be0489 61 $_EXTRA_CONFIGURE_FLAGS
351bc9db
FF
62}
63