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.
curl
git
jq
tar
wget
zip
The toolchain this script uses has a few limitations at the moment:
32 bit
binaries and Raspberry Pi verions 3
and 4
.2.x
because it requires gcc < 6
and the toolchain only has gcc 10.2
.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.
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
cd cross-compile-godot-raspberry-pi
git pull
./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/
.
--help
: Prints the help message.--version
: Prints the script version.--get-tags
: Prints the Godot tags from GitHub available to compile.--get-jobs
: Prints the number of available jobs/CPUs.--download [file] [path]
: Downloads the Godot source files or the Godot toolchain.
godot-source-files
or godot-toolchain
.--source-dir [path]
: Sets the Godot source files directory.
./godot
.--toolchain-dir [path]
: Sets the Godot toolchain directory.
./arm-godot-linux-gnueabihf_sdk-buildroot
.--binaries-dir [path]
: Sets the Godot compiled binaries directory.
./compiled-binaries
.--godot-versions [version/s]
: Sets the Godot version/s to compile.
--get-tags
to see the available versions.--godot-commits [commit/s]
: Sets the Godot commit/s to compile.
--rpi-versions [version/s]
: Sets the Raspberry Pi version/s to compile.
3 4
.--binaries [binary type/s]
: Sets the different types of Godot binaries to compile.
editor export-template headless server
.--scons-jobs [number|string]
: Sets the jobs (CPUs) to use in SCons.
1-β
.all
(use all the available CPUs).1
.--use-lto
: Enables using Link Time Optimization (LTO) when compiling.--pack
: Packs all the binaries of the same Godot version and the same Raspberry Pi version.--auto
: Starts compiling taking the settings in the config file.editor
(version 3.2.3-stable
).4
.4
CPU cores../cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --rpi-versions "4" --binaries "editor" --scons-jobs "4"
editor
(version 3.2.3-stable
) and the 4f891b706027dc800f6949bec413f448defdd20d
commit (which is 3.2.4 RC 3
).4
.4
CPU cores../cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --godot-commits "4f891b706027dc800f6949bec413f448defdd20d" --rpi-versions "4" --binaries "editor" --scons-jobs "4"
editor
(version 3.2.3-stable
).3
and 4
.8
CPU cores.LTO enabled
../cross-compile-godot-raspberry-pi.sh --godot-versions "3.2.3-stable" --rpi-versions "3 4" --binaries "editor" --scons-jobs "4" --use-lto
editor
and the export templates
(versions 3.1.2-stable
and 3.2.3-stable
).3
and 4
.all
the available CPU cores.enabled
../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
editor
and the export templates
(versions 3.1.2-stable
and 3.2.3-stable
).3
and 4
.all
the available CPU cores.LTO enabled
./path/to/the/godot/source/files
../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
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 = ""
rsync
./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/
.
--help
: Prints the help message.--version
: Prints the script version.--binaries-dir [path]
: Sets the Godot compiled binaries directory.
./compiled-binaries
.--remote-dir [path]
: Sets the Raspberry Pi directory where the files will be transfered.
~/godot-binaries/
(note the trailing slash!).--remote-username [username]
: Sets the username of the Raspberry Pi.--remote-ip [IP]
: Sets the IP of the Raspberry Pi.--godot-versions [version/s]
: Sets the Godot version/s to compile.
-stable
, except for master
..--godot-commits [commit/s]
: Sets the Godot commit/s to compile.
--rpi-versions [version/s]
: Sets the Raspberry Pi version/s to compile.
3 4
.--binaries [binary type/s]
: Sets the different types of Godot binaries to compile.
editor export-template headless server
.--auto
: Starts transferring taking the settings in the config file.editor
(version 3.2.3-stable
).4
.pi
and the IP 192.168.1.100
../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"
editor
(version 3.2.3-stable
).4
.pi
and the IP 192.168.1.100
./path/to/the/folder/
(note the trailing slash!)../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/"
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"
See CHANGELOG.
hiulit
Feel free to:
If you love this project or find it helpful, please consider supporting it through any size donations to help make it better β€οΈ.
If you can't, consider sharing it with the world...
... or giving it a star βοΈ.
Thanks to: