Subject: [PATCH 1/3] gnu: glad: Update to 2.0.4.

From: Zheng Junjie <[email-masked]>
Date: Thu, 14 Dec 2023 00:57:36 +0800

* gnu/packages/gl.scm (glad): Update to 2.0.4.
[inputs]: Add python-jinja2.
[arguments]<#:phases>: Adjust install-cmakelists.txt phase.
(glad-0.1): Inherit above.
gnu/packages/electronics.scm (openboardview)
[native-inputs]: Use glad-0.1 replace glad.

Change-Id: I516d44dfc9272702c3ac31773df0b6c2d68ed99c
---
 gnu/packages/electronics.scm |  3 ++-
 gnu/packages/gl.scm          | 50 +++++++++++++++++++++++++++---------
 2 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm
index 7d0e58aeae..13f370c285 100644
--- a/gnu/packages/electronics.scm
+++ b/gnu/packages/electronics.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2021 Leo Famulari <[email-masked]>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2023 Zheng Junjie <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -310,7 +311,7 @@ (define-public openboardview
     (native-inputs
      (list pkg-config
            python
-           glad
+           glad-0.1
            stb-image
            utf8-h))
     (inputs
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index c02a6f0a84..62e8efbb98 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2021, 2022, 2023 John Kehayias <[email-masked]>
 ;;; Copyright © 2022 Petr Hodina <[email-masked]>
 ;;; Copyright © 2023 Kaelyn Takata <[email-masked]>
+;;; Copyright © 2023 Zheng Junjie <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -192,12 +193,9 @@ (define-public ftgl
 (define-public glad
   (package
     (name "glad")
-    (version "0.1.36")
+    (version "2.0.4")
     (source
      (origin
-       ;; We fetch the sources from the repository since the PyPI archive
-       ;; doesn't contain the CMakeLists.txt file which is useful for
-       ;; integration with other software, such as the openboardview package.
        (method git-fetch)
        (uri (git-reference
              (url "https://github.com/Dav1dde/glad")
@@ -205,22 +203,50 @@ (define-public glad
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0m55ya1zrmg6n2cljkajy80ilmi5sblln8742fm0k1sw9k7hzn8n"))))
+         "1pam6imhcmcyqrqi6wzzxprb23y8x6zdbvsjavnz26k72i9dbbja"))))
     (build-system python-build-system)
+    (inputs (list python-jinja2))
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'install-cmakelists.txt
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (share (string-append out "/share/" ,name)))
-               (install-file "CMakeLists.txt" share)))))))
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install 'install-cmakelists.txt
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (share (string-append out "/share/" #$name)))
+                     (install-file "cmake/CMakeLists.txt" share)))))))
     (home-page "https://github.com/Dav1dde/glad")
     (synopsis "Multi-language GL/GLES/EGL/GLX/WGL loader generator")
     (description "Glad uses the official Khronos XML specifications to
 generate a GL/GLES/EGL/GLX/WGL loader tailored for specific requirements.")
     (license license:expat)))
 
+(define-public glad-0.1
+  (package
+    (inherit glad)
+    (name "glad")
+    (version "0.1.36")
+    (source
+     (origin
+       ;; We fetch the sources from the repository since the PyPI archive
+       ;; doesn't contain the CMakeLists.txt file which is useful for
+       ;; integration with other software, such as the openboardview package.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/Dav1dde/glad")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0m55ya1zrmg6n2cljkajy80ilmi5sblln8742fm0k1sw9k7hzn8n"))))
+    (inputs (list))
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'install 'install-cmakelists.txt
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (share (string-append out "/share/" ,name)))
+                        (install-file "CMakeLists.txt" share)))))))))
+
 (define-public s2tc
   (package
     (name "s2tc")
-- 
2.41.0