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