mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
62 lines
2.6 KiB
Diff
62 lines
2.6 KiB
Diff
diff --git a/raylib/build.py b/raylib/build.py
|
|
index 81fa11a..943c34e 100644
|
|
--- a/raylib/build.py
|
|
+++ b/raylib/build.py
|
|
@@ -33,8 +33,8 @@ def check_raylib_installed():
|
|
def check_SDL_installed():
|
|
return subprocess.run(['pkg-config', '--exists', 'sdl2'], text=True, stdout=subprocess.PIPE).returncode == 0
|
|
|
|
-def get_the_include_path():
|
|
- return subprocess.run(['pkg-config', '--variable=includedir', 'raylib'], text=True,
|
|
+def get_the_include_path(libname):
|
|
+ return subprocess.run(['pkg-config', '--variable=includedir', libname], text=True,
|
|
stdout=subprocess.PIPE).stdout.strip()
|
|
|
|
|
|
@@ -110,9 +110,9 @@ def build_unix():
|
|
if RAYLIB_PLATFORM=="SDL" and not check_SDL_installed():
|
|
raise Exception("ERROR: SDL2 not found by pkg-config. Please install pkg-config and SDL2.")
|
|
|
|
- raylib_h = get_the_include_path() + "/raylib.h"
|
|
- rlgl_h = get_the_include_path() + "/rlgl.h"
|
|
- raymath_h = get_the_include_path() + "/raymath.h"
|
|
+ raylib_h = get_the_include_path("raylib") + "/raylib.h"
|
|
+ rlgl_h = get_the_include_path("raylib") + "/rlgl.h"
|
|
+ raymath_h = get_the_include_path("raylib") + "/raymath.h"
|
|
|
|
if not os.path.isfile(raylib_h):
|
|
raise Exception("ERROR: " + raylib_h + " not found. Please install Raylib.")
|
|
@@ -129,13 +129,13 @@ def build_unix():
|
|
#include "raymath.h"
|
|
"""
|
|
|
|
- glfw3_h = get_the_include_path() + "/GLFW/glfw3.h"
|
|
+ glfw3_h = get_the_include_path("glfw3") + "/GLFW/glfw3.h"
|
|
if RAYLIB_PLATFORM=="Desktop" and check_header_exists(glfw3_h):
|
|
ffi_includes += """
|
|
#include "GLFW/glfw3.h"
|
|
"""
|
|
|
|
- raygui_h = get_the_include_path() + "/raygui.h"
|
|
+ raygui_h = get_the_include_path("raygui") + "/raygui.h"
|
|
if check_header_exists(raygui_h):
|
|
ffi_includes += """
|
|
#define RAYGUI_IMPLEMENTATION
|
|
@@ -143,7 +143,7 @@ def build_unix():
|
|
#include "raygui.h"
|
|
"""
|
|
|
|
- physac_h = get_the_include_path() + "/physac.h"
|
|
+ physac_h = get_the_include_path("physac") + "/physac.h"
|
|
if check_header_exists(physac_h):
|
|
ffi_includes += """
|
|
#define PHYSAC_IMPLEMENTATION
|
|
@@ -192,7 +192,7 @@ def build_unix():
|
|
ffibuilder.set_source("raylib._raylib_cffi",
|
|
ffi_includes,
|
|
py_limited_api=False,
|
|
- include_dirs=[get_the_include_path()],
|
|
+ include_dirs=[get_the_include_path("libffi")],
|
|
extra_link_args=extra_link_args,
|
|
extra_compile_args=extra_compile_args,
|
|
libraries=libraries)
|