summary refs log tree commit diff
path: root/gnu/packages/gl.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/gl.scm')
-rw-r--r--gnu/packages/gl.scm69
1 files changed, 65 insertions, 4 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 4e372c530b..96d48b6dc8 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system waf)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
@@ -234,7 +236,7 @@ also known as DXTn or DXTC) for Mesa.")
 (define-public mesa
   (package
     (name "mesa")
-    (version "20.1.9")
+    (version "20.2.4")
     (source
       (origin
         (method url-fetch)
@@ -246,7 +248,7 @@ also known as DXTn or DXTC) for Mesa.")
                                   version "/mesa-" version ".tar.xz")))
         (sha256
          (base32
-          "10kk8a8k7f4ip8yaiqdyrx162nbw8pw4h3b4hs4ha8mpd43wlldj"))
+          "14m09bk7akj0k02lg8fhvvzbdsashlbdsgl2cw7wbqfj2mhdqwh5"))
         (patches
          (search-patches "mesa-skip-disk-cache-test.patch"))))
     (build-system meson-build-system)
@@ -271,7 +273,7 @@ also known as DXTn or DXTC) for Mesa.")
         ,@(match (%current-system)
             ((or "x86_64-linux" "i686-linux")
              ;; Note: update the 'clang' input of mesa-opencl when bumping this.
-             `(("llvm" ,llvm-10)))
+             `(("llvm" ,llvm-11)))
             (_
              `()))
         ("wayland" ,wayland)
@@ -457,7 +459,7 @@ from software emulation to complete hardware acceleration for modern GPUs.")
      `(("libclc" ,libclc)
        ,@(package-inputs mesa)))
     (native-inputs
-     `(("clang" ,clang-10)
+     `(("clang" ,clang-11)
        ,@(package-native-inputs mesa)))))
 
 (define-public mesa-opencl-icd
@@ -1020,3 +1022,62 @@ the glProgramViewportFlip before it was replaced with glProgramViewportInfo.")
 The C# wrapper was written to be used for FNA's platform support.  However, this
 is written in a way that can be used for any general C# application.")
       (license license:zlib))))
+
+(define-public glmark2
+  (package
+    (name "glmark2")
+    (version "2020.04")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/glmark2/glmark2")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0ywpzp0imi3f8iyp7d1739576zx2nsr3db5hp2as4yhflfyq1as2"))
+              (modules '((guix build utils)))
+              ;; Fix Python 3 incompatibility.
+              (snippet
+               '(begin
+                  (substitute* "wscript"
+                    (("(sorted\\()FLAVORS\\.keys\\(\\)(.*)" _ beginning end)
+                     (string-append beginning "list(FLAVORS)" end)))
+                  #t))))
+    (build-system waf-build-system)
+    (arguments
+     '(#:tests? #f                      ; no check target
+       #:configure-flags
+       (list (string-append "--with-flavors="
+                            (string-join '("x11-gl" "x11-glesv2"
+                                           "drm-gl" "drm-glesv2"
+                                           "wayland-gl" "wayland-glesv2")
+                                         ",")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((mesa (assoc-ref inputs "mesa")))
+               (substitute* (find-files "src" "gl-state-.*\\.cpp$")
+                 (("libGL.so") (string-append mesa "/lib/libGL.so"))
+                 (("libEGL.so") (string-append mesa "/lib/libEGL.so"))
+                 (("libGLESv2.so") (string-append mesa "/lib/libGLESv2.so")))
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("eudev" ,eudev)
+       ("libdrm" ,libdrm)
+       ("libjpeg-turbo" ,libjpeg-turbo)
+       ("libpng" ,libpng)
+       ("libx11" ,libx11)
+       ("libxcb" ,libxcb)
+       ("mesa" ,mesa)
+       ("wayland" ,wayland)
+       ("wayland-protocols" ,wayland-protocols)))
+    (home-page "https://github.com/glmark2/glmark2")
+    (synopsis "OpenGL 2.0 and OpenGL ES 2.0 benchmark")
+    (description
+     "glmark2 is an OpenGL 2.0 and OpenGL ES 2.0 benchmark based on the
+original glmark benchmark by Ben Smith.")
+    (license license:gpl3+)))