This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_cc_ffmpeg.sh
executable file
·95 lines (72 loc) · 3.55 KB
/
install_cc_ffmpeg.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
show_current_task
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
exportdefvar ffmpeg_GITURL "https://git.ffmpeg.org"
exportdefvar ffmpeg_GITREPO "ffmpeg"
exportdefvar ffmpeg_BRANCH "release/4.0"
exportdefvar ffmpeg_REVISION ""
exportdefvar ffmpeg_RECOMPILE n
exportdefvar ffmpeg_EXTRAARGS " --extra-libs=-ldl --enable-libx264 --enable-nonfree --enable-gpl "
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
show_message \
"ffmpeg_BRANCH : ${ffmpeg_BRANCH}" \
"ffmpeg_RECOMPILE : ${ffmpeg_RECOMPILE}" \
"ffmpeg_EXTRAARGS : ${ffmpeg_EXTRAARGS}" \
"ARCH : ${ARCH}" \
"CPU : ${mARCH}" \
"PATH : ${PATH}" \
"TOOLCHAIN_SYS : ${TOOLCHAIN_SYS}" \
"PREFIX : ${HOST_PREFIX}" \
"SYSROOT : ${SYSROOT}"
show_message_counter " continue in:"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# GET PACKAGES --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ----
if ! ( get_git_pkg "${ffmpeg_GITURL}" "${ffmpeg_GITREPO}" "${ffmpeg_BRANCH}" "${ffmpeg_REVISION}" ) ; then goto_exit 1 ; fi
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# INSTALL PACKAGES - --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
if ! pushd "${CACHE}/${ffmpeg_GITREPO}-${ffmpeg_BRANCH}" ; then goto_exit 2 ; fi
transformFsToHost
if ( [ "${ffmpeg_RECOMPILE}" != "n" ] || ! [ -f ".made" ] ) ; then
rm ".made"
rm -rf "bin"
make clean
fi
if ! [ -f ".made" ] ; then
if ! ( ./configure \
--arch=${ARCH} \
--cpu=${mARCH} \
--target-os=linux \
--enable-cross-compile \
--cross-prefix="${TOOLCHAIN_SYS}-" \
--prefix="${HOST_PREFIX}" \
--sysroot="${SYSROOT}" \
--disable-outdev=oss \
--disable-indev=oss \
--enable-shared \
--enable-pic \
${ffmpeg_EXTRAARGS}
)
then goto_exit 3 ; fi
if ! ( make ${NJ} ) ; then goto_exit 4 ; fi
mkdir "bin"
if ! ( DESTDIR="bin" make install ) ; then goto_exit 5 ; fi
echo "1" > ".made"
fi
transformFsToDevice
pushd "bin${HOST_PREFIX}/lib/pkgconfig"
for PCFILE in *.pc ; do
if [ -z "$(cat ${PCFILE} | grep ${HOST_LIBDIR})" ] ; then
sed -i "s|/lib|${HOST_LIBDIR}|g" "${PCFILE}"
fi
done
popd
if ! (
( preAuthRoot && sudo cp -R "bin${HOST_PREFIX}/bin" "${SYSROOT}${HOST_PREFIX}/" ) &&
( preAuthRoot && sudo cp -R "bin${HOST_PREFIX}/share" "${SYSROOT}${HOST_PREFIX}/" ) &&
( preAuthRoot && sudo cp -R "bin${HOST_PREFIX}/include" "${SYSROOT}${HOST_PREFIX}/" ) &&
( preAuthRoot && sudo cp -R "bin${HOST_PREFIX}/lib"/* "${SYSROOT}${HOST_PREFIX}${HOST_LIBDIR}/" )
)
then goto_exit 6 ; fi
popd
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
show_message "FFMPEG WAS SUCCESSFULLY INSTALLED!"