Subject: [PATCH 3/3] gnu: Add glad-2.

From: "(" <[email-masked]>
Date: Sat, 5 Nov 2022 17:15:42 +0000

* gnu/packages/gl.scm (glad-2): New variable.
(glad-1): Inherit from GLAD-2.
(glad): Define as GLAD-2.
---
 gnu/packages/gl.scm | 69 ++++++++++++++++++++++++++++++---------------
 1 file changed, 46 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 93524988a9..7a6e8d092c 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -190,39 +190,62 @@ (define-public ftgl
 Polygon meshes, and Extruded polygon meshes.")
     (license license:x11)))
 
-(define-public glad-1
+(define-public glad-2
   (package
     (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"))))
+    (version "2.0.2")
+    (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
+                "1s9l7ypdxqaqpgnvc1vjgc7zaazm0j7dbfyqw6hwbx99d2whb7ds"))))
     (build-system python-build-system)
     (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 _
+                   (install-file "cmake/CMakeLists.txt"
+                                 (string-append #$output "/share/glad")))))))
+    (native-inputs (list python-jinja2))
     (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 glad glad-1)
+(define-public glad-1
+  (package
+    (inherit glad-2)
+    (name "glad")
+    (version "0.1.36")
+    (source (origin
+              (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"))))
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install 'install-cmakelists.txt
+                 (lambda _
+                   (install-file "CMakeLists.txt"
+                                 (string-append
+                                  #$output "/share/glad")))))))))
+
+(define glad glad-2)
 
 (define-public s2tc
   (package
-- 
2.38.0