This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.sh
executable file
·81 lines (64 loc) · 1.57 KB
/
build.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
#!/usr/bin/env bash
project_path="./paperpi/"
#required_deb=("libtiff5" "libopenjp2-7")
source cd_apt_packages # Provides REQUIRED_DEB
function check_env {
echo "checking build environment"
if ! command -v pipenv &> /dev/null
then
echo "development environment not configured"
echo "try running `devel/create_devel_venf.sh`"
exit 1
else
echo "pipenv OK"
fi
if ! pipenv --venv
then
echo "missing pipenv virtual environment"
echo "try running `devel/create_devel_venv.sh`"
exit 1
fi
}
function update_waveshare {
ws_version=$(grep ws_version $project_path/my_constants.py)
echo "Waveshare EPD Library version: $ws_version"
read -t 8 -p "would you like to pull the latest version? [y/N] " -n 1 -r
if [[ ! $REPLY =~ [^Yy]$ ]]
then
bash ./update_waveshare.sh
else
echo skipping update of waveshare library...
fi
}
function check_packages {
halt=0
echo "checking for required debian packages"
for i in "${REQUIRED_DEB[@]}"
do
echo checking package $i
if [ $(dpkg-query -W -f='${Status}' $i | grep -c "ok installed") -eq 0 ]
then
echo package $i is not installed. Install with:
echo $sudo apt install $i
echo ""
halt=$((halt+1))
else
echo $i...ok
echo ""
fi
done
if [[ $halt -gt 0 ]]
then
echo "$halt critical packages missing. See messages above."
echo "stopping build here"
exit 1
fi
}
function build_binary {
echo "building binary using pyinstaller"
pipenv run python3 build_bin.py
}
check_packages
check_env
#update_waveshare
build_binary