-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathbuild_environment_setup.sh
More file actions
executable file
·148 lines (109 loc) · 3.74 KB
/
build_environment_setup.sh
File metadata and controls
executable file
·148 lines (109 loc) · 3.74 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#/bin/sh
# This script will create a folder named "tf" in your home directory,
# clone all of the tinkerforge gits, install all packages to build,
# the Bindings, the distribution zips, the documentation, Brick firmwares,
# Bricklet plugins, Brick Viewer and Brick Daemon.
# You will also be able to open, view and edit the schematics and layouts
# for Bricks and Bricklets as well as the design files of the cases.
# It was last tested with a Debian Trixie 13.3
cd ~
sudo apt update
# Packages for general use
sudo apt -y install python3 git
# Packages for "generators/generate_all.py"
sudo apt -y install php
sudo apt -y install build-essential mono-complete python3 perl default-jre default-jdk maven nodejs npm php-pear ruby zip golang-go rust-all
sudo npm install -g browserify
# Packages for dotnet (for c# bindings)
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-10.0
# Packages for "generators/test_all.py"
sudo apt -y install libxml2-utils libgd-dev libgd-perl libterm-readkey-perl libb-lint-perl
# Packages for "$:~/doc/ make html"
sudo apt -y install python3-sphinx python3-sphinxcontrib.spelling
# Packages for building and running brickv
sudo apt -y install python3-pyqt5 python3-pyqt5.qtopengl python3-opengl python3-serial python3-setuptools pyqt5-dev-tools
# Packages for building and running brickd
sudo apt -y install pkg-config libusb-1.0-0-dev libudev-dev pm-utils
# Packages for building Brick firmwares and Bricklet plugins
sudo apt -y install cmake gcc-arm-none-eabi
# Packages for hardware development (schematic, layout, case design)
sudo apt -y install kicad freecad
# Clone all necessary gits
gitgetter=$(mktemp)
cat > ${gitgetter} <<- EOF
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from urllib.request import urlopen
import json
page = 1
repos = []
names = []
while True:
request = urlopen('https://api.github.com/orgs/Tinkerforge/repos?page={0}&per_page=100'.format(page))
data = request.read()
decoded = json.loads(data)
repos += decoded
if len(decoded) < 100:
break
page += 1
for repo in repos:
name = repo['name'].replace('Tinkerforge/', '')
if not name.startswith('red-brick-'):
names.append(name)
print(' '.join(names))
EOF
chmod +x ${gitgetter}
gits=( $(${gitgetter}) )
rm ${gitgetter}
mkdir tf
cd tf
for g in "${gits[@]}"
do
git clone https://github.com/Tinkerforge/$g.git
done
# Generate Bindings and Copy examples to documentation
cd ~/tf/generators/
python3 generate_all.py
python3 copy_all.py
# Install additional pygments lexers
cd ~/tf/doc/pygments-mathematica/
sudo python3 setup.py install
cd ~/tf/doc/pygments-octave-fixed/
sudo python3 setup.py install
# Generate doc
cd ~/tf/doc/
make html
# Generate brickv GUI
cd ~/tf/brickv/src/
python3 build_all_ui.py
# Build brickd
cd ~/tf/brickd/src/
ln -s ../../daemonlib/ .
cd ~/tf/brickd/src/brickd/
make
# To show how it works we set up one Brick for use with kicad and one
# Brick as well as one Bricklet to compile with gcc.
# Build Master Brick
cd ~/tf/master-brick/software/src/
ln -s ../../../bricklib/ .
cd ~/tf/master-brick/software/
make
# Build Temperature Bricklet
cd ~/tf/temperature-bricklet/software/src/
ln -s ../../../bricklib/ .
ln -s ../../../brickletlib/ .
cd ~/tf/temperature-bricklet/software/
make
# Set up hardware design files for Master Brick
cd ~/tf/master-brick/hardware/
ln -s ../../kicad-libraries/ .
# To open schematics and layout:
# kicad ~/tf/master-brick/hardware/master.pro
# Cases can be found in ~/tf/cases and directly opend with freecad. e.g.:
# freecad ~/tf/cases/ambient_light/ambient_light.fcstd
cd ~
echo done