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