python313Packages.raylib-python-cffi: 5.5.0.2 -> 5.5.0.3 (#440256)

This commit is contained in:
Masum Reza
2025-09-11 06:02:41 +00:00
committed by GitHub
4 changed files with 23 additions and 90 deletions
@@ -5,7 +5,7 @@
setuptools,
cffi,
pkg-config,
glfw,
glfw3,
libffi,
raylib,
physac,
@@ -17,26 +17,27 @@
buildPythonPackage rec {
pname = "raylib-python-cffi";
version = "5.5.0.2";
version = "5.5.0.3";
pyproject = true;
src = fetchFromGitHub {
owner = "electronstudio";
repo = "raylib-python-cffi";
tag = "v${version}";
hash = "sha256-Ls+9+iByGQJQJdJiW4WOmKPGbrWJDisXZ1ZYqvAj+3o=";
hash = "sha256-VsdUOk26xXEwha7kGYHy4Cgwrr3yOiSlJg4nYn+ZYYs=";
};
build-system = [ setuptools ];
dependencies = [ cffi ];
patches = [
# This patch fixes to the builder script function to call pkg-config
# using the library name rather than searching only through raylib
./fix_pyray_builder.patch
patches = [ ./use-direct-pkg-config-name.patch ];
# use get_lib_flags() instead of linking to libraylib.a directly
./fix_macos_raylib.patch
buildInputs = [
glfw3
libffi
raylib
physac
raygui
];
nativeBuildInputs = [
@@ -49,14 +50,6 @@ buildPythonPackage rec {
pythonImportsCheck = [ "pyray" ];
buildInputs = [
glfw
libffi
raylib
physac
raygui
];
passthru.tests = import ./passthru-tests.nix {
inherit src raylib-python-cffi writers;
};
@@ -1,11 +0,0 @@
--- a/raylib/build.py
+++ b/raylib/build.py
@@ -158,7 +158,7 @@ def build_unix():
if platform.system() == "Darwin":
print("BUILDING FOR MAC")
- extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa',
+ extra_link_args = get_lib_flags() + ['-framework', 'OpenGL', '-framework', 'Cocoa',
'-framework', 'IOKit', '-framework', 'CoreFoundation', '-framework',
'CoreVideo']
libraries = []
@@ -1,62 +0,0 @@
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)
@@ -0,0 +1,13 @@
diff --git a/raylib/build.py b/raylib/build.py
index d6d0823..af2b274 100644
--- a/raylib/build.py
+++ b/raylib/build.py
@@ -68,7 +68,7 @@ def check_sdl_pkgconfig_installed():
def get_the_include_path_from_pkgconfig(libname):
return subprocess.run(
- ['pkg-config', '--variable=includedir', os.environ.get("PKG_CONFIG_LIB_" + libname, 'raylib')], text=True,
+ ['pkg-config', '--variable=includedir', libname], text=True,
stdout=subprocess.PIPE).stdout.strip()