X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/7c22aa63cdbf1ef62ad10a75ffb37ce35f95b3bf..d28c113f6b024547bf7dc7d56d8643718280a7dd:/gnu/packages/gl.scm diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 8f61a4b231..06e7bb5ae9 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -6,10 +6,11 @@ ;;; Copyright © 2016 ng0 ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus ;;; Copyright © 2016 David Thompson -;;; Copyright © 2017, 2018 Efraim Flashner +;;; Copyright © 2017, 2018, 2019 Efraim Flashner ;;; Copyright © 2017 Arun Isaac ;;; Copyright © 2017, 2018, 2019 Rutger Helling ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2019 Pierre Neidhardt ;;; ;;; This file is part of GNU Guix. ;;; @@ -46,11 +47,13 @@ #: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) @@ -63,14 +66,14 @@ (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 @@ -148,15 +151,16 @@ 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"))) @@ -166,8 +170,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 @@ -223,7 +229,7 @@ also known as DXTn or DXTC) for Mesa.") (define-public mesa (package (name "mesa") - (version "18.3.5") + (version "19.1.4") (source (origin (method url-fetch) @@ -235,7 +241,7 @@ also known as DXTn or DXTC) for Mesa.") version "/mesa-" version ".tar.xz"))) (sha256 (base32 - "0lvrfjaic7dhay9v52f9k3q5aac8xagfq3pnzjrl0cn65jlaw9s0")) + "1yvb7ja09i36zjifpyrf8jmbm9z0wqs2w3x8dlmxkkzdv6knilm6")) (patches (search-patches "mesa-skip-disk-cache-test.patch")))) (build-system meson-build-system) @@ -269,6 +275,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) + ("vulkan-headers" ,vulkan-headers) + ("vulkan-loader" ,vulkan-loader))) + (_ + `())) ("pkg-config" ,pkg-config) ("python" ,python) ("python-mako" ,python-mako) @@ -278,9 +291,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" @@ -297,14 +310,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" @@ -316,6 +333,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) @@ -328,6 +350,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: . + `((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) @@ -390,6 +422,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) @@ -619,7 +676,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 @@ -724,7 +781,7 @@ mixed vector/bitmap output.") (define-public virtualgl (package (name "virtualgl") - (version "2.6.1") + (version "2.6.2") (source (origin (method git-fetch) @@ -733,7 +790,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 @@ -755,3 +812,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))))