diff options
Diffstat (limited to 'gnu/packages/gl.scm')
-rw-r--r-- | gnu/packages/gl.scm | 137 |
1 files changed, 76 insertions, 61 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index a417e363bb..f5a72d9048 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -12,8 +12,10 @@ ;;; Copyright © 2019 Pierre Neidhardt <[email protected]> ;;; Copyright © 2020 Marius Bakke <[email protected]> ;;; Copyright © 2020 Giacomo Leidi <[email protected]> +;;; Copyright © 2020 Maxim Cournoyer <[email protected]> ;;; Copyright © 2020 Kei Kebreau <[email protected]> ;;; Copyright © 2021 Ivan Gankevich <[email protected]> +;;; Copyright © 2021 John Kehayias <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -106,6 +108,7 @@ as ASCII text.") (uri (string-append "mirror://sourceforge/freeglut/freeglut/" version "/freeglut-" version ".tar.gz")) + (patches (search-patches "freeglut-gcc-compat.patch")) (sha256 (base32 "0s6sk49q8ijgbsrrryb7dzqx2fa744jhx1wck5cz5jia2010w06l")))) @@ -235,7 +238,7 @@ also known as DXTn or DXTC) for Mesa.") (define-public mesa (package (name "mesa") - (version "20.2.4") + (version "21.2.5") (source (origin (method url-fetch) @@ -247,7 +250,7 @@ also known as DXTn or DXTC) for Mesa.") version "/mesa-" version ".tar.xz"))) (sha256 (base32 - "14m09bk7akj0k02lg8fhvvzbdsashlbdsgl2cw7wbqfj2mhdqwh5")) + "1fxcdf4qs4vmyjcns7jv62w4jy3gr383ar5b7mr77nb0nxgmhjcf")) (patches (search-patches "mesa-skip-tests.patch")))) (build-system meson-build-system) @@ -266,11 +269,10 @@ also known as DXTn or DXTC) for Mesa.") ("libelf" ,elfutils) ;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 ("libxrandr" ,libxrandr) ("libxvmc" ,libxvmc) ,@(match (%current-system) - ((or "x86_64-linux" "i686-linux" "powerpc64le-linux") + ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux") ;; Note: update the 'clang' input of mesa-opencl when bumping this. `(("llvm" ,llvm-11))) (_ @@ -282,12 +284,13 @@ also known as DXTn or DXTC) for Mesa.") ("flex" ,flex) ("gettext" ,gettext-minimal) ,@(match (%current-system) - ((or "x86_64-linux" "i686-linux" "powerpc64le-linux") + ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux") `(("glslang" ,glslang))) (_ `())) ("pkg-config" ,pkg-config) ("python" ,python-wrapper) + ("python-libxml2", python-libxml2) ;for OpenGL ES 1.1 and 2.0 support ("python-mako" ,python-mako) ("which" ,(@ (gnu packages base) which)))) (outputs '("out" "bin")) @@ -297,37 +300,39 @@ also known as DXTn or DXTC) for Mesa.") ((or "armhf-linux" "aarch64-linux") ;; TODO: Fix svga driver for non-Intel architectures. '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl")) - ("powerpc64le-linux" + ((or "powerpc64le-linux" "powerpc-linux") '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,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" + "-Dplatforms=x11,wayland" "-Dglx=dri" ;Thread Local Storage, improves performance ;; "-Dopencl=true" ;; "-Domx=true" - "-Dosmesa=gallium" - "-Dgallium-xa=true" + "-Dosmesa=true" + "-Dgallium-xa=enabled" ;; features required by wayland - "-Dgles2=true" - "-Dgbm=true" - "-Dshared-glapi=true" + "-Dgles2=enabled" + "-Dgbm=enabled" + "-Dshared-glapi=enabled" ;; Explicitly enable Vulkan on some architectures. ,@(match (%current-system) ((or "i686-linux" "x86_64-linux") '("-Dvulkan-drivers=intel,amd")) - ("powerpc64le-linux" - '("-Dvulkan-drivers=amd")) + ((or "powerpc64le-linux" "powerpc-linux") + '("-Dvulkan-drivers=amd,swrast")) + ("aarch64-linux" + '("-Dvulkan-drivers=freedreno,amd,broadcom,swrast")) (_ '("-Dvulkan-drivers=auto"))) ;; Enable the Vulkan overlay layer on architectures using llvm. ,@(match (%current-system) - ((or "x86_64-linux" "i686-linux" "powerpc64le-linux") - '("-Dvulkan-overlay-layer=true")) + ((or "x86_64-linux" "i686-linux" "powerpc64le-linux" "aarch64-linux" "powerpc-linux") + '("-Dvulkan-layers=device-select,overlay")) (_ '())) @@ -339,10 +344,10 @@ also known as DXTn or DXTC) for Mesa.") ,@(match (%current-system) ((or "x86_64-linux" "i686-linux") '("-Ddri-drivers=i915,i965,nouveau,r200,r100" - "-Dllvm=true")) ; default is x86/x86_64 only - ("powerpc64le-linux" + "-Dllvm=enabled")) ; default is x86/x86_64 only + ((or "powerpc64le-linux" "aarch64-linux" "powerpc-linux") '("-Ddri-drivers=nouveau,r200,r100" - "-Dllvm=true")) + "-Dllvm=enabled")) (_ '("-Ddri-drivers=nouveau,r200,r100")))) @@ -356,25 +361,41 @@ also known as DXTn or DXTC) for Mesa.") (guix build meson-build-system)) #:phases (modify-phases %standard-phases - ,@(if (string-prefix? "powerpc64le" (or (%current-target-system) - (%current-system))) - ;; Disable some of the llvmpipe tests. - `((add-after 'unpack 'disable-failing-test - (lambda _ - (substitute* "src/gallium/drivers/llvmpipe/lp_test_arit.c" - (("0\\.5, ") "")) - #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/util/tests/format/meson.build" - (("'u_format_test',") "")) - #t))) - '()) + (add-after 'unpack 'disable-failing-test + (lambda _ + ,@(match (%current-system) + ("powerpc64le-linux" + ;; Disable some of the llvmpipe tests. + `((substitute* "src/gallium/drivers/llvmpipe/lp_test_arit.c" + (("0\\.5, ") "")))) + ("powerpc-linux" + ;; There are some tests which fail specifically on powerpc. + `((substitute* '(;; LLVM ERROR: Relocation type not implemented yet! + "src/gallium/drivers/llvmpipe/meson.build" + ;; This is probably a big-endian test failure. + "src/gallium/targets/osmesa/meson.build") + (("if with_tests") "if not with_tests")) + (substitute* "src/util/tests/format/meson.build" + ;; This is definately an endian-ness test failure. + (("'u_format_test', ") "")) + ;; It is only this portion of the test which fails. + (substitute* "src/mesa/main/tests/meson.build" + ((".*mesa_formats.*") "")) + ;; This test times out and receives SIGTERM. + (substitute* "src/amd/common/meson.build" + (("and not with_platform_windows") "and with_platform_windows")))) + ("i686-linux" + ;; Disable new test from Mesa 19 that fails on i686. Upstream + ;; report: <https://bugs.freedesktop.org/show_bug.cgi?id=110612>. + `((substitute* "src/util/tests/format/meson.build" + (("'u_format_test',") "")))) + ("aarch64-linux" + ;; The ir3_disasm test segfaults. + ;; The simplest way to skip it is to run a different test instead. + `((substitute* "src/freedreno/ir3/meson.build" + (("disasm\\.c'") "delay.c',\n link_args: ld_args_build_id")))) + (_ + '((display "No tests to disable on this architecture.\n")))))) (add-before 'configure 'fix-dlopen-libnames (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -392,28 +413,18 @@ 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"))) - #t))) + (string-append "\"" out "/lib/dri/gbm_dri.so")))))) (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" "powerpc64le-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))) + ;; Not all architectures have the Vulkan overlay control script. + (mkdir-p (string-append out "/bin")) + (call-with-output-file (string-append out "/bin/.empty") + (const #t)) + (copy-recursively (string-append out "/bin") + (string-append bin "/bin")) + (delete-file-recursively (string-append out "/bin"))))) (add-after 'install 'symlinks-instead-of-hard-links (lambda* (#:key outputs #:allow-other-keys) ;; All the drivers and gallium targets create hard links upon @@ -447,8 +458,7 @@ also known as DXTn or DXTC) for Mesa.") file) (symlink reference file))) others)))) - (delete-duplicates inodes)) - #t)))))) + (delete-duplicates inodes)))))))) (home-page "https://mesa3d.org/") (synopsis "OpenGL and Vulkan implementations") (description "Mesa is a free implementation of the OpenGL and Vulkan @@ -460,6 +470,10 @@ from software emulation to complete hardware acceleration for modern GPUs.") (define-public mesa-opencl (package/inherit mesa (name "mesa-opencl") + (source (origin + (inherit (package-source mesa)) + (patches (cons (search-patch "mesa-opencl-all-targets.patch") + (origin-patches (package-source mesa)))))) (arguments (substitute-keyword-arguments (package-arguments mesa) ((#:configure-flags flags) @@ -679,7 +693,7 @@ OpenGL graphics API.") (define-public libepoxy (package (name "libepoxy") - (version "1.5.4") + (version "1.5.5") (source (origin (method url-fetch) (uri (string-append @@ -687,7 +701,7 @@ OpenGL graphics API.") version "/libepoxy-" version ".tar.xz")) (sha256 (base32 - "1ll9fach4v30dsyd47s5ial4gaiwihzr2afb77vxxzzy3mlcrlhb")))) + "0mh5bdgqfd8m4wj6jlvn4ac94sgfa8r6ish75ciwrhdw47dn65i6")))) (arguments `(#:phases (modify-phases %standard-phases @@ -707,7 +721,8 @@ OpenGL graphics API.") (native-inputs `(("pkg-config" ,pkg-config) ("python" ,python))) - (inputs + (propagated-inputs + ;; epoxy.pc: 'Requires.private: gl egl' `(("mesa" ,mesa))) (home-page "https://github.com/anholt/libepoxy/") (synopsis "A library for handling OpenGL function pointer management") |