chiark / gitweb /
libmsgpack: Update from 2.0.0 to 2.1.0
[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.2.1
5 TERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz
6 TERMUX_PKG_SHA256=1ecf93da5d601e6fb3096c65cbe33fdaf042d690a3c50c4efadb0a9b74f2badf
7 TERMUX_PKG_FOLDERNAME=ffmpeg-$TERMUX_PKG_VERSION
8 # libbz2 is used by matroska decoder:
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
11 TERMUX_PKG_DEPENDS="openssl, libbz2, libx264, xvidcore, libvorbis, libmp3lame, libopus, libvpx"
12 TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="share/ffmpeg/examples"
13 TERMUX_PKG_CONFLICTS="libav"
14
15 termux_step_configure () {
16         cd $TERMUX_PKG_BUILDDIR
17
18         local _EXTRA_CONFIGURE_FLAGS=""
19         if [ $TERMUX_ARCH = "arm" ]; then
20                 _ARCH="armeabi-v7a"
21                 _EXTRA_CONFIGURE_FLAGS="--enable-neon"
22         elif [ $TERMUX_ARCH = "i686" ]; then
23                 _ARCH="x86"
24                 # Specify --disable-asm to prevent text relocations on i686,
25                 # see https://trac.ffmpeg.org/ticket/4928
26                 _EXTRA_CONFIGURE_FLAGS="--disable-asm"
27         elif [ $TERMUX_ARCH = "x86_64" ]; then
28                 _ARCH="x86_64"
29         elif [ $TERMUX_ARCH = "aarch64" ]; then
30                 _ARCH=$TERMUX_ARCH
31                 _EXTRA_CONFIGURE_FLAGS="--enable-neon"
32         else
33                 echo "Unsupported arch $TERMUX_ARCH"
34                 exit 1
35         fi
36
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.
40         $TERMUX_PKG_SRCDIR/configure \
41                 --arch=${_ARCH} \
42                 --cross-prefix=${TERMUX_HOST_PLATFORM}- \
43                 --disable-avdevice \
44                 --disable-ffserver \
45                 --disable-static \
46                 --disable-symver \
47                 --disable-lzma \
48                 --enable-cross-compile \
49                 --enable-gpl \
50                 --enable-libmp3lame \
51                 --enable-libvorbis \
52                 --enable-libopus \
53                 --enable-libx264 \
54                 --enable-libxvid \
55                 --enable-libvpx \
56                 --enable-nonfree \
57                 --enable-openssl \
58                 --enable-shared \
59                 --prefix=$TERMUX_PREFIX \
60                 --target-os=android \
61                 $_EXTRA_CONFIGURE_FLAGS
62 }
63