fix linux/pi building

This commit is contained in:
richard 2021-06-16 06:42:23 +01:00
parent 1548a40ede
commit 9bf7544ad9
2 changed files with 11 additions and 3 deletions

View file

@ -76,18 +76,26 @@ and install it:
Build and install Raylib from the raylib-c directory.
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
cd raylib-python-cffi/raylib-c
mkdir build
cd build
cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
Optional: Build the Raylib shared libs, if you plan to use `raylib.dynamic` binding.
rm -rf *
cmake -DWITH_PIC=on -DBUILD_SHARED_LIBS=on -DCMAKE_BUILD_TYPE=Release ..
sudo make install
Make a patched version of raylib header. (Not necessary if you've already got raylib_modifed.h from repo and haven't changed anything.)
Optional: Make a patched version of raylib header. (Not necessary if you've already got raylib_modifed.h from repo and haven't changed anything.)
cd ../../raylib
cp raylib.h raylib_modified.h
patch -p0 <raylib_modified.h.patch
Build
pip3 install cffi

View file

@ -39,7 +39,7 @@ def build_mac():
ffibuilder.cdef(open("raylib/raylib_modified.h").read().replace('RLAPI ', ''))
ffibuilder.set_source("raylib.static._raylib_cffi",
"""
#include "./../raylib/raylib.h" // the C header of the library, supplied by us here
#include "../../raylib/raylib.h" // the C header of the library, supplied by us here
"""
)
# Hack to produce static linked lib using static librarylib.a supplied by us
@ -59,7 +59,7 @@ def build_rpi_nox():
ffibuilder.cdef(open("raylib/raylib_modified.h").read().replace('RLAPI ', ''))
ffibuilder.set_source("raylib.static._raylib_cffi",
"""
#include "./../raylib/raylib.h"
#include "../../raylib/raylib.h"
""",
extra_link_args=['/usr/local/lib/libraylib.a',
'/opt/vc/lib/libEGL_static.a', '/opt/vc/lib/libGLESv2_static.a',