Repository navigation
Expand file tree
/
Copy pathapp
More file actions
executable file
·119 lines (106 loc) · 3.25 KB
/
Copy pathapp
File metadata and controls
executable file
·119 lines (106 loc) · 3.25 KB
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
#!/bin/bash
arg=$1
function initialize {
meson setup build --prefix=/usr
result=$?
if [ $result -gt 0 ]; then
echo "Unable to initialize, please review log"
exit 1
fi
cd build
ninja
result=$?
if [ $result -gt 0 ]; then
echo "Unable to build project, please review log"
exit 2
fi
}
function test {
initialize
export DISPLAY=:0
./minder-regress
result=$?
export DISPLAY=":0.0"
echo ""
if [ $result -gt 0 ]; then
echo "Failed testing"
exit 100
fi
echo "Tests passed!"
}
case $1 in
"clean")
sudo rm -rf ./build
;;
"generate-i18n")
grep -rc _\( * | grep ^src | grep -v :0 | cut -d : -f 1 | sort -o po/POTFILES
initialize
ninja io.github.phase1geo.minder-pot
ninja io.github.phase1geo.minder-update-po
ninja extra-pot
ninja extra-update-po
cp data/* ../data
;;
"install")
initialize
sudo ninja install
;;
"run")
initialize
./io.github.phase1geo.minder "${@:2}"
;;
"run-rtl")
initialize
LANG=he_IL.utf8 ./io.github.phase1geo.minder "${@:2}"
;;
"run-flatpak")
flatpak run io.github.phase1geo.minder "${@:2}"
;;
"debug")
initialize
# G_DEBUG=fatal-criticals gdb --args ./io.github.phase1geo.minder "${@:2}"
G_DEBUG=fatal-warnings gdb --args ./io.github.phase1geo.minder "${@:2}"
;;
"heaptrack")
initialize
heaptrack ./io.github.phase1geo.minder "${@:2}"
;;
"valgrind")
initialize
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --num-callers=30 ./io.github.phase1geo.minder "${0:2}" | tee ../valgrind.out
;;
"flatpak-debug")
echo "Run command at prompt: G_DEBUG=fatal-criticals gdb /app/bin/io.github.phase1geo.minder"
flatpak run --devel --command=sh io.github.phase1geo.minder
;;
"test")
test
;;
"uninstall")
initialize
sudo ninja uninstall
;;
"elementary")
flatpak-builder --user --install --force-clean ../build-minder-elementary elementary/io.github.phase1geo.minder.yml
flatpak install --user --reinstall --assumeyes "$(pwd)/.flatpak-builder/cache" io.github.phase1geo.minder.Debug
;;
"flathub")
flatpak-builder --user --install --force-clean ../build-minder-flathub flathub/io.github.phase1geo.minder.yml
flatpak install --user --reinstall --assumeyes "$(pwd)/.flatpak-builder/cache" io.github.phase1geo.minder.Debug
;;
*)
echo "Usage:"
echo " ./app [OPTION]"
echo ""
echo "Options:"
echo " clean Removes build directories (can require sudo)"
echo " generate-i18n Generates .pot and .po files for i18n (multi-language support)"
echo " install Builds and installs application to the system (requires sudo)"
echo " run Builds and runs the application (must run install once before successive calls to this command)"
echo " test Builds and runs testing for the application"
echo " uninstall Removes the application from the system (requires sudo)"
echo " elementary Builds and installs the elementary flatpak"
echo " flathub Builds and installs the Flathub flatpak"
echo " run-flatpak Runs currently installed Flatpak of the application"
;;
esac