gnu: webkitgtk: Update to 2.28.2.
[jackhill/guix/guix.git] / gnu / packages / gl.scm
index 9ed043c..01241cd 100644 (file)
@@ -4,12 +4,14 @@
 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
 ;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 ng0 <ng0@n0.is>
-;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
 ;;; 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>
+;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +43,7 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages mono)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
@@ -52,6 +55,7 @@
   #: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
@@ -93,7 +97,7 @@ as ASCII text.")
 (define-public freeglut
   (package
     (name "freeglut")
-    (version "3.0.0")
+    (version "3.2.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -101,16 +105,15 @@ as ASCII text.")
                     version "/freeglut-" version ".tar.gz"))
               (sha256
                (base32
-                "18knkyczzwbmyg8hr4zh8a1i5ga01np2jzd1rwmsh7mh2n2vwhra"))))
+                "0s6sk49q8ijgbsrrryb7dzqx2fa744jhx1wck5cz5jia2010w06l"))))
     (build-system cmake-build-system)
-    (arguments '(#:tests? #f)) ; no test target
-    (inputs `(("mesa" ,mesa)
-              ("libx11" ,libx11)
+    (arguments
+     '(#:tests? #f                      ;no test target
+       #:configure-flags '("-DFREEGLUT_BUILD_STATIC_LIBS=OFF")))
+    (inputs `(("libx11" ,libx11)
               ("libxi" ,libxi)
               ("libxrandr" ,libxrandr)
-              ("libxxf86vm" ,libxxf86vm)
-              ("xorgproto" ,xorgproto)
-              ("xinput" ,xinput)))
+              ("libxxf86vm" ,libxxf86vm)))
     (propagated-inputs
      ;; Headers from Mesa and GLU are needed.
      `(("glu" ,glu)
@@ -144,20 +147,23 @@ the X-Consortium license.")
               (sha256
                (base32
                 "16lrxxxd9ps9l69y3zsw6iy0drwjsp6m26d1937xj71alqk6dr6x"))))
-    (build-system gnu-build-system)))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags '("--disable-static")))))
 
 (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")))
@@ -167,8 +173,10 @@ the X-Consortium license.")
               ("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
@@ -224,7 +232,7 @@ also known as DXTn or DXTC) for Mesa.")
 (define-public mesa
   (package
     (name "mesa")
-    (version "19.1.1")
+    (version "19.3.4")
     (source
       (origin
         (method url-fetch)
@@ -236,7 +244,7 @@ also known as DXTn or DXTC) for Mesa.")
                                   version "/mesa-" version ".tar.xz")))
         (sha256
          (base32
-          "10amy5sdmpjbskr3xazgk0jyli8xpgi0y1nsmjr76hx8nhb4n4bj"))
+          "1r4giqq7q7zqbn23lbw7v5vswagxx8qj6ij2w8bsb697mvk6g90x"))
         (patches
          (search-patches "mesa-skip-disk-cache-test.patch"))))
     (build-system meson-build-system)
@@ -260,7 +268,8 @@ also known as DXTn or DXTC) for Mesa.")
         ("libxvmc" ,libxvmc)
         ,@(match (%current-system)
             ((or "x86_64-linux" "i686-linux")
-             `(("llvm" ,llvm)))
+             ;; Note: update the 'clang' input of mesa-opencl when bumping this.
+             `(("llvm" ,llvm-9)))
             (_
              `()))
         ("makedepend" ,makedepend)
@@ -272,13 +281,11 @@ also known as DXTn or DXTC) for Mesa.")
         ("gettext" ,gettext-minimal)
         ,@(match (%current-system)
             ((or "x86_64-linux" "i686-linux")
-             `(("glslang" ,glslang)
-               ("vulkan-headers" ,vulkan-headers)
-               ("vulkan-loader" ,vulkan-loader)))
+             `(("glslang" ,glslang)))
             (_
              `()))
         ("pkg-config" ,pkg-config)
-        ("python" ,python)
+        ("python" ,python-wrapper)
         ("python-mako" ,python-mako)
         ("which" ,(@ (gnu packages base) which))))
     (arguments
@@ -288,7 +295,7 @@ also known as DXTn or DXTC) for Mesa.")
               ;; TODO: Fix svga driver for aarch64 and armhf.
               '("-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"
@@ -305,11 +312,8 @@ 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")))
 
@@ -331,6 +335,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)
@@ -343,7 +352,8 @@ 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" (%current-system))
+         ,@(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
@@ -426,7 +436,7 @@ from software emulation to complete hardware acceleration for modern GPUs.")
      `(("libclc" ,libclc)
        ,@(package-inputs mesa)))
     (native-inputs
-     `(("clang" ,clang)
+     `(("clang" ,clang-9)
        ,@(package-native-inputs mesa)))))
 
 (define-public mesa-opencl-icd
@@ -594,10 +604,30 @@ extension functionality is exposed in a single header file.")
 OpenGL graphics API.")
     (license license:lgpl3+)))
 
+(define-public guile3.0-opengl
+  (package
+    (inherit guile-opengl)
+    (name "guile3.0-opengl")
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-opengl)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'build-with-guile-3.0
+             (lambda _
+               (substitute* "configure"
+                 (("_guile_versions_to_search=\"")
+                  "_guile_versions_to_search=\"3.0 "))
+               #t))))))
+    (inputs
+     `(("guile" ,guile-3.0)
+       ("mesa" ,mesa)
+       ("glu" ,glu)
+       ("freeglut" ,freeglut)))))
+
 (define-public libepoxy
   (package
     (name "libepoxy")
-    (version "1.5.3")
+    (version "1.5.4")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -605,7 +635,7 @@ OpenGL graphics API.")
                     version "/libepoxy-" version ".tar.xz"))
               (sha256
                (base32
-                "0ga3qjv50x37my6pw5xr14g5n6z78hy5s8s06kays8c3ab2mha80"))))
+                "1ll9fach4v30dsyd47s5ial4gaiwihzr2afb77vxxzzy3mlcrlhb"))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -703,7 +733,7 @@ OpenGL.")
        ("libxinerama" ,libxinerama)
        ("libxcursor" ,libxcursor)
        ("libxxf86vm" ,libxxf86vm)))
-    (home-page "http://www.glfw.org")
+    (home-page "https://www.glfw.org")
     (synopsis "OpenGL application development library")
     (description
      "GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
@@ -804,3 +834,119 @@ 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))))
+
+(define-public mojoshader-cs
+  (let ((commit "10d0dba21ff1cfe332eb7de328a2adce01286bd7"))
+    (package
+      (name "mojoshader-cs")
+      (version (git-version "20191205" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/FNA-XNA/MojoShader")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "11mdhf3fmb9rsn2iv753gmb596j4dh5j2iipgw078vg0lj23rml7"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:tests? #f  ; No tests.
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'build
+             (lambda _
+               (invoke "make" "-C" "csharp")))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (install-file "csharp/bin/MojoShader-CS.dll" (string-append out "/lib"))
+                 #t))))))
+      (native-inputs
+       `(("mono" ,mono)))
+      (home-page "https://github.com/FNA-XNA/MojoShader")
+      (synopsis "C# wrapper for MojoShader")
+      (description
+       "Mojoshader-CS provides C# bindings for the Mojoshader library.
+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))))