;;; 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 ng0 <ng0@n0.is>
+;;; Copyright © 2016 Nikita <nikita@n0.is>
;;; 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 © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; This file is part of GNU Guix.
;;;
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/divVerent/s2tc.git")
+ (url "https://github.com/divVerent/s2tc")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(define-public mesa
(package
(name "mesa")
- (version "19.3.4")
+ (version "20.0.7")
+
+ ;; Mesa 20.0.5 through 20.0.7 has problems with some graphic drivers, so
+ ;; we need this newer version.
+ ;; https://gitlab.freedesktop.org/mesa/mesa/-/issues/2882
+ ;; https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4861
+ (replacement mesa-20.0.8)
+
(source
(origin
(method url-fetch)
version "/mesa-" version ".tar.xz")))
(sha256
(base32
- "1r4giqq7q7zqbn23lbw7v5vswagxx8qj6ij2w8bsb697mvk6g90x"))
+ "0y517qpdg6v6dsdgzb365p03m30511sbyh8pq0mcvhvjwy7javpy"))
(patches
(search-patches "mesa-skip-disk-cache-test.patch"))))
(build-system meson-build-system)
,@(match (%current-system)
((or "x86_64-linux" "i686-linux")
;; Note: update the 'clang' input of mesa-opencl when bumping this.
- `(("llvm" ,llvm-9)))
+ `(("llvm" ,llvm-10)))
(_
`()))
- ("makedepend" ,makedepend)
("wayland" ,wayland)
("wayland-protocols" ,wayland-protocols)))
(native-inputs
("python" ,python-wrapper)
("python-mako" ,python-mako)
("which" ,(@ (gnu packages base) which))))
+ (outputs '("out" "bin"))
(arguments
`(#:configure-flags
'(,@(match (%current-system)
(guix build meson-build-system))
#:phases
(modify-phases %standard-phases
- (add-after
- 'unpack 'patch-create_test_cases
- (lambda _
- (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"
+ (substitute* "src/util/tests/format/meson.build"
(("'u_format_test',") ""))
#t)))
'())
- (add-before
- 'configure 'fix-dlopen-libnames
+ (add-before '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
;; the substitutions so we're future-safe.
- (substitute* "src/glx/dri_common.c"
- (("dlopen\\(\"libGL\\.so")
- (string-append "dlopen(\"" out "/lib/libGL.so")))
- (substitute* "src/egl/drivers/dri2/egl_dri2.c"
+ (substitute* "src/glx/meson.build"
+ (("-DGL_LIB_NAME=\"lib@0@\\.so\\.@1@\"")
+ (string-append "-DGL_LIB_NAME=\"" out
+ "/lib/lib@0@.so.@1@\"")))
+ (substitute* "src/gbm/backends/dri/gbm_dri.c"
(("\"libglapi\\.so")
(string-append "\"" out "/lib/libglapi.so")))
(substitute* "src/gbm/main/backend.c"
(("\"gbm_dri\\.so")
(string-append "\"" out "/lib/dri/gbm_dri.so")))
#t)))
+ (add-after 'install 'split-outputs
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (bin (assoc-ref outputs "bin")))
+ ,@(match (%current-system)
+ ((or "i686-linux" "x86_64-linux")
+ ;; Install the Vulkan overlay control script to a separate
+ ;; output to prevent a reference on Python, saving ~70 MiB
+ ;; on the closure size.
+ '((copy-recursively (string-append out "/bin")
+ (string-append bin "/bin"))
+ (delete-file-recursively (string-append out "/bin"))))
+ (_
+ ;; XXX: On architectures without the Vulkan overlay layer
+ ;; just create an empty file because outputs can not be
+ ;; added conditionally.
+ '((mkdir-p (string-append bin "/bin"))
+ (call-with-output-file (string-append bin "/bin/.empty")
+ (const #t)))))
+ #t)))
(add-after 'install 'symlinks-instead-of-hard-links
(lambda* (#:key outputs #:allow-other-keys)
;; All the drivers and gallium targets create hard links upon
from software emulation to complete hardware acceleration for modern GPUs.")
(license license:x11)))
-(define-public mesa-opencl
+;; Replacement package to fix <https://gitlab.freedesktop.org/mesa/mesa/-/issues/2863>.
+(define mesa-20.0.8
(package
(inherit mesa)
+ (version "20.0.8")
+ (source (origin
+ (inherit (package-source mesa))
+ (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")))
+ (sha256
+ (base32
+ "0v0bfh3ay07s6msxmklvwfaif0q02kq2yhy65fdhys49vw8c1w3c"))))))
+
+(define-public mesa-opencl
+ (package/inherit mesa
(name "mesa-opencl")
(arguments
(substitute-keyword-arguments (package-arguments mesa)
`(("libclc" ,libclc)
,@(package-inputs mesa)))
(native-inputs
- `(("clang" ,clang-9)
+ `(("clang" ,clang-10)
,@(package-native-inputs mesa)))))
(define-public mesa-opencl-icd
- (package
- (inherit mesa-opencl)
+ (package/inherit mesa-opencl
(name "mesa-opencl-icd")
(arguments
(substitute-keyword-arguments (package-arguments mesa)
,(delete "-Dgallium-opencl=standalone" flags)))))))
(define-public mesa-headers
- (package
- (inherit mesa)
+ (package/inherit mesa
(name "mesa-headers")
(propagated-inputs '())
(inputs '())
(native-inputs '())
+ (outputs '("out"))
(arguments
'(#:phases
(modify-phases %standard-phases
"A library for handling OpenGL function pointer management.")
(license license:x11)))
+(define-public libglvnd
+ (package
+ (name "libglvnd")
+ (version "1.3.2")
+ (home-page "https://gitlab.freedesktop.org/glvnd/libglvnd")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url home-page)
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "10x7fgb114r4gikdg6flszl3kwzcb9y5qa7sj9936mk0zxhjaylz"))))
+ (build-system meson-build-system)
+ (arguments
+ '(#:configure-flags '("-Dx11=enabled")
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'disable-glx-tests
+ (lambda _
+ ;; This package is meant to be used alongside Mesa.
+ ;; To avoid a circular dependency, disable tests that
+ ;; require a running Xorg server.
+ (substitute* "tests/meson.build"
+ (("if with_glx")
+ "if false"))
+ #t)))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("libx11" ,libx11)
+ ("libxext" ,libxext)
+ ("xorgproto" ,xorgproto)))
+ (synopsis "Vendor-neutral OpenGL dispatch library")
+ (description
+ "libglvnd is a vendor-neutral dispatch layer for arbitrating OpenGL
+API calls between multiple vendors. It allows multiple drivers from
+different vendors to coexist on the same filesystem, and determines which
+vendor to dispatch each API call to at runtime.
+
+Both GLX and EGL are supported, in any combination with OpenGL and OpenGL ES.")
+ ;; libglvnd is available under a custom X11-style license, and incorporates
+ ;; code with various other licenses. See README.md for details.
+ (license (list (license:x11-style "file://README.md")
+ license:x11
+ license:expat))))
+
(define-public soil
(package
(name "soil")
(license license:zlib)))
(define-public nanovg-for-extempore
- (package
- (name "nanovg-for-extempore")
- (version "0.7.1")
- (source (origin
- (method url-fetch)
- (uri (string-append "https://github.com/extemporelang/nanovg/"
- "archive/" version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "0ivs1sagq19xiw8jxd9f8w2b39svi0n9hrbmdvckwvqg95r8701g"))))
- (build-system cmake-build-system)
- (arguments `(#:tests? #f)) ; no tests included
- (inputs
- `(("mesa" ,mesa)))
- ;; Extempore refuses to build on architectures other than x86_64
- (supported-systems '("x86_64-linux"))
- (home-page "https://github.com/extemporelang/nanovg")
- (synopsis "2D vector drawing library on top of OpenGL")
- (description "NanoVG is small antialiased vector graphics rendering
+ (let ((version "0.7.1")
+ (revision "0")
+ (commit "3c60175fcc2e5fe305b04355cdce35d499c80310"))
+ (package
+ (name "nanovg-for-extempore")
+ (version (git-version version revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/extemporelang/nanovg")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0ddn3d3mxqn8hj9967v3pss7lz1wn08pcdnqzc118g7yjkq7hxzy"))))
+ (build-system cmake-build-system)
+ (arguments `(#:tests? #f)) ; no tests included
+ (inputs
+ `(("mesa" ,mesa)))
+ ;; Extempore refuses to build on architectures other than x86_64
+ (supported-systems '("x86_64-linux"))
+ (home-page "https://github.com/extemporelang/nanovg")
+ (synopsis "2D vector drawing library on top of OpenGL")
+ (description "NanoVG is small antialiased vector graphics rendering
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)))
+ (license license:zlib))))
(define-public gl2ps
(package
(name "gl2ps")
- (version "1.4.0")
+ (version "1.4.2")
(source
(origin
(method url-fetch)
"http://geuz.org/gl2ps/src/gl2ps-"
version ".tgz"))
(sha256
- (base32
- "1qpidkz8x3bxqf69hlhyz1m0jmfi9kq24fxsp7rq6wfqzinmxjq3"))))
+ (base32 "1sgzv547h7hrskb9qd0x5yp45kmhvibjwj2mfswv95lg070h074d"))))
(build-system cmake-build-system)
(inputs
`(("libpng" ,libpng)
("mesa" ,mesa)
("zlib" ,zlib)))
(arguments
- `(#:tests? #f)) ;; no tests
+ `(#: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
(origin
(method git-fetch)
(uri (git-reference
- (url "https://github.com/VirtualGL/virtualgl.git")
+ (url "https://github.com/VirtualGL/virtualgl")
(commit version)))
(file-name (git-file-name name version))
(sha256