-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall-linux32.sh
45 lines (32 loc) · 1.77 KB
/
install-linux32.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
#!/bin/sh
# install-linux32.sh
# Michael McMahon
# Modified from https://processing.org/download/install-arm.sh
# This script installs the latest version of Processing for GNU/Linux 32bit into
# the /usr/local/lib folder.
# Run it like this: "sudo install-linux32.sh"
# This assumes that newer releases are at the top.
TAR="$(curl -sL https://api.github.com/repos/processing/processing/releases | grep -oh -m 1 'https.*linux32.tgz')"
echo "\nDownloading $TAR..."
curl -L $TAR > processing-linux32-latest.tgz
echo "Installing in /usr/local..."
tar fx processing-linux32-latest.tgz -C /usr/local/lib
rm -f processing-linux32-latest.tgz
# This returns the highest version installed.
VER="$(basename $(ls -dvr /usr/local/lib/processing-* | head -1))"
# Symlink target might be a directory, replace.
rm -rf /usr/local/lib/processing
ln -s $VER /usr/local/lib/processing
# This assumes that /usr/local/bin is in $PATH.
ln -sf ../lib/processing/processing /usr/local/bin/processing
ln -sf ../lib/processing/processing-java /usr/local/bin/processing-java
# This assumes that the desktop manager picks up .desktop files in
# the /usr/local/share/applications directory.
mkdir -p /usr/local/share/applications
curl -sL https://raw.githubusercontent.com/processing/processing/master/build/linux/processing.desktop > /usr/local/share/applications/processing.desktop
sed -i "s/@version@/$VER/" /usr/local/share/applications/processing.desktop
sed -i 's|/opt/processing|/usr/local/lib/processing|' /usr/local/share/applications/processing.desktop
# Silence validation errors.
desktop-file-install /usr/local/share/applications/processing.desktop >/dev/null 2>&1
echo "Done! You can start processing by running \"processing\" in the terminal,"
echo "or through the applications menu (might require a restart).\n"