gnu: libepoxy: Update to 1.5.4.
[jackhill/guix/guix.git] / gnu / packages / gl.scm
index 7ee267c..a1350be 100644 (file)
@@ -6,10 +6,11 @@
 ;;; Copyright © 2016 ng0 <ng0@n0.is>
 ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018, 2019 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 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix hg-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system meson)
 (define-public glu
   (package
     (name "glu")
-    (version "9.0.0")
+    (version "9.0.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-"
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0r72yyhj09x3krn3kn629jqbwyq50ji8w5ri2pn6zwrk35m4g1s3"))))
+                "1xqhk9bn10nbvffw3r4p4rjslwz1l7gaycc0x2pqkr2irp7q9x7n"))))
     (build-system gnu-build-system)
     (propagated-inputs
      `(("mesa" ,mesa))) ; according to glu.pc
@@ -120,7 +123,7 @@ as ASCII text.")
      "Freeglut is a completely Free/OpenSourced alternative to
 the OpenGL Utility Toolkit (GLUT) library.  GLUT was originally
 written by Mark Kilgard to support the sample programs in the
-second edition OpenGL 'RedBook'.  Since then, GLUT has been used
+second edition OpenGL @code{RedBook}.  Since then, GLUT has been used
 in a wide variety of practical applications because it is simple,
 widely available and highly portable.
 
@@ -148,24 +151,29 @@ the X-Consortium license.")
 (define-public ftgl
   (package
     (name "ftgl")
-    (version "2.1.3-rc5")
+    (version "2.4.0")
+    (home-page "https://github.com/frankheckenbach/ftgl")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "mirror://sourceforge/ftgl/FTGL%20Source/2.1.3~rc5/"
-                    "ftgl-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference (url home-page)
+                                  (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0nsn4s6vnv5xcgxcw6q031amvh2zfj2smy1r5mbnjj2548hxcn2l"))))
+                "0zjs1h9w30gajq9lndzvjsa26rsmr1081lb1fbpbj10yhcdcsc79"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags '("--disable-static")))
     ;; The pkg-config file lists "freetype2" as Requires.private.
     (propagated-inputs `(("freetype" ,freetype)))
     (inputs `(("libx11" ,libx11)
               ("mesa" ,mesa)
               ("glu" ,glu)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
-    (home-page "http://ftgl.sourceforge.net")
+     `(("pkg-config" ,pkg-config)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)))
     (synopsis "Font rendering library for OpenGL applications")
     (description
      "FTGL is a font rendering library for OpenGL applications.  Supported
@@ -221,7 +229,7 @@ also known as DXTn or DXTC) for Mesa.")
 (define-public mesa
   (package
     (name "mesa")
-    (version "18.3.5")
+    (version "19.2.1")
     (source
       (origin
         (method url-fetch)
@@ -233,9 +241,10 @@ also known as DXTn or DXTC) for Mesa.")
                                   version "/mesa-" version ".tar.xz")))
         (sha256
          (base32
-          "0lvrfjaic7dhay9v52f9k3q5aac8xagfq3pnzjrl0cn65jlaw9s0"))
+          "1s81kwcjkkahnf5y5mshmd3q9j057hhsai7awpq6yb6im2hkriac"))
         (patches
-         (search-patches "mesa-skip-disk-cache-test.patch"))))
+         (search-patches "mesa-skip-disk-cache-test.patch"
+                         "mesa-timespec-test-32bit.patch"))))
     (build-system meson-build-system)
     (propagated-inputs
       `(;; The following are in the Requires.private field of gl.pc.
@@ -267,8 +276,13 @@ also known as DXTn or DXTC) for Mesa.")
       `(("bison" ,bison)
         ("flex" ,flex)
         ("gettext" ,gettext-minimal)
+        ,@(match (%current-system)
+            ((or "x86_64-linux" "i686-linux")
+             `(("glslang" ,glslang)))
+            (_
+             `()))
         ("pkg-config" ,pkg-config)
-        ("python" ,python)
+        ("python" ,python-wrapper)
         ("python-mako" ,python-mako)
         ("which" ,(@ (gnu packages base) which))))
     (arguments
@@ -276,9 +290,9 @@ also known as DXTn or DXTC) for Mesa.")
        '(,@(match (%current-system)
              ((or "armhf-linux" "aarch64-linux")
               ;; TODO: Fix svga driver for aarch64 and armhf.
-              '("-Dgallium-drivers=etnaviv,freedreno,imx,nouveau,pl111,r300,r600,swrast,tegra,v3d,vc4,virgl"))
+              '("-Dgallium-drivers=etnaviv,freedreno,nouveau,r300,r600,swrast,tegra,v3d,vc4,virgl"))
              (_
-              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
+              '("-Dgallium-drivers=iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
          ;; omx requires libomxil-bellagio
          "-Dplatforms=x11,drm,surfaceless,wayland"
@@ -295,14 +309,18 @@ also known as DXTn or DXTC) for Mesa.")
 
          ;; Enable Vulkan on i686-linux and x86-64-linux.
          ,@(match (%current-system)
-             ("x86_64-linux"
+             ((or "i686-linux" "x86_64-linux")
               '("-Dvulkan-drivers=intel,amd"))
-             ;; TODO: Fix intel driver on i686-linux.
-             ("i686-linux"
-              '("-Dvulkan-drivers=amd"))
              (_
               '("-Dvulkan-drivers=auto")))
 
+         ;; Enable the Vulkan overlay layer on i686-linux and x86-64-linux.
+         ,@(match (%current-system)
+             ((or "x86_64-linux" "i686-linux")
+              '("-Dvulkan-overlay-layer=true"))
+             (_
+              '()))
+
          ;; Also enable the tests.
          "-Dbuild-tests=true"
 
@@ -314,6 +332,11 @@ also known as DXTn or DXTC) for Mesa.")
                 "-Dllvm=true"))         ; default is x86/x86_64 only
              (_
               '("-Ddri-drivers=nouveau,r200,r100"))))
+
+       ;; XXX: 'debugoptimized' causes LTO link failures on some drivers.  The
+       ;; documentation recommends using 'release' for performance anyway.
+       #:build-type "release"
+
        #:modules ((ice-9 match)
                   (srfi srfi-1)
                   (guix build utils)
@@ -326,6 +349,16 @@ also known as DXTn or DXTC) for Mesa.")
              (substitute* "src/intel/genxml/gen_pack_header.py"
                (("/usr/bin/env python2") (which "python")))
              #t))
+         ,@(if (string-prefix? "i686" (or (%current-target-system)
+                                          (%current-system)))
+               ;; Disable new test from Mesa 19 that fails on i686.  Upstream
+               ;; report: <https://bugs.freedesktop.org/show_bug.cgi?id=110612>.
+               `((add-after 'unpack 'disable-failing-test
+                   (lambda _
+                     (substitute* "src/gallium/tests/unit/meson.build"
+                       (("'u_format_test',") ""))
+                     #t)))
+               '())
          (add-before
            'configure 'fix-dlopen-libnames
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -388,6 +421,31 @@ device drivers allows Mesa to be used in many different environments ranging
 from software emulation to complete hardware acceleration for modern GPUs.")
     (license license:x11)))
 
+(define-public mesa-opencl
+  (package
+    (inherit mesa)
+    (name "mesa-opencl")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mesa)
+       ((#:configure-flags flags)
+        `(cons "-Dgallium-opencl=standalone" ,flags))))
+    (inputs
+     `(("libclc" ,libclc)
+       ,@(package-inputs mesa)))
+    (native-inputs
+     `(("clang" ,clang)
+       ,@(package-native-inputs mesa)))))
+
+(define-public mesa-opencl-icd
+  (package
+    (inherit mesa-opencl)
+    (name "mesa-opencl-icd")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mesa)
+       ((#:configure-flags flags)
+        `(cons "-Dgallium-opencl=icd"
+               ,(delete "-Dgallium-opencl=standalone" flags)))))))
+
 (define-public mesa-headers
   (package
     (inherit mesa)
@@ -445,7 +503,7 @@ from software emulation to complete hardware acceleration for modern GPUs.")
                '("src/xdemos/glxdemo" "src/xdemos/glxgears"
                  "src/xdemos/glxinfo" "src/xdemos/glxheads"))
               #t))))))
-    (home-page "http://mesa3d.org/")
+    (home-page "https://mesa3d.org/")
     (synopsis "Utility tools for Mesa")
     (description
      "The mesa-utils package contains several utility tools for Mesa: glxdemo,
@@ -546,7 +604,7 @@ OpenGL graphics API.")
 (define-public libepoxy
   (package
     (name "libepoxy")
-    (version "1.5.3")
+    (version "1.5.4")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -554,7 +612,7 @@ OpenGL graphics API.")
                     version "/libepoxy-" version ".tar.xz"))
               (sha256
                (base32
-                "0ga3qjv50x37my6pw5xr14g5n6z78hy5s8s06kays8c3ab2mha80"))))
+                "1ll9fach4v30dsyd47s5ial4gaiwihzr2afb77vxxzzy3mlcrlhb"))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -617,7 +675,7 @@ OpenGL graphics API.")
      `(("unzip" ,unzip)))
     (inputs
      `(("mesa" ,mesa)))
-    (home-page "http://www.lonesock.net/soil.html")
+    (home-page "https://www.lonesock.net/soil.html")
     (synopsis "OpenGL texture loading library")
     (description
      "SOIL is a tiny C library used primarily for uploading textures into
@@ -722,7 +780,7 @@ mixed vector/bitmap output.")
 (define-public virtualgl
   (package
     (name "virtualgl")
-    (version "2.6.1")
+    (version "2.6.2")
     (source
      (origin
        (method git-fetch)
@@ -731,7 +789,7 @@ mixed vector/bitmap output.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "04fdwm6mz76lw4iwd5m7yxjfhpa0rpxd357bv5smk5lclnlbz1bv"))))
+        (base32 "0yyc553xsb5n0rx7jp9p4wdbd7md07b3qrkf3ssyjavqqg908qg9"))))
     (arguments
      `(#:tests? #f                      ; no tests are available
        #:configure-flags (list
@@ -753,3 +811,81 @@ applications to 3D accelerator hardware in a dedicated server and displays the
 rendered output interactively to a thin client located elsewhere on the
 network.")
     (license license:wxwindows3.1+)))
+
+(define-public mojoshader
+  (let ((changeset "5887634ea695"))
+    (package
+      (name "mojoshader")
+      (version (string-append "20190825" "-" changeset))
+      (source
+       (origin
+         (method hg-fetch)
+         (uri (hg-reference
+               (url "https://hg.icculus.org/icculus/mojoshader/")
+               (changeset changeset)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0ibl4z1696jiifv9j5drir7jm0b5px0vwkwckbi7cfd46p7p6wcy"))))
+      (arguments
+       ;; Tests only for COMPILER_SUPPORT=ON.
+       `(#:tests? #f
+         #:configure-flags '("-DBUILD_SHARED=ON"
+                             "-DFLIP_VIEWPORT=ON"
+                             "-DDEPTH_CLIPPING=ON")
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (lib (string-append out "/lib"))
+                      (header (string-append out "/include")))
+                 (install-file "libmojoshader.so" lib)
+                 (for-each (lambda (f)
+                             (install-file f header))
+                           (find-files "../source" "mojoshader.*\\.h$"))
+                 (let ((profiles-header (string-append header "/profiles")))
+                   (mkdir-p profiles-header)
+                   (rename-file (string-append header "/mojoshader_profile.h")
+                                (string-append profiles-header "/mojoshader_profile.h"))))
+               #t)))))
+      (build-system cmake-build-system)
+      (home-page "https://www.icculus.org/mojoshader/")
+      (synopsis "Work with Direct3D shaders on alternate 3D APIs")
+      (description "MojoShader is a library to work with Direct3D shaders on
+alternate 3D APIs and non-Windows platforms.  The primary motivation is moving
+shaders to OpenGL languages on the fly.  The developer deals with \"profiles\"
+that represent various target languages, such as GLSL or ARB_*_program.
+
+This allows a developer to manage one set of shaders, presumably written in
+Direct3D HLSL, and use them across multiple rendering backends.  This also
+means that the developer only has to worry about one (offline) compiler to
+manage program complexity, while MojoShader itself deals with the reduced
+complexity of the bytecode at runtime.
+
+MojoShader provides both a simple API to convert bytecode to various profiles,
+and (optionally) basic glue to rendering APIs to abstract the management of
+the shaders at runtime.")
+      (license license:zlib))))
+
+(define-public mojoshader-with-viewport-flip
+  ;; Changeset c586d4590241 replaced glProgramViewportFlip with
+  ;; glProgramViewportInfo.
+  ;; https://hg.icculus.org/icculus/mojoshader/rev/c586d4590241
+  (let ((changeset "2e37299b13d8"))
+    (package
+      (inherit mojoshader)
+      (name "mojoshader-with-viewport-flip")
+      (version (string-append "20190725" "-" changeset))
+      (source
+       (origin
+         (method hg-fetch)
+         (uri (hg-reference
+               (url "https://hg.icculus.org/icculus/mojoshader/")
+               (changeset changeset)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0ffws7cqbskxwc3hjsnnzq4r2bbf008kdr3b11pa3kr7dsi50y6i"))))
+      (synopsis "Work with Direct3D shaders on alternate 3D APIs (with viewport flip)")
+      (description "This is the last version of the mojoshader library with
+the glProgramViewportFlip before it was replaced with glProgramViewportInfo.")
+      (license license:zlib))))