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
/
Copy pathinstall_cc_gstreamer-1.0.sh
executable file
·96 lines (68 loc) · 3.23 KB
/
install_cc_gstreamer-1.0.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
96
#!/bin/bash
show_current_task
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
exportdefvar gst_GITURL "https://gitlab.freedesktop.org/gstreamer"
exportdefvar gst_GITREPO "gst-build"
exportdefvar gst_BRANCH "1.18"
exportdefvar gst_REVISION ""
exportdefvar gst_PATCH ""
exportdefvar gst_RECOMPILE n
exportdefvar gst_MESON_OPS ""
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
show_message \
"gst_BRANCH : ${gst_BRANCH}" \
"gst_RECOMPILE : ${gst_RECOMPILE}" \
"gst_MESON_OPS : ${gst_MESON_OPS}"
show_message_counter " continue in:"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# GET PACKAGES --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ----
if ! ( get_git_pkg "${gst_GITURL}" "${gst_GITREPO}" "${gst_BRANCH}" "${gst_REVISION}" ) ; then goto_exit 1 ; fi
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# INSTALL PACKAGES - --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
if ! pushd "${CACHE}/${gst_GITREPO}-${gst_BRANCH}" ; then goto_exit 2 ; fi
transformFsToHost
if ( [ "${gst_RECOMPILE}" != "n" ] || ! [ -f ".made" ] ) ; then
rm ".made"
rm -rf "bin"
rm -rf "build"
fi
if ( ! [ -f ".made" ] || ! [ -d "bin" ] || ! [ -d "build" ] ) ; then
rm ".made"
mkdir "build"
pushd "build"
if ! ( meson ${gst_MESON_OPS} --cross-file="${MESON_INI_FILE}" --prefix="${HOST_PREFIX}" ".." ) ; then
goto_exit 3
fi
popd
if ! ( run_patcher "${gst_PATCH}" ) ; then goto_exit 4 ; fi
if ( ! [ -f ".made" ] || ! [ -d "build" ] ) ; then
rm ".made"
mkdir "build"
pushd "build"
if ! ( ninja ) ; then goto_exit 5 ; fi
popd
fi
if ! [ -f "${CACHE}/gst-build-${gst_BRANCH}.tar" ] ; then
tar --exclude=".made" --exclude="bin" --exclude="build" -C ".." -cf "${CACHE}/gst-build-${gst_BRANCH}.tar" "gst-build-${gst_BRANCH}"
fi
echo "1" > ".made"
fi
if [ -f ".made" ] ; then
mkdir "bin"
pushd "build"
if ! ( DESTDIR="${CACHE}/gst-build-${gst_BRANCH}/bin" ninja install ) ; then goto_exit 6 ; fi
popd
fi
install_to_sysroot "bin"
transformFsToDevice
preAuthRoot && sudo rm -rf "${SYSROOT}${HOST_PREFIX}/lib/gstreamer-1.0"
if ! ( preAuthRoot && sudo chroot "${SYSROOT}" ln -s "${HOST_PREFIX}${HOST_LIBDIR}/gstreamer-1.0" "${HOST_PREFIX}/lib/gstreamer-1.0" ) ; then goto_exit 7 ; fi
preAuthRoot
sudo mkdir -p "${SYSROOT}/profile.d"
echo "#!/bin/sh
export GST_PLUGIN_SCANNER='/usr/lib/gstreamer-1.0'
export GST_PLUGIN_SYSTEM_PATH=${GST_PLUGIN_SCANNER}" | sudo tee "${SYSROOT}/profile.d/gst_env.sh"
sudo chmod +x "${SYSROOT}/profile.d/gst_env.sh"
popd
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
show_message "GSTREAMER-1.0 WAS SUCCESSFULLY INSTALLED!"