forked from espressif/esp-matter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (64 loc) · 1.73 KB
/
install.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
#!/usr/bin/env bash
set -e
# function to print help message
print_help() {
echo "Options:"
echo " --no-host-tool Disable installation of host tools"
echo " --help Display this help message"
}
# Parse command-line arguments
NO_HOST_TOOL=false
while [[ "$#" -gt 0 ]]; do
case $1 in
--no-host-tool)
NO_HOST_TOOL=true
;;
--help)
print_help
exit 1
;;
*)
print_help
exit 1
;;
esac
shift
done
basedir=$(dirname "$0")
ESP_MATTER_PATH=$(cd "${basedir}"; pwd)
MATTER_PATH=${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip
export ZAP_INSTALL_PATH=${MATTER_PATH}/.environment/cipd/packages/zap
echo ""
echo "Running Matter Setup"
echo ""
cd ${MATTER_PATH}
source ${MATTER_PATH}/scripts/bootstrap.sh
cd ${ESP_MATTER_PATH}
echo ""
echo "Building host tools"
echo ""
if [ $NO_HOST_TOOL = false ]; then
gn --root="${MATTER_PATH}" gen ${MATTER_PATH}/out/host --args='chip_inet_config_enable_ipv4=false'
ninja -C ${MATTER_PATH}/out/host chip-cert chip-tool
echo ""
echo "Host tools built at: ${MATTER_PATH}/out/host"
fi
echo ""
echo "Exit Matter environment"
echo ""
deactivate
echo ""
echo "Installing python dependencies for Matter"
echo ""
# Install python dependencies based on idf version
if [[ $(git -C $IDF_PATH describe) == v4.4* ]]; then
echo "Installing requirements from requirements_idf_v4.4.txt"
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements_idf_v4.4.txt
else
echo "Installing requirements from requirements.txt"
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements.txt
fi
echo "All done! You can now run:"
echo ""
echo " . ${basedir}/export.sh"
echo ""