Skip to content

Commit 0e2a595

Browse files
committed
Merge pull request #2857 from blender/fix/install-raspbian
Fix/install raspbian
1 parent eeca7b6 commit 0e2a595

File tree

1 file changed

+52
-30
lines changed

1 file changed

+52
-30
lines changed

etc/scripts/get-stack.sh

100755100644
Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ post_install_separator() {
5151
info ""
5252
}
5353

54+
# determines the the CPU's instruction set
55+
get_isa() {
56+
if arch | grep -q arm ; then
57+
echo arm
58+
else
59+
echo x86
60+
fi
61+
}
62+
63+
# exits with code 0 if arm ISA is detected as described above
64+
is_arm() {
65+
test "$(get_isa)" = arm
66+
}
67+
68+
5469
# determines 64- or 32-bit architecture
5570
# if getconf is available, it will return the arch of the OS, as desired
5671
# if not, it will use uname to get the arch of the CPU, though the installed
@@ -79,6 +94,19 @@ is_64_bit() {
7994
test "$(get_arch)" = 64
8095
}
8196

97+
# prints a generic bindist notice
98+
print_bindist_notice() {
99+
if [ -z "$1" ] ; then
100+
info ""
101+
info "Using generic bindist..."
102+
info ""
103+
else
104+
info ""
105+
info "Using generic $1 bindist..."
106+
info ""
107+
fi
108+
}
109+
82110
# Adds a `sudo` prefix if sudo is available to execute the given command
83111
# If not, the given command is run as is
84112
sudocmd() {
@@ -105,15 +133,11 @@ do_ubuntu_install() {
105133

106134
if is_64_bit ; then
107135
install_dependencies
108-
info ""
109-
info "Using generic bindist..."
110-
info ""
136+
print_bindist_notice
111137
install_64bit_static_binary
112138
else
113139
install_dependencies
114-
info ""
115-
info "Using generic bindist..."
116-
info ""
140+
print_bindist_notice
117141
install_32bit_standard_binary
118142
fi
119143

@@ -124,21 +148,22 @@ do_ubuntu_install() {
124148
# If the version of Debian is unsupported, it attempts to copy the binary
125149
# and install the necessary dependencies explicitly.
126150
do_debian_install() {
151+
127152
install_dependencies() {
128153
apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev
129154
}
130155

131-
if is_64_bit ; then
156+
if is_arm ; then
132157
install_dependencies
133-
info ""
134-
info "Using generic bindist..."
135-
info ""
158+
print_bindist_notice
159+
install_arm_binary
160+
elif is_64_bit ; then
161+
install_dependencies
162+
print_bindist_notice
136163
install_64bit_static_binary
137164
else
138165
install_dependencies
139-
info ""
140-
info "Using generic bindist..."
141-
info ""
166+
print_bindist_notice
142167
install_32bit_standard_binary
143168
fi
144169
}
@@ -154,15 +179,11 @@ do_fedora_install() {
154179

155180
if is_64_bit ; then
156181
install_dependencies "$1"
157-
info ""
158-
info "Using generic bindist..."
159-
info ""
182+
print_bindist_notice
160183
install_64bit_static_binary
161184
else
162185
install_dependencies "$1"
163-
info ""
164-
info "Using generic bindist..."
165-
info ""
186+
print_bindist_notice
166187
install_32bit_standard_binary
167188
fi
168189
}
@@ -178,23 +199,17 @@ do_centos_install() {
178199

179200
if is_64_bit ; then
180201
install_dependencies
181-
info ""
182-
info "Using generic bindist..."
183-
info ""
202+
print_bindist_notice
184203
install_64bit_static_binary
185204
else
186205
install_dependencies
187206
case "$1" in
188207
"6")
189-
info ""
190-
info "Using genergic libgmp4 bindist..."
191-
info ""
208+
print_bindist_notice "libgmp4"
192209
install_32bit_gmp4_linked_binary
193210
;;
194211
*)
195-
info ""
196-
info "Using generic bindist..."
197-
info ""
212+
print_bindist_notice
198213
install_32bit_standard_binary
199214
;;
200215
esac
@@ -246,7 +261,10 @@ do_sloppy_install() {
246261
info "This installer doesn't support your Linux distribution, trying generic"
247262
info "bindist..."
248263
info ""
249-
if is_64_bit ; then
264+
265+
if is_arm ; then
266+
install_arm_binary
267+
elif is_64_bit ; then
250268
install_64bit_static_binary
251269
else
252270
install_32bit_standard_binary
@@ -358,7 +376,7 @@ GETDISTRO
358376
ubuntu)
359377
do_ubuntu_install "$VERSION"
360378
;;
361-
debian|kali)
379+
debian|kali|raspbian)
362380
do_debian_install "$VERSION"
363381
;;
364382
fedora)
@@ -434,6 +452,10 @@ install_from_bindist() {
434452
check_usr_local_bin_on_path
435453
}
436454

455+
install_arm_binary() {
456+
install_from_bindist "linux-arm"
457+
}
458+
437459
install_32bit_standard_binary() {
438460
install_from_bindist "linux-i386"
439461
}

0 commit comments

Comments
 (0)