-
Notifications
You must be signed in to change notification settings - Fork 186
/
bootstrap.sh
executable file
·82 lines (72 loc) · 1.96 KB
/
bootstrap.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
#!/usr/bin/env bash
# -*- coding: UTF-8 -*-
## This script will make you up and running for testing and/or development on the Yaru project.
## usage:
## bootstrap.sh --development
## bootstrap.sh --testing
## bootstrap.sh --build
##
## options:
## -d, --development Install the dependencies for building and installing Yaru theme
## -t, --testing Install the dependencies for testing an already installed Yaru theme
## -b, --build Build and install Yaru theme
# CLInt GENERATED_CODE: start
# No-arguments is not allowed
[ $# -eq 0 ] && sed -ne 's/^## \(.*\)/\1/p' $0 && exit 1
# Converting long-options into short ones
for arg in "$@"; do
shift
case "$arg" in
"--development") set -- "$@" "-d";;
"--testing") set -- "$@" "-t";;
"--build") set -- "$@" "-b";;
*) set -- "$@" "$arg"
esac
done
function print_illegal() {
echo Unexpected flag in command line \"$@\"
}
# Parsing flags and arguments
while getopts 'hdtb' OPT; do
case $OPT in
h) sed -ne 's/^## \(.*\)/\1/p' $0
exit 1 ;;
d) _development=1 ;;
t) _testing=1 ;;
b) _build=1 ;;
\?) print_illegal $@ >&2;
echo "---"
sed -ne 's/^## \(.*\)/\1/p' $0
exit 1
;;
esac
done
# CLInt GENERATED_CODE: end
# TODO choose between apt and dnf (at least initially)
INSTALLER="apt install"
function log {
echo "[+]" $@
}
development_deps=(meson sassc libgtk-3-dev)
testing_deps=(libgtk-3-dev gtk-3-examples gnome-tweaks)
function install {
target=$1
shift
deps=($@)
log "the following application will be installed for $target Yaru"
for d in ${deps[@]}; do
echo - $d
done
log "Press ENTER to continue"
read
sudo ${INSTALLER} ${deps[@]}
}
function build {
if [ ! -d build ]; then
meson build
fi
ninja -C build install
}
[ ! -z $_development ] && install "building and installing" ${development_deps[@]}
[ ! -z $_testing ] && install "testing" ${testing_deps[@]}
[ ! -z $_build ] && build