gnu: java: Use HTTPS for osgi.org home pages.
[jackhill/guix/guix.git] / gnu / packages / gl.scm
index 18d5d81..421e946 100644 (file)
@@ -2,9 +2,14 @@
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Joshua Grant <tadni@riseup.net>
 ;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
-;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
-;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 David Thompson <davet@gnu.org>
+;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
-  #:use-module (gnu packages zip)
   #:use-module (guix download)
   #:use-module (guix build utils)
   #:use-module (guix build-system gnu)
@@ -118,6 +127,21 @@ the mouse, keyboard and joystick functions.  Freeglut is released under
 the X-Consortium license.")
     (license license:x11)))
 
+;; Needed for "kiki".
+(define-public freeglut-2.8
+  (package (inherit freeglut)
+    (name "freeglut")
+    (version "2.8.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://sourceforge/freeglut/freeglut/"
+                    version "/freeglut-" version ".tar.gz"))
+              (sha256
+               (base32
+                "16lrxxxd9ps9l69y3zsw6iy0drwjsp6m26d1937xj71alqk6dr6x"))))
+    (build-system gnu-build-system)))
+
 (define-public ftgl
   (package
     (name "ftgl")
@@ -196,17 +220,22 @@ also known as DXTn or DXTC) for Mesa.")
 (define-public mesa
   (package
     (name "mesa")
-    (version "13.0.2")
+    (version "17.2.1")
     (source
       (origin
         (method url-fetch)
-        (uri (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
-                            version "/mesa-" version ".tar.xz"))
+        (uri (list (string-append "https://mesa.freedesktop.org/archive/"
+                                  "mesa-" version ".tar.xz")
+                   (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
+                                  "mesa-" version ".tar.xz")
+                   (string-append "ftp://ftp.freedesktop.org/pub/mesa/"
+                                  version "/mesa-" version ".tar.xz")))
         (sha256
          (base32
-          "1m8n8kd8kcs5ddyvldiw09wvpi5wwpfmmxlb87d63vgl8lk65vd6"))
+          "07msr6xismw2jq87irwhz7vygvzj6hi38d71paij9zvwh8bmsf3p"))
         (patches
-         (search-patches "mesa-wayland-egl-symbols-check-mips.patch"))))
+         (search-patches "mesa-wayland-egl-symbols-check-mips.patch"
+                         "mesa-skip-disk-cache-test.patch"))))
     (build-system gnu-build-system)
     (propagated-inputs
       `(("glproto" ,glproto)
@@ -222,24 +251,39 @@ also known as DXTn or DXTC) for Mesa.")
       `(("expat" ,expat)
         ("dri2proto" ,dri2proto)
         ("dri3proto" ,dri3proto)
+        ("libelf" ,libelf)    ;required for r600 when using llvm
         ("libva" ,(force libva-without-mesa))
         ("libxml2" ,libxml2)
         ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
         ("libxvmc" ,libxvmc)
+        ,@(match (%current-system)
+            ((or "x86_64-linux" "i686-linux")
+             `(("llvm" ,llvm-3.9.1))) ; exactly 3.9.0 or 3.9.1 for swrast
+            (_
+             `()))
         ("makedepend" ,makedepend)
         ("presentproto" ,presentproto)
         ("s2tc" ,s2tc)
-        ("wayland" ,wayland)))
+        ("wayland" ,wayland)
+        ("wayland-protocols" ,wayland-protocols)))
     (native-inputs
       `(("pkg-config" ,pkg-config)
-        ("python" ,python-2)))
+        ("python" ,python-2)
+        ("which" ,(@ (gnu packages base) which))))
     (arguments
      `(#:configure-flags
-       '(;; drop r300 from default gallium drivers, as it requires llvm
-         "--with-gallium-drivers=r600,svga,swrast,nouveau,virgl"
+       '(,@(match (%current-system)
+             ("armhf-linux"
+              ;; TODO: Add etnaviv,imx when libdrm supports etnaviv.
+              '("--with-gallium-drivers=freedreno,nouveau,r300,r600,swrast,vc4,virgl"))
+             ("aarch64-linux"
+              ;; TODO: Fix svga driver for aarch64 and armhf.
+              '("--with-gallium-drivers=freedreno,nouveau,r300,r600,swrast,vc4,virgl"))
+             (_
+              '("--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast,virgl")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
          ;; omx requires libomxil-bellagio
-         "--with-egl-platforms=x11,drm,wayland"
+         "--with-platforms=x11,drm,wayland,surfaceless"
          "--enable-glx-tls"        ;Thread Local Storage, improves performance
          ;; "--enable-opencl"
          ;; "--enable-omx"
@@ -249,12 +293,19 @@ also known as DXTn or DXTC) for Mesa.")
          "--enable-gles2"
          "--enable-gbm"
          "--enable-shared-glapi"
+         ;; Without floating point texture support, drivers such as Nouveau
+         ;; are stuck at OpenGL 2.1 instead of OpenGL 3.0+.
+         "--enable-texture-float"
+
+         ;; Also enable the tests.
+         "--enable-gallium-tests"
 
          ;; on non-intel systems, drop i915 and i965
          ;; from the default dri drivers
          ,@(match (%current-system)
              ((or "x86_64-linux" "i686-linux")
-              '())
+              '("--with-dri-drivers=i915,i965,nouveau,r200,radeon,swrast"
+                "--enable-llvm"))         ; default is x86/x86_64 only
              (_
               '("--with-dri-drivers=nouveau,r200,radeon,swrast"))))
        #:phases
@@ -265,7 +316,8 @@ also known as DXTn or DXTC) for Mesa.")
              (substitute* "src/compiler/glsl/tests/lower_jumps/create_test_cases.py"
                (("/usr/bin/env bash") (which "bash")))
              (substitute* "src/intel/genxml/gen_pack_header.py"
-               (("/usr/bin/env python2") (which "python")))))
+               (("/usr/bin/env python2") (which "python")))
+             #t))
          (add-before
            'build 'fix-dlopen-libnames
            (lambda* (#:key inputs outputs #:allow-other-keys)
@@ -289,8 +341,9 @@ also known as DXTn or DXTC) for Mesa.")
                  ;; it's never installed since Mesa removed its
                  ;; egl_gallium support.
                  (("\"gbm_dri\\.so")
-                  (string-append "\"" out "/lib/dri/gbm_dri.so")))))))))
-    (home-page "http://mesa3d.org/")
+                  (string-append "\"" out "/lib/dri/gbm_dri.so")))
+               #t))))))
+    (home-page "https://mesa3d.org/")
     (synopsis "OpenGL implementation")
     (description "Mesa is a free implementation of the OpenGL specification -
 a system for rendering interactive 3D graphics.  A variety of device drivers
@@ -379,7 +432,7 @@ glxgears, glxheads, and glxinfo.")
                   (("/lib64") "/lib")))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases (alist-delete 'configure %standard-phases)
+     '(#:phases (modify-phases %standard-phases (delete 'configure))
        #:make-flags (list (string-append "GLEW_PREFIX="
                                          (assoc-ref %outputs "out"))
                           (string-append "GLEW_DEST="
@@ -416,7 +469,7 @@ extension functionality is exposed in a single header file.")
                "13qfx4xh8baryxqrv986l848ygd0piqwm6s2s90pxk9c0m9vklim"))))
     (build-system gnu-build-system)
     (native-inputs `(("pkg-config" ,pkg-config)))
-    (inputs `(("guile" ,guile-2.0)
+    (inputs `(("guile" ,guile-2.2)
               ("mesa" ,mesa)
               ("glu" ,glu)
               ("freeglut" ,freeglut)))
@@ -452,24 +505,18 @@ OpenGL graphics API.")
 (define-public libepoxy
   (package
     (name "libepoxy")
-    (version "1.3.1")
+    (version "1.4.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "https://github.com/anholt/libepoxy/archive/v"
-                    version
-                    ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+                    "https://github.com/anholt/libepoxy/releases/download/"
+                    version "/libepoxy-" version ".tar.xz"))
               (sha256
                (base32
-                "1d1brhwfmlzgnphmdwlvn5wbcrxsdyzf1qfcf8nb89xqzznxs037"))))
+                "19hsyap2p0sflj75ycf4af9bsp453bamymbcgnmrphigabsspil8"))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (add-after
-           'unpack 'autoreconf
-           (lambda _
-             (zero? (system* "autoreconf" "-vif"))))
          (add-before
            'configure 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
@@ -477,30 +524,21 @@ OpenGL graphics API.")
                    (mesa (assoc-ref inputs "mesa")))
                (substitute* "src/gen_dispatch.py"
                  (("/usr/bin/env python") python))
+               ;; Add support for aarch64, see upstream:
+               ;; https://github.com/anholt/libepoxy/pull/114
+               (substitute* "test/dlwrap.c"
+                 (("GLIBC_2.4") "GLIBC_2.17\", \"GLIBC_2.4"))
                (substitute* (find-files "." "\\.[ch]$")
                  (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
                  (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
-
-               ;; XXX On armhf systems, we must add "GLIBC_2.4" to the list of
-               ;; versions in test/dlwrap.c:dlwrap_real_dlsym.  It would be
-               ;; better to make this a normal patch, but for now we do it here
-               ;; to prevent rebuilding on other platforms.
-               ,@(if (string-prefix? "arm" (or (%current-target-system)
-                                               (%current-system)))
-                     '((substitute* '"test/dlwrap.c"
-                         (("\"GLIBC_2\\.0\"") "\"GLIBC_2.0\", \"GLIBC_2.4\"")))
-                     '())
                #t))))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("autoconf" ,autoconf)
-       ("automake" ,automake)
-       ("libtool" ,libtool)
-       ("pkg-config" ,pkg-config)
+     `(("pkg-config" ,pkg-config)
        ("python" ,python)))
     (inputs
      `(("mesa" ,mesa)))
-    (home-page "http://github.com/anholt/libepoxy/")
+    (home-page "https://github.com/anholt/libepoxy/")
     (synopsis "A library for handling OpenGL function pointer management")
     (description
      "A library for handling OpenGL function pointer management.")
@@ -609,3 +647,69 @@ library for OpenGL.  It has lean API modeled after HTML5 canvas API.  It is
 aimed to be a practical and fun toolset for building scalable user interfaces
 and visualizations.")
     (license license:zlib)))
+
+(define-public gl2ps
+  (package
+    (name "gl2ps")
+    (version "1.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://geuz.org/gl2ps/src/gl2ps-"
+             version ".tgz"))
+       (sha256
+        (base32
+         "1qpidkz8x3bxqf69hlhyz1m0jmfi9kq24fxsp7rq6wfqzinmxjq3"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("libpng" ,libpng)
+       ("mesa" ,mesa)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:tests? #f))  ;; no tests
+    (home-page "http://www.geuz.org/gl2ps/")
+    (synopsis "OpenGL to PostScript printing library")
+    (description "GL2PS is a C library providing high quality vector
+output for any OpenGL application.  GL2PS uses sorting algorithms
+capable of handling intersecting and stretched polygons, as well as
+non-manifold objects.  GL2PS provides many features including advanced
+smooth shading and text rendering, culling of invisible primitives and
+mixed vector/bitmap output.")
+    ;; GL2PS is dual-licenced and can be used under the terms of either.
+    (license (list license:lgpl2.0+
+                   (license:fsf-free "http://www.geuz.org/gl2ps/COPYING.GL2PS"
+                                     "GPL-incompatible copyleft license")))))
+
+(define-public virtualgl
+  (package
+    (name "virtualgl")
+    (version "2.5.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/VirtualGL/virtualgl/archive/"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0rnid3hwrry9d5d4m7sygq00xxx976rgk00a3557m9r5kxbmy476"))))
+    (arguments
+     `(#:tests? #f ;; no tests are available
+       #:configure-flags (list "-DVGL_USESSL=1" ;; use OpenSSL
+                          (string-append "-DCMAKE_INSTALL_LIBDIR="
+                                         (assoc-ref %outputs "out") "/lib"))))
+    (build-system cmake-build-system)
+    (inputs `(("glu" ,glu)
+              ("libjpeg-turbo" ,libjpeg-turbo)
+              ("mesa" ,mesa)
+              ("openssl" ,openssl)))
+    (native-inputs `(("pkg-config", pkg-config)))
+    (home-page "https://www.virtualgl.org")
+    (synopsis "Redirects 3D commands from an OpenGL application onto a 3D
+graphics card")
+    (description "VirtualGL redirects the 3D rendering commands from OpenGL
+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+)))