Ubuntu documentation docker attempt perfect 4-architecture building dist_archive building Test GitHub actions Test GitHub actions Test GitHub actions Test GitHub actions Test GitHub actions Test GitHub actions Test GitHub actions properly implemented caching
6.4 KiB
Establishing a Development environment
Looking to contribute some code to Sideband? Awesome! Follow the guide below to get the repository building on your machine.
Creating folders
Sideband relies on a certain folder structure to achieve a psuedo-monorepo structure with the other Reticulum projects.
To make sure that the getrns target runs successfully, make sure your directory tree looks like this:
repositories/
├─ LXMF/
├─ LXST/
├─ rnsh/
├─ rnode-flasher/
├─ Reticulum/
├─ NomadNet/
├─ reticulum_website/
└─ Sideband/
Below are the git repositories for some of the above folders:
LXMF: https://github.com/markqvist/LXMFLXST: https://github.com/markqvist/LXSTrnsh: https://github.com/acehoss/rnshReticulum: https://github.com/markqvist/Reticulumrnode-flasher: https://github.com/liamcottle/rnode-flasherNomadNet: https://github.com/markqvist/nomadnetreticulum_website: https://github.com/markqvist/reticulum_website
Please note: in order for the docker script and
createsharemake target to work correctly, your directory must be laid out like this.
Required dependencies for development (Docker)
If you have a Fedora-based Linux system (see Addendum: Fedora) or simply would not like to install all of P4A's dependencies manually, you may choose to use the containerized build.
This method requires that you have Docker installed on your system: https://docs.docker.com/engine/install/
Additionally, rootless Docker should be used to minimize any possible attack surface on your system. Never run a script you haven't vetted with sudo! The ./dmake.sh script uses set -ex and is designed to be used with rootless docker.
After configuring docker, you can replace any use of the make command with dmake (i.e. ./dmake devapk) to run make commands in the container, building it on demand if needed.
Example:
./dmake devapk
(or if running in sbapp, it is smart enough to run itself in Sideband regardless of where it is called from)
../dmake devapk
Required dependencies for development (Native)
Until this repository has a flake.nix added, you will need to manually download the following dependencies using your Operating System's package manager.
makeadb(available as a part of theandroid-toolspackage on Fedora,adbon Debian/Ubuntu,android-platform-toolson Brew Casks)python3/python3-dev(el)(must be available aspython, on Ubuntu tryapt install python-is-python3)patchelfpatchperlportaudio19-devlibopus-devlibogg-devbuildozer(see https://buildozer.readthedocs.io/en/latest/installation.html)- buildozer's PyPI hosted version is very far behind, therefore you should install from source at https://github.com/kivy/buildozer.git; this is easy with pipx
pipx install git+https://github.com/kivy/buildozer.git. - buildozer needs
wheelto run, but it is not currently marked as a dependency. If you are using pipx, you will need to inject it withpipx inject buildozer wheel.
- buildozer's PyPI hosted version is very far behind, therefore you should install from source at https://github.com/kivy/buildozer.git; this is easy with pipx
- all of buildozer's Android dependencies
- Ubuntu 22.04 LTS packages
git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev - Ubuntu 24.04 LTS packages
git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses-dev libtinfo6 cmake libffi-dev libssl-dev - Fedora 41
git zip unzip java-17-openjdk java-17-openjdk-devel python3-pip autoconf libtool pkgconf-pkg-config ghc-zlib-devel ncurses-devel ncurses-compat-libs cmake libffi-devel openssl-devel
- Ubuntu 22.04 LTS packages
In the root directory of the repository, use pip install . to install the package from setup.py. The use of a venv is strongly recommended.
Make sure you manually install Cython<3.0 into your Python install or venv, as buildozer will need it for Android.
Addendum: Fedora
As many users of Kivy have noted before, some of Python4Android's recipes do not compile correctly on Fedora/RHEL. For this project, one package of interest is freetype-py and its native dependency, which is a direct dependency of pillow, the ubiquitous Python image editing library.
This is due to the fact that Fedora and several other distros include default versions of toolchains, which prompts python4android to abstain from downloading its own. This issue has been encountered by many other users.
If you can't use Docker, use of Ubuntu 24.04 LTS is therefore recommended for developing this project. Ubuntu 22.04 LTS is not supported, as its cmake version (even with backports) is below the minimum 3.24.
Sideband does run fine on Fedora, however.
Compiling and testing Sideband on an Android device
With a correctly configured environment, run the following command to create a development APK.
make devapk
You can then install it to a connected device with
make devinstall
If you would like your release to be signed for release, you must configure the following four environment variables:
P4A_RELEASE_KEYALIASP4A_RELEASE_KEYSTORE_PASSWDP4A_RELEASE_KEYSTOREP4A_RELEASE_KEYALIAS_PASSWD
With ./dmake, omitting any of these values will cause it to default to the debug.keystore generated with each install of the Android SDK.
After it is configured correctly, you may build it with
make apk
and install it to a connected device with
make install
The output will be placed in ./sbapp/bin/sideband-*.apk.
If you have multiple devices connected at once (for example, while developing the BLE interface between devices), you may use devinstall-multi or install-multi in place of devinstall and install respectively.
If using an Android that provides the ability to toggle DCL via storage (like GrapheneOS), make sure to enable it for Sideband, as it must load its Cython executables.
Compiling and testing Sideband for other platforms
For Windows, use the following command: (make sure you have PyInstaller in your venv, and you are on Windows, as PyInstaller removed cross-compilation)
make build_win_exe
Wheels for other platforms can be built with
make build_wheel