;;; Copyright © 2013 Joshua Grant <tadni@riseup.net>
;;; Copyright © 2014, 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
+;;; 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 Rutger Helling <rhelling@mykolab.com>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; 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)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
(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
"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.
(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
(define-public mesa
(package
(name "mesa")
- (version "18.1.8")
+ (version "19.1.4")
(source
(origin
(method url-fetch)
version "/mesa-" version ".tar.xz")))
(sha256
(base32
- "06y28hpynb8w1qagznr85ml48hf8264w4ji6cmvm2fy7x5zyc6xx"))
+ "1yvb7ja09i36zjifpyrf8jmbm9z0wqs2w3x8dlmxkkzdv6knilm6"))
(patches
(search-patches "mesa-skip-disk-cache-test.patch"))))
- (build-system gnu-build-system)
+ (build-system meson-build-system)
(propagated-inputs
`(;; The following are in the Requires.private field of gl.pc.
("libdrm" ,libdrm)
("libva" ,(force libva-without-mesa))
("libxml2" ,libxml2)
;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
+ ("libxrandr" ,libxrandr)
("libxvmc" ,libxvmc)
,@(match (%current-system)
((or "x86_64-linux" "i686-linux")
("wayland" ,wayland)
("wayland-protocols" ,wayland-protocols)))
(native-inputs
- `(("pkg-config" ,pkg-config)
- ("python" ,python-2)
- ("python2-mako" ,python2-mako)
+ `(("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)
("which" ,(@ (gnu packages base) which))))
(arguments
`(#:configure-flags
'(,@(match (%current-system)
- ("armhf-linux"
- ;; TODO: Add etnaviv,imx when libdrm supports etnaviv.
- '("--with-gallium-drivers=freedreno,nouveau,r300,r600,swrast,tegra,vc4,virgl"))
- ("aarch64-linux"
+ ((or "armhf-linux" "aarch64-linux")
;; TODO: Fix svga driver for aarch64 and armhf.
- '("--with-gallium-drivers=freedreno,nouveau,pl111,r300,r600,swrast,tegra,vc4,virgl"))
+ '("-Dgallium-drivers=etnaviv,freedreno,nouveau,r300,r600,swrast,tegra,v3d,vc4,virgl"))
(_
- '("--with-gallium-drivers=i915,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
- "--with-platforms=x11,drm,surfaceless,wayland"
- "--enable-glx-tls" ;Thread Local Storage, improves performance
- ;; "--enable-opencl"
- ;; "--enable-omx"
- "--enable-osmesa"
- "--enable-xa"
+ "-Dplatforms=x11,drm,surfaceless,wayland"
+ "-Dglx=dri" ;Thread Local Storage, improves performance
+ ;; "-Dopencl=true"
+ ;; "-Domx=true"
+ "-Dosmesa=gallium"
+ "-Dgallium-xa=true"
+
;; features required by wayland
- "--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"
+ "-Dgles2=true"
+ "-Dgbm=true"
+ "-Dshared-glapi=true"
;; Enable Vulkan on i686-linux and x86-64-linux.
,@(match (%current-system)
- ("x86_64-linux"
- '("--with-vulkan-drivers=intel,radeon"))
- ;; TODO: Fix intel driver on i686-linux.
- ("i686-linux"
- '("--with-vulkan-drivers=radeon"))
+ ((or "i686-linux" "x86_64-linux")
+ '("-Dvulkan-drivers=intel,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.
- "--enable-gallium-tests"
+ "-Dbuild-tests=true"
;; 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
+ '("-Ddri-drivers=i915,i965,nouveau,r200,r100"
+ "-Dllvm=true")) ; default is x86/x86_64 only
(_
- '("--with-dri-drivers=nouveau,r200,radeon,swrast"))))
+ '("-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)
- (guix build gnu-build-system))
+ (guix build meson-build-system))
#:phases
(modify-phases %standard-phases
(add-after
(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
- 'build 'fix-dlopen-libnames
+ 'configure 'fix-dlopen-libnames
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; Remain agnostic to .so.X.Y.Z versions while doing
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)
'("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,
(define-public glew
(package
(name "glew")
- (version "2.0.0")
+ (version "2.1.0")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/glew/glew/" version
"/glew-" version ".tgz"))
(sha256
(base32
- "0r37fg2s1f0jrvwh6c8cz5x6v4wqmhq42qm15cs9qs349q5c6wn5"))
+ "159wk5dc0ykjbxvag5i1m2mhp23zkk6ra04l26y3jc3nwvkr3ph4"))
(modules '((guix build utils)))
(snippet
'(begin
(define-public libepoxy
(package
(name "libepoxy")
- (version "1.5.2")
+ (version "1.5.3")
(source (origin
(method url-fetch)
(uri (string-append
version "/libepoxy-" version ".tar.xz"))
(sha256
(base32
- "1n57xj5i6giw4mp5s59w1m9bm33sd6gjg7r00dzzvcwya6326mm9"))))
+ "0ga3qjv50x37my6pw5xr14g5n6z78hy5s8s06kays8c3ab2mha80"))))
(arguments
`(#:phases
(modify-phases %standard-phases
+ (delete 'bootstrap)
(add-before
'configure 'patch-paths
(lambda* (#:key inputs #:allow-other-keys)
(("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
(("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
#t))))))
- (build-system gnu-build-system)
+ (build-system meson-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
("python" ,python)))
`(("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
(define-public virtualgl
(package
(name "virtualgl")
- (version "2.6")
+ (version "2.6.2")
(source
(origin
(method git-fetch)
(commit version)))
(file-name (git-file-name name version))
(sha256
- (base32
- "0di2igj2bhwb153fndgxks7y57pyhp0gj31n47j93gb7lxc9qcck"))))
+ (base32 "0yyc553xsb5n0rx7jp9p4wdbd7md07b3qrkf3ssyjavqqg908qg9"))))
(arguments
`(#:tests? #f ; no tests are available
#:configure-flags (list
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))))