gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / gl.scm
index dc64ccf..7b5a0b4 100644 (file)
@@ -4,9 +4,9 @@
 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Nikita <nikita@n0.is>
-;;; Copyright © 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2018, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -249,7 +249,7 @@ also known as DXTn or DXTC) for Mesa.")
          (base32
           "14m09bk7akj0k02lg8fhvvzbdsashlbdsgl2cw7wbqfj2mhdqwh5"))
         (patches
-         (search-patches "mesa-skip-disk-cache-test.patch"))))
+         (search-patches "mesa-skip-tests.patch"))))
     (build-system meson-build-system)
     (propagated-inputs
       `(;; The following are in the Requires.private field of gl.pc.
@@ -270,7 +270,7 @@ also known as DXTn or DXTC) for Mesa.")
         ("libxrandr" ,libxrandr)
         ("libxvmc" ,libxvmc)
         ,@(match (%current-system)
-            ((or "x86_64-linux" "i686-linux")
+            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux")
              ;; Note: update the 'clang' input of mesa-opencl when bumping this.
              `(("llvm" ,llvm-11)))
             (_
@@ -282,7 +282,7 @@ also known as DXTn or DXTC) for Mesa.")
         ("flex" ,flex)
         ("gettext" ,gettext-minimal)
         ,@(match (%current-system)
-            ((or "x86_64-linux" "i686-linux")
+            ((or "x86_64-linux" "i686-linux" "powerpc64le-linux")
              `(("glslang" ,glslang)))
             (_
              `()))
@@ -295,8 +295,10 @@ also known as DXTn or DXTC) for Mesa.")
      `(#:configure-flags
        '(,@(match (%current-system)
              ((or "armhf-linux" "aarch64-linux")
-              ;; TODO: Fix svga driver for aarch64 and armhf.
+              ;; TODO: Fix svga driver for non-Intel architectures.
               '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
+             ("powerpc64le-linux"
+              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
              (_
               '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
@@ -313,16 +315,18 @@ also known as DXTn or DXTC) for Mesa.")
          "-Dgbm=true"
          "-Dshared-glapi=true"
 
-         ;; Enable Vulkan on i686-linux and x86-64-linux.
+         ;; Explicitly enable Vulkan on some architectures.
          ,@(match (%current-system)
              ((or "i686-linux" "x86_64-linux")
               '("-Dvulkan-drivers=intel,amd"))
+             ("powerpc64le-linux"
+              '("-Dvulkan-drivers=amd"))
              (_
               '("-Dvulkan-drivers=auto")))
 
-         ;; Enable the Vulkan overlay layer on i686-linux and x86-64-linux.
+         ;; Enable the Vulkan overlay layer on architectures using llvm.
          ,@(match (%current-system)
-             ((or "x86_64-linux" "i686-linux")
+             ((or "x86_64-linux" "i686-linux" "powerpc64le-linux")
               '("-Dvulkan-overlay-layer=true"))
              (_
               '()))
@@ -336,6 +340,9 @@ also known as DXTn or DXTC) for Mesa.")
              ((or "x86_64-linux" "i686-linux")
               '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
                 "-Dllvm=true"))         ; default is x86/x86_64 only
+             ("powerpc64le-linux"
+              '("-Ddri-drivers=nouveau,r200,r100"
+                "-Dllvm=true"))
              (_
               '("-Ddri-drivers=nouveau,r200,r100"))))
 
@@ -349,6 +356,15 @@ also known as DXTn or DXTC) for Mesa.")
                   (guix build meson-build-system))
        #:phases
        (modify-phases %standard-phases
+         ,@(if (string-prefix? "powerpc64le" (or (%current-target-system)
+                                                 (%current-system)))
+               ;; Disable some of the llvmpipe tests.
+               `((add-after 'unpack 'disable-failing-test
+                   (lambda _
+                     (substitute* "src/gallium/drivers/llvmpipe/lp_test_arit.c"
+                       (("0\\.5, ") ""))
+                     #t)))
+               '())
          ,@(if (string-prefix? "i686" (or (%current-target-system)
                                           (%current-system)))
                ;; Disable new test from Mesa 19 that fails on i686.  Upstream
@@ -383,7 +399,7 @@ also known as DXTn or DXTC) for Mesa.")
              (let ((out (assoc-ref outputs "out"))
                    (bin (assoc-ref outputs "bin")))
                ,@(match (%current-system)
-                   ((or "i686-linux" "x86_64-linux")
+                   ((or "i686-linux" "x86_64-linux" "powerpc64le-linux")
                     ;; Install the Vulkan overlay control script to a separate
                     ;; output to prevent a reference on Python, saving ~70 MiB
                     ;; on the closure size.
@@ -600,6 +616,11 @@ extension functionality is exposed in a single header file.")
                         "godir = $(moddir)\n"))))
                  (add-before 'build 'patch-dynamic-link
                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (substitute* "gl/runtime.scm"
+                       (("\\(dynamic-link\\)")
+                        (string-append "(dynamic-link \""
+                                       (assoc-ref inputs "mesa")
+                                       "/lib/libGL.so" "\")")))
                      (define (dynamic-link-substitute file lib input)
                        (substitute* file
                          (("dynamic-link \"lib([a-zA-Z]+)\"" _ lib)
@@ -715,7 +736,7 @@ OpenGL graphics API.")
     (description
      "libglvnd is a vendor-neutral dispatch layer for arbitrating OpenGL
 API calls between multiple vendors.  It allows multiple drivers from
-different vendors to coexist on the same filesystem, and determines which
+different vendors to coexist on the same file system, and determines which
 vendor to dispatch each API call to at runtime.
 
 Both GLX and EGL are supported, in any combination with OpenGL and OpenGL ES.")
@@ -770,7 +791,7 @@ OpenGL.")
 (define-public glfw
   (package
     (name "glfw")
-    (version "3.2.1")
+    (version "3.3.4")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/glfw/glfw"
@@ -778,7 +799,7 @@ OpenGL.")
                                   "/glfw-" version ".zip"))
               (sha256
                (base32
-                "09kk5yc1zhss9add8ryqrngrr16hdmc94rszgng135bhw09mxmdp"))))
+                "1kcrpl4d6b6h23ib5j9q670d9w3knd07whgbanbmwwhbcqnc9lmv"))))
     (build-system cmake-build-system)
     (arguments
      '(#:tests? #f ; no test target
@@ -792,6 +813,7 @@ OpenGL.")
        ;; These are in 'Requires.private' of 'glfw3.pc'.
        ("libx11" ,libx11)
        ("libxrandr" ,libxrandr)
+       ("libxi" ,libxi)
        ("libxinerama" ,libxinerama)
        ("libxcursor" ,libxcursor)
        ("libxxf86vm" ,libxxf86vm)))