-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibcec.sh
57 lines (42 loc) · 1 KB
/
libcec.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
#!/bin/bash -x
# source: http://forum.odroid.com/viewtopic.php?f=52&t=2973
. utils.sh
function build_libcec() {
local version="${1:-"2.1.3"}"
install_dependencies
clone_and_build "${version}"
test_libcec
}
function install_dependencies() {
for package in "build-essential" \
"libudev-dev" \
"automake" \
"libtool" \
"pkg-config" \
"liblockdev1" \
"liblockdev1-dev" \
"checkinstall"
do
install_package "${package}"
done
}
function clone_and_build() {
local version="${1}"
git_clone "https://github.com/mdrjr/libcec.git" # "libcec-${version}" ## requires master's commits to properly work
cd "${clone}"
./bootstrap
./configure --enable-exynos
make -j5
checkinstall -y --pkgversion="${version}"
dpkg -i "libcec_${version}-1_armhf.deb"
ldconfig
cd -
}
function test_libcec() {
if cec-client | head -1 > /dev/null
then
success
else
failure
fi
}