Subject: [bug#76881] Adding a new phase to provide raylib_api files

From: [email-masked]
Date: Sun, 9 Mar 2025 20:45:19 +0100 (CET)

Hi iyzsong and guix team,

I'm sorry to intervene. I had also planned to update Raylib to 5.5 today. What a coincidence!

Would you consider adding a new phase to this package to provide additional raylib_api files ?
My proposal is attached for your reference.

This would make it possible to create bindings for other languages. By the way, I proposed this
 patch last year https://issues.guix.gnu.org/74059  to bring Raylib support to guile.

Regards, Arnaud.
From d058c5e8b9f0db4b0d2a0613866aa99dddab3dc8 Mon Sep 17 00:00:00 2001
Message-ID: <d058c5e8b9f[email-masked]>
From: Arnaud Lechevallier <[email-masked]>
Date: Sun, 9 Mar 2025 19:03:51 +0100
Subject: [PATCH] gnu: raylib: Update to 5.5 and use glfw-3.4

* gnu/packages/game-development.scm: (raylib): Update to 5.5.
[inputs]: Replace glfw with glfw-3.4.
[phases] {install-parser}: New phase. Install additional raylib_api files.

Change-Id: I4fb6b453abb48c7fbea18f187fdd9ce91c9c31fa
---
 gnu/packages/game-development.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index a026e114c4..e8cbb8a3f6 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2022-2023, 2025 Adam Faiz <[email-masked]>
 ;;; Copyright © 2024 Nicolas Graves <[email-masked]>
 ;;; Copyright © 2024 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2025 Arnaud Lechevallier <[email-masked]>
 ;;; Copyright © 2025 Sharlatan Hellseher <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -3710,6 +3711,32 @@ (define-public raylib
     (home-page "https://www.raylib.com/")
     (license license:zlib)))

+(define-public raylib-5.5
+  (package
+    (inherit raylib)
+    (name "raylib")
+    (version "5.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/raysan5/raylib/")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1dhy9ghbwvz0s434j03rfa2l6wxcfj028vlkk1xbf5q97vin5pr7"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments raylib)
+       ((#:phases current-phases)
+        #~(modify-phases #$current-phases
+            (add-after 'install 'install-parser
+              (lambda _
+                (copy-recursively (string-append #$source "/parser/output")
+                                  (string-append #$output "/parser/output"))))))))
+    (inputs
+     (modify-inputs (package-inputs raylib)
+       (replace "glfw" glfw-3.4)))))
+
 (define-public bbcsdl
   (package
     (name "bbcsdl")

base-commit: be08c1d70d7d0e396b7fa8ac48d444517b25e33f
--
2.48.1