-
Notifications
You must be signed in to change notification settings - Fork 0
/
kcov-appimage.sh
executable file
·123 lines (76 loc) · 2.41 KB
/
kcov-appimage.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
root=$(readlink -f .)
sources=${root}/src
resources=${root}/resources
build=${root}/build
log=${root}/log
appdir=${root}/appdir
version=v$(wget -q -O - https://github.com/SimonKagstrom/kcov/releases \
| grep -o -E '/SimonKagstrom/kcov/archive/v[[:digit:]]+.tar.gz' \
| grep -o -E '[[:digit:]]+' \
| sort -n -r \
| head -n 1)
make_kcov() {
cd "${sources}"
if [ ! -f kcov-${version}.tar.gz ] ; then
wget -O kcov-${version}.tar.gz https://github.com/SimonKagstrom/kcov/archive/${version}.tar.gz
fi
cd "${build}"
tar -xzf "${sources}"/kcov-${version}.tar.gz
cd kcov-*
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make kcov
make install DESTDIR="${appdir}"
cd "${root}"
}
describe_appimage() {
mkdir -p "${appdir}"/usr/share/applications
mkdir -p "${appdir}"/usr/share/icons/hicolor/256x256/apps
#Blanket by Alex Muravev from the Noun Project
cp "${resources}"/blanket.png "${appdir}"/usr/share/icons/hicolor/256x256/apps/kcov.png
cat > "${appdir}"/usr/share/applications/kcov.desktop <<EOF
[Desktop Entry]
Name=kcov
Icon=kcov
Type=Application
Exec=kcov
Categories=Development;
Terminal=true
Comment=kcov code coverage tool ${version}
EOF
cat "${appdir}"/usr/share/applications/kcov.desktop
}
gather_dependencies() {
cd "${resources}"
if [ ! -f linuxdeploy-x86_64.AppImage ] ; then
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
fi
cd "${root}"
"${resources}"/linuxdeploy-x86_64.AppImage --appdir ""${appdir}""
}
make_appimage() {
cd "${resources}"
if [ ! -f appimagetool-x86_64.AppImage ] ; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod a+x appimagetool-x86_64.AppImage
fi
cd "${root}"
ARCH=x86_64 "${resources}"/appimagetool-x86_64.AppImage "${appdir}"
#mv kcov*.AppImage kcov-${version}-x86_64.AppImage
}
appimage_done() {
ls -lh "${root}"/kcov-*.AppImage
}
rm -Rf "${build}" "${appdir}" "${log}" kcov-*.AppImage
mkdir -p "${build}" "${appdir}" "${log}" "${sources}" "${resources}"
for todo in make_kcov describe_appimage gather_dependencies make_appimage appimage_done; do
cat <<EOF
#############################################################
#
# ${todo}
#
#############################################################
EOF
${todo} 2>&1 | tee "${log}"/${todo}.log
done