From c26da5407abf442677231761651123ad493b9021 Mon Sep 17 00:00:00 2001 From: Adam Griffiths Date: Tue, 22 Jun 2021 22:03:05 +1000 Subject: [PATCH] Support searching for the raylib library on multiple paths. (#34) Add a new environment variable "USE_EXTERNAL_RAYLIB" which will alter the load behaviour to not include a directory prefix. This lets us fallback onto the system library loading mechanism. Remove specific raylib library filenames. This ability is important for operating systems like Nix. --- README.md | 12 ++++---- raylib/dynamic/__init__.py | 56 +++++++++++++++++++++----------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index cc85fb5..0a9d47e 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ If yours isn't available then pip will attempt to build from source, so you will See here for a Raspberry Pi build: https://github.com/electronstudio/raylib-python-cffi/issues/31#issuecomment-862078330 +If your system already has the Raylib library installed, you can set the environment variable 'USE_EXTERNAL_RAYLIB' and it will +be used instead. + ## Option 2: Build from source If you're using a platform we don't have binary builds for yet @@ -61,7 +64,7 @@ Build and install Raylib from the raylib-c directory. 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 `raylib/dynamic`. Delete the files for other platforms, unless you want them in your distribution. +into `raylib/dynamic`. Delete the files for other platforms, unless you want them in your distribution. To build a binary wheel distribution: @@ -73,7 +76,7 @@ To build a binary wheel distribution: and 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 etc @@ -100,13 +103,13 @@ Optional: Make a patched version of raylib header. (Not necessary if you've alr patch -p0