Skip to content

Dev: Building on Raspberry Pi OS

Bennett Wendorf edited this page Jul 4, 2022 · 7 revisions

Install all runtime dependencies

sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev libgl1-mesa-dev libjpeg-dev python-dev python3-dev

Install additional pyenv deps that are needed to run a proper build

sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Ensure pip is up to date

python -m pip install --upgrade pip 

Install pyenv

curl https://pyenv.run | bash

Follow any instructions provided by pyenv to finish setup. Restart your shell with exec $SHELL

Install the newest version of pipenv

Note: You can skip this step if pipenv is already the newest version

Remove pipenv if it is installed through your package manager and is not the newest version.

pip install pipenv

Ensure that ~/.local/bin is a part of your PATH

Note: If ~/.local/bin is already part of your PATH, this step can be skipped

If not, make sure to add it. This is distro-dependent, but on Raspberry Pi OS, you can add the following to your ~/.bashrc

export "$HOME/.local/bin:$PATH"

Clone the repo

git clone https://github.com/Bennett-Wendorf/deskity.git

Install the correct version of python

While the pipenv program will run pyenv for you, I've found that it doesn't always work better and is generally easier to do ahead of time.

Note: On Debian-based distros at least, run the following command instead to ensure that running pyinstaller will work:

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install <version specified in Pipfile>

If you know shared libs are not needed:

pyenv install <version specified in Pipfile>

Install application dependencies and dev dependencies in a virtual environment

cd ~/deskity
pipenv install -d

Run pyinstaller to create the build

Pick out which spec file you want from the specs directory

pyinstaller specs/<Selected spec file>