hiulit / cross-compile-godot-raspberry-pi

A script to easily cross-compile Godot binaries for the Raspberry Pi from Linux x86_64 and an extra script to easily transfer the compiled Godot binaries to the Raspberry Pi using rsync
MIT License
27 stars 5 forks source link
cross-compile godot-engine linux raspberry-pi rsync script transfer x86-64

Cross-compile Godot binaries for the Raspberry Pi

GitHub release (latest by date) GitHub license

A script to easily cross-compile Godot binaries for the Raspberry Pi from Linux x86_64 and an extra script to easily transfer the compiled Godot binaries to the Raspberry Pi using rsync.

Cross-compile Godot binaries for the Raspberry Pi

Table of contents

Requirements:

Dependencies

Limitations

The toolchain this script uses has a few limitations at the moment:

πŸ€– Pre-compiled binaries

There's a good chance that if you came to this repository you want to compile your own Godot binaries. But if you just want to get pre-compiled binaries, I have another repository with unofficial Godot binaries for the Raspberry Pi.

πŸ› οΈ Setup

Install the scripts

git clone https://github.com/hiulit/cross-compile-godot-raspberry-pi.git
cd cross-compile-godot-raspberry-pi
sudo chmod +x cross-compile-godot-raspberry-pi.sh
sudo chmod +x transfer-files-raspberry-pi.sh

Update the scripts

cd cross-compile-godot-raspberry-pi
git pull

πŸš€ Usage

./cross-compile-godot-raspberry-pi.sh [OPTIONS]

If no options are passed, you will be prompted with a usage example:

USAGE: ./cross-compile-godot-raspberry-pi.sh [OPTIONS]

Use './cross-compile-godot-raspberry-pi.sh --help' to see all the options.

Log files are stored in logs/.

πŸ“– Options

πŸ’ Examples

./cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --rpi-versions "4" --binaries "editor" --scons-jobs "4"
./cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --godot-commits "4f891b706027dc800f6949bec413f448defdd20d" --rpi-versions "4" --binaries "editor" --scons-jobs "4"
./cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --rpi-versions "3 4" --binaries "editor" --scons-jobs "4" --use-lto
./cross-compile-godot-raspberry-pi.sh --godot-versions "3.1.2-stable 3.2.3-stable" --rpi-versions "3 4" --binaries "editor export-template" --scons-jobs "all" --use-lto
./cross-compile-godot-raspberry-pi.sh --source-dir "/path/to/the/godot/source/files" --godot-versions "3.1.2-stable 3.2.3-stable" --rpi-versions "3 4" --binaries "editor export-template" --scons-jobs "all" --use-lto

πŸ“‹ Config file

You can edit this file directly, instead of passing all the options mentioned above, and then run:

./cross-compile-godot-raspberry-pi.sh --auto
# Settings for "cross-compile-godot-raspberry-pi.sh".

# Godot source files directory.
# Default: "./godot".
godot_source_files_dir = ""

# Godot toolchain directory.
# Default: "./arm-godot-linux-gnueabihf_sdk-buildroot".
godot_toolchain_dir = ""

# Godot compiled binaries directory.
# Default: "./compiled-binaries".
godot_compiled_binaries_dir = ""

# Godot version/s to compile (separated by blank spaces).
# Use "--get-tags" to see the available versions.
# Version/s must end with the suffix "-stable", except for "master".
godot_versions = ""

# Godot commit/s to compile (separated by blank spaces).
# Commit/s: SHA-1 hash/es.
godot_commits = ""

# Raspberry Pi version/s to compile (separated by blank spaces).
# Version/s: "3 4".
raspberry_pi_versions = ""

# Types of Godot binaries to compile (separated by blank spaces).
# Binary type/s: "editor export-template headless server".
binaries = ""

# Jobs (CPUs) to use in SCons.
# Number: "1-∞".
# String: "all" (use all the available CPUs).
# Default: "1".
scons_jobs = ""

# Use Link Time Optimization (LTO) when compiling.
# Option: "yes".
use_lto = ""

# Pack all the binaries of the same Godot version and the same Raspberry Pi version.
# Option: "yes".
pack = ""

Transfer files to the Raspberry Pi

Requirements:

Dependencies

πŸš€ Usage

./transfer-files-raspberry-pi.sh [OPTIONS]

If no options are passed, you will be prompted with a usage example:

USAGE: ./transfer-files-raspberry-pi.sh [OPTIONS]

Use './transfer-files-raspberry-pi.sh --help' to see all the options.

Log files are stored in logs/.

πŸ“– Options

πŸ’ Examples

./transfer-files-raspberry-pi.sh --remote-username "pi" --remote-ip "192.168.1.100" --godot-versions "3.2.3-stable" --rpi-versions "4" --binaries "editor"
./transfer-files-raspberry-pi.sh --remote-username "pi" --remote-ip "192.168.1.100" --godot-versions "3.2.3-stable" --rpi-versions "4" --binaries "editor" --remote-dir "/path/to/the/folder/"

πŸ“‹ Config file

You can edit this file directly, instead of passing all the options mentioned above, and then run:

./transfer-files-raspberry-pi.sh --auto
# Settings for "transfer-files-raspberry-pi.sh".

# Godot compiled binaries directory.
# Default: "./compiled-binaries".
godot_compiled_binaries_dir = ""

# Raspberry Pi directory where the files will be transfered.
# Default: "~/godot-binaries/" (note the trailing slash!).
remote_dir = ""

# Username of the Raspberry Pi
remote_username = ""

# IP of the Raspberry Pi
remote_ip = ""

# Godot version/s to be transfered (separated by blank spaces).
# Version/s must end with the suffix "-stable", except for "master".
godot_versions = ""

# Godot commit/s to transfer (separated by blank spaces).
# Commit/s: SHA-1 hash/es.
godot_commits = ""

# Raspberry Pi version/s to transfer (separated by blank spaces).
# Version/s: "3 4".
raspberry_pi_versions = ""

# Types of Godot binaries to transfer (separated by blank spaces).
# Binary type/s: "editor export-template headless server".
binaries = ""

# Transfer a pack of all the binaries of the same Godot version and the same Raspberry Pi version
# instead of transferring each binary separately.
# Only use it if you previously used the "--pack" option when compiling the binaries.
# Option: "yes".
pack = "yes"

πŸ—’οΈ Changelog

See CHANGELOG.

πŸ‘€ Author

hiulit

🀝 Contributing

Feel free to:

πŸ™Œ Supporting this project

If you love this project or find it helpful, please consider supporting it through any size donations to help make it better ❀️.

Become a patron

Suppor me on Ko-Fi

Buy me a coffee

Donate Paypal

If you can't, consider sharing it with the world...

... or giving it a star ⭐️.

πŸ‘ Credits

Thanks to:

πŸ“ Licenses