From 2edd3921c132dc48573bd95b95081e22ba468835 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Thu, 4 Sep 2025 23:49:16 +0200 Subject: [PATCH] python313Packages.raylib-python-cffi: 5.5.0.2 -> 5.5.0.3 --- .../raylib-python-cffi/default.nix | 27 +++----- .../raylib-python-cffi/fix_macos_raylib.patch | 11 ---- .../fix_pyray_builder.patch | 62 ------------------- .../use-direct-pkg-config-name.patch | 13 ++++ 4 files changed, 23 insertions(+), 90 deletions(-) delete mode 100644 pkgs/development/python-modules/raylib-python-cffi/fix_macos_raylib.patch delete mode 100644 pkgs/development/python-modules/raylib-python-cffi/fix_pyray_builder.patch create mode 100644 pkgs/development/python-modules/raylib-python-cffi/use-direct-pkg-config-name.patch diff --git a/pkgs/development/python-modules/raylib-python-cffi/default.nix b/pkgs/development/python-modules/raylib-python-cffi/default.nix index b4b3fb195e6c..48266a89d7c2 100644 --- a/pkgs/development/python-modules/raylib-python-cffi/default.nix +++ b/pkgs/development/python-modules/raylib-python-cffi/default.nix @@ -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; }; diff --git a/pkgs/development/python-modules/raylib-python-cffi/fix_macos_raylib.patch b/pkgs/development/python-modules/raylib-python-cffi/fix_macos_raylib.patch deleted file mode 100644 index be2f41a3720c..000000000000 --- a/pkgs/development/python-modules/raylib-python-cffi/fix_macos_raylib.patch +++ /dev/null @@ -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 = [] diff --git a/pkgs/development/python-modules/raylib-python-cffi/fix_pyray_builder.patch b/pkgs/development/python-modules/raylib-python-cffi/fix_pyray_builder.patch deleted file mode 100644 index d50cb8e5a312..000000000000 --- a/pkgs/development/python-modules/raylib-python-cffi/fix_pyray_builder.patch +++ /dev/null @@ -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) diff --git a/pkgs/development/python-modules/raylib-python-cffi/use-direct-pkg-config-name.patch b/pkgs/development/python-modules/raylib-python-cffi/use-direct-pkg-config-name.patch new file mode 100644 index 000000000000..de3c7f5c6938 --- /dev/null +++ b/pkgs/development/python-modules/raylib-python-cffi/use-direct-pkg-config-name.patch @@ -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() + +