Skip to content

Commit 3bcd3c7

Browse files
committed
add arch linux install script example
1 parent 6c6da48 commit 3bcd3c7

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

INSTALLATION.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ chmod +x pygpsclient_debian_install.sh
231231
./pygpsclient_debian_install.sh
232232
```
233233
234+
### Arch Linux
235+
An example [installation shell script](https://github.com/semuconsulting/PyGPSClient/blob/master/examples/pygpsclient_arch_install.sh) is available for use on most vanilla 64-bit Arch-based environments with Python>=3.10. To run this installation script, download it to your Arch-based workstation and - from the download folder - type:
236+
237+
```shell
238+
chmod +x pygpsclient_arch_install.sh
239+
./pygpsclient_arch_install.sh
240+
```
241+
234242
### MacOS
235243
A similar [installation shell script](https://github.com/semuconsulting/PyGPSClient/blob/master/examples/pygpsclient_macos_install.sh) is available for MacOS 13 or later running a ZSH shell (*Homebrew or MacPorts are **NOT** required*). This will also install the latest official version of Python 3 with tkinter 8.6. Download the script to your Mac and - from the download folder - type:
236244
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
# Bash shell script to install PyGPSClient on 64-bit Arch-based
4+
# Linux environments.
5+
#
6+
# Change shebang /bin/bash to /bin/zsh if running from zsh shell.
7+
# NB: NOT for use on Windows or MacOS!
8+
#
9+
# Remember to run chmod +x pygpsclient_arch_install.sh to make this script executable.
10+
#
11+
# Full installation instructions:
12+
# https://github.com/semuconsulting/PyGPSClient
13+
#
14+
# Created by semuadmin on 20 Sep 2023.
15+
#
16+
# exit on error
17+
set -e
18+
19+
PYVER="$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
20+
21+
echo "Installed Python version is $PYVER"
22+
23+
echo "PyGPSClient will be installed at $HOME/pygpsclient/bin"
24+
25+
echo "Installing dependencies..."
26+
sudo pacman -S tk libspatialite
27+
28+
echo "Setting user permissions..."
29+
sudo usermod -aG uucp $USER
30+
31+
echo "Creating virtual environment..."
32+
cd $HOME
33+
python3 -m venv pygpsclient
34+
source pygpsclient/bin/activate
35+
python3 -m pip install --upgrade pip pygpsclient rasterio
36+
deactivate
37+
38+
echo "Adding desktop launch icon..."
39+
# the LD_LIBRARY_PATH env setting allows PyGPSClient to find the
40+
# mod_spatialite.so module, which is typically installed in this location
41+
# you can set other env variables in a similar fashion if required
42+
mkdir -p $HOME/.local/share/applications
43+
cat > $HOME/.local/share/applications/pygpsclient.desktop <<EOF
44+
[Desktop Entry]
45+
Type=Application
46+
Terminal=false
47+
Name=PyGPSClient
48+
Icon=$HOME/pygpsclient/lib/python$PYVER/site-packages/pygpsclient/resources/pygpsclient.ico
49+
Exec=env LD_LIBRARY_PATH=/usr/local/lib $HOME/pygpsclient/bin/pygpsclient
50+
EOF
51+
52+
echo "Adding directory to PATH..."
53+
BASHPROF1=$HOME/.profile
54+
BASHPROF2=$HOME/.bashrc
55+
ZSHPROF1=$HOME/.zprofile
56+
ZSHPROF2=$HOME/.zshrc
57+
if test -f $BASHPROF1
58+
then
59+
PROF=$BASHPROF1
60+
elif test -f $BASHPROF2
61+
then
62+
PROF=$BASHPROF2
63+
fi
64+
if test -f $ZSHPROF1
65+
then
66+
PROF=$ZSHPROF1
67+
elif test -f $ZSHPROF2
68+
then
69+
PROF=$ZSHPROF2
70+
fi
71+
sed -i '$a# Path to PyGPSClient executable\nexport PATH="${HOME}/pygpsclient/bin:${PATH}"' $PROF
72+
source $PROF # this will throw an error if running as bash script in zsh shell
73+
74+
echo "Installation complete"

0 commit comments

Comments
 (0)