Raspberry Pi builds (#30)

Instructions, plus build option for running full-screen applications (without
X11) on vanilla 32-bit Raspbian installations.

This doesn't commit the actual .so binaries, since there are at least two
possible variants (as described in the README).
This commit is contained in:
Simon 2021-06-05 12:03:40 +01:00 committed by GitHub
parent 8dfee10e60
commit 76121e34a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,26 @@
# Raspberry Pi native (non-X) build assumes the GPU libraries are installed in /opt/vc, as per Raspbian.
# Raylib must be installed the compiled with: cmake -DWITH_PIC=ON -DSHARED=ON -DSTATIC=ON -DPLATFORM='Raspberry Pi' ..
from cffi import FFI
import os
import platform
ffibuilder = FFI()
ffibuilder.cdef(open("../raylib_modified.h").read().replace('RLAPI ', ''))
ffibuilder.set_source("_raylib_cffi",
"""
#include "../raylib.h"
""",
extra_link_args=['/usr/local/lib/libraylib.a',
'/opt/vc/lib/libEGL_static.a', '/opt/vc/lib/libGLESv2_static.a',
'-L/opt/vc/lib', '-lvcos', '-lbcm_host', '-lbrcmEGL', '-lbrcmGLESv2',
'-lm', '-lpthread', '-lrt'],
)
if __name__ == "__main__":
ffibuilder.compile(verbose=True)

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
if ! command -v pyenv &> /dev/null
then
echo "Pyenv required: https://github.com/pyenv/pyenv-installer"
exit
fi
rm *arm-linux-gnueabihf.so
pyenv install -s 3.9.1
pyenv global 3.9.1
pip3 install cffi
python3 build_rpi_nox.py
pyenv install -s 3.8.7
pyenv global 3.8.7
pip3 install cffi
python3 build_rpi_nox.py
pyenv install -s 3.7.9
pyenv global 3.7.9
pip3 install cffi
python3 build_rpi_nox.py
pyenv install -s 3.6.12
pyenv global 3.6.12
pip3 install cffi
python3 build_rpi_nox.py