From c1e3fa2eca79f749e8f5986b487a4e7a6c55cf16 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 5 May 2025 17:54:45 +0100 Subject: [PATCH] add libffi include path for nixos --- raylib/build.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raylib/build.py b/raylib/build.py index a327d6f..9e46dac 100644 --- a/raylib/build.py +++ b/raylib/build.py @@ -36,6 +36,8 @@ import time # e.g.: /usr/local/include/GLFW # PHYSAC_INCLUDE_PATH: Directory to find physac.h # e.g.: /usr/local/include +# LIBFFI_INCLUDE_PATH: +# e.g.: /usr/local/include RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop") @@ -176,6 +178,10 @@ def build_unix(): #include "physac.h" """ + libffi_include_path = os.getenv("LIBFFI_INCLUDE_PATH") + if libffi_include_path is None: + libffi_include_path = get_the_include_path_from_pkgconfig() + ffibuilder.cdef(pre_process_header(raylib_h)) ffibuilder.cdef(pre_process_header(rlgl_h)) ffibuilder.cdef(pre_process_header(raymath_h, True)) @@ -228,7 +234,8 @@ def build_unix(): ffibuilder.set_source("raylib._raylib_cffi", ffi_includes, py_limited_api=False, - include_dirs=[get_the_include_path_from_pkgconfig()], + include_dirs=[raylib_include_path, raygui_include_path, physac_include_path, glfw_include_path, + libffi_include_path], extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, libraries=libraries)