Building from source ==================== Have Pip build from source -------------------------- Useful if the binaries don’t work on your system. Make sure Raylib is installed and then: :: pip3 install --no-binary raylib --upgrade --force-reinstall raylib Build from source manually -------------------------- Useful if the Pip build doesn’t work and you want to debug it, or you want to contribute to the project. .. attention:: If the Pip build doesn’t work, please submit a bug. (And if you have fixed it, a PR.) Manual instructions follow, but see also how we actually build the wheels at https://github.com/electronstudio/raylib-python-cffi/blob/master/.github/workflows/build.yml Windows manual build ~~~~~~~~~~~~~~~~~~~~ Clone this repo including submodules so you get correct version of Raylib. :: git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi Open Visual C++ command shell. Fix the symlink that doesnt work on Windows :: cd raylib-python-cffi copy raylib-c\src\raylib.h raylib\raylib.h Build and install Raylib from the raylib-c directory. :: cd raylib-python-cffi/raylib-c mkdir build cd build cmake -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. msbuild raylib.sln /target:raylib /property:Configuration=Release copy raylib\Release\raylib.lib ..\.. cd ..\.. To update the dynamic libs, download the official release, e.g. https://github.com/raysan5/raylib/releases/download/3.7.0/raylib-3.7.0_win64_msvc16.zip and extract ``raylib.dll`` into ``dynamic/raylib``. To build a binary wheel distribution: :: rmdir /Q /S build pip3 install cffi pip3 install wheel python setup.py bdist_wheel Alternatively, if you don’t want the static binaries and just want to use DLLs with raylib.dynamic: :: python3 setup_dynamic.py bdist_wheel Then install it: :: pip3 install dist\raylib-3.7.0-cp37-cp37m-win_amd64.whl (Note: your wheel’s filename will probably be different than the one here.) Linux manual build ~~~~~~~~~~~~~~~~~~~~~~ These instructions have been tested on Ubuntu 20.10 and 16.04. Clone this repo including submodules so you get correct version of Raylib. :: git clone --recurse-submodules https://github.com/electronstudio/raylib-python-cffi Build and install Raylib from the raylib-c directory. :: sudo apt install cmake 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 .. note:: 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 .. make sudo make install :: cd ../.. .. note:: 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 `__ for a Raspberry Pi wheel)