-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·75 lines (58 loc) · 1.5 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
FFMPEG_VERSION=4.2.2
PREFIX="/opt"
echo "Installing build tools"
sudo yum install -y \
autoconf \
automake \
bzip2 \
bzip2-devel \
cmake \
freetype-devel \
gcc \
gcc-c++ \
git \
libtool \
make \
pkgconfig \
glibc-static \
zlib-devel
mkdir ffmpeg_sources
cd ffmpeg_sources/
echo "Installing NASM"
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2
tar xjvf nasm-2.15.05.tar.bz2
cd nasm-2.15.05
./autogen.sh
./configure --prefix="$PREFIX/ffmpeg_build" --bindir="$PREFIX/bin"
make
make install
cd ..
echo "Installing YASM"
curl -O -L https://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix="$PREFIX/ffmpeg_build" --bindir="$PREFIX/bin"
make
make install
cd ..
echo "Compiling FFMPEG"
mkdir ffmpeg_src/
cd ffmpeg_src/
curl -sL https://github.com/giusedroid/ffmpeg-lgpl-amazonlinux2/blob/main/ffmpeg/ffmpeg-${FFMPEG_VERSION}.tar.bz2?raw=true > ffmpeg.tar.bz2 && \
tar -jx --strip-components=1 -f ffmpeg.tar.bz2
PATH="$PREFIX/bin:$PATH"
PKG_CONFIG_PATH="$PREFIX/ffmpeg_build/lib/pkgconfig"
./configure \
--prefix="$PREFIX/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$PREFIX/ffmpeg_build/include -static" \
--extra-ldflags="-L$PREFIX/ffmpeg_build/lib -static" \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-network \
--bindir="$PREFIX/bin"
make
make install
cd ..