aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/gl.scm
diff options
context:
space:
mode:
authoraurtzy <aurtzy@gmail.com>2024-09-09 12:12:11 -0400
committerJohn Kehayias <john.kehayias@protonmail.com>2024-11-05 11:56:44 -0500
commit6832edf8044cac6514a9e23536b31b4d0a3919f8 (patch)
tree5ae1e40901730584457bab8830a2beea13ec797a /gnu/packages/gl.scm
parentf0dbb3d39cb49300285e9e97e1ee2659ead335b6 (diff)
downloadguix-6832edf8044cac6514a9e23536b31b4d0a3919f8.tar.gz
guix-6832edf8044cac6514a9e23536b31b4d0a3919f8.zip
gnu: mesa: Enable NVK driver for x86_64 architecture.
* gnu/packages/gl.scm (mesa)[native-inputs]: Add rust, rust-bindgen-cli, rust-cbindgen-0.26 for x86_64. [arguments]<#:meson>: Use newer version of meson to satisfy NVK build requirements. <#:configure-flags>: Use "auto" for 'vulkan-drivers' flag when target arch is x86_64. <#:phases>: Add 'patch-subproject-sources phase to patch rust subproject sources when target arch is x86_64. * gnu/packages/crates-io.scm (rust-paste-1, rust-proc-macro2-1, rust-quote-1, rust-syn-2, rust-unicode-ident-1): Add a comment about being dependencies of mesa. Change-Id: I76e3db5072ca3c718155b188ca64b52766d55f36 Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
Diffstat (limited to 'gnu/packages/gl.scm')
-rw-r--r--gnu/packages/gl.scm64
1 files changed, 62 insertions, 2 deletions
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index c977c03949..14b24d3158 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2024 Liliana Marie Prikler <liliana.prikler@gmail.com>
;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;; Copyright © 2024 Arnaud Lechevallier <arnaud.lechevallier@free.fr>
+;;; Copyright © 2024 aurtzy <aurtzy@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,6 +43,7 @@
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bison)
+ #:use-module (gnu packages build-tools)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages documentation)
@@ -57,6 +59,7 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages rust)
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages vulkan)
@@ -76,7 +79,8 @@
#:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (ice-9 match)
- #:use-module ((srfi srfi-1) #:hide (zip)))
+ #:use-module ((srfi srfi-1) #:hide (zip))
+ #:use-module (srfi srfi-26))
(define-public glu
(package
@@ -357,10 +361,19 @@ also known as DXTn or DXTC) for Mesa.")
pkg-config-for-build
wayland
wayland-protocols)
+ '())
+ (if (target-x86-64?)
+ ;; NVK dependencies
+ (list rust
+ (module-ref (resolve-interface '(gnu packages rust-apps))
+ 'rust-bindgen-cli)
+ (module-ref (resolve-interface '(gnu packages rust-apps))
+ 'rust-cbindgen-0.26))
'())))
(outputs '("out" "bin"))
(arguments
(list
+ #:meson meson-1.5
#:configure-flags
#~(list
#$@(cond
@@ -392,7 +405,7 @@ panfrost,r300,r600,svga,softpipe,llvmpipe,tegra,v3d,vc4,virgl,zink"))
"-Dshared-glapi=enabled"
#$@(cond
- ((or (target-x86-32?) (target-x86-64?))
+ ((target-x86-32?)
;; This doesn't include nouveau (which is in "auto") as it needs
;; rust.
;; TODO: Enable nouveau/NVK.
@@ -486,6 +499,53 @@ panfrost,r300,r600,svga,softpipe,llvmpipe,tegra,v3d,vc4,virgl,zink"))
(("'lp_test_arit', ") ""))))
(_
'((display "No tests to disable on this architecture.\n"))))))
+ #$@(if (target-x86-64?)
+ #~((add-after 'unpack 'patch-subproject-sources
+ (lambda _
+ ;; Patch each relevant subproject source URL in wrapfiles to
+ ;; use the store, which avoids an attempt to download them
+ ;; mid-build.
+ (for-each
+ (match-lambda
+ ((name source)
+ (let ((wrap-file (string-append
+ "subprojects/" name ".wrap"))
+ (subproject-dest (string-append
+ "subprojects/" name))
+ (overlay-dir (string-append
+ "subprojects/packagefiles/" name)))
+ (copy-recursively source subproject-dest)
+ ;; Normally when the patch_directory wrap file property
+ ;; is specified, meson automatically copies from
+ ;; packagefiles, but this is not the case here (only
+ ;; happens when downloading source?) so we manually copy
+ ;; overlay-dir to subproject-dest.
+ (when (file-exists? overlay-dir)
+ (copy-recursively overlay-dir subproject-dest))
+ (call-with-output-file wrap-file
+ (lambda (port)
+ (format port "[wrap-file]
+directory = ~a
+"
+ name))))))
+ '#+(map (lambda (pkg)
+ (let ((name (package-upstream-name* pkg))
+ (version (package-version pkg)))
+ (list (package-upstream-name* pkg)
+ (file-append pkg
+ "/share/cargo/src/"
+ name "-" version))))
+ (let ((from-crates-io
+ (cut module-ref
+ (resolve-interface
+ '(gnu packages crates-io))
+ <>)))
+ (list (from-crates-io 'rust-syn-2)
+ (from-crates-io 'rust-unicode-ident-1)
+ (from-crates-io 'rust-quote-1)
+ (from-crates-io 'rust-proc-macro2-1)
+ (from-crates-io 'rust-paste-1))))))))
+ #~())
(add-before 'configure 'fix-dlopen-libnames
(lambda* (#:key inputs #:allow-other-keys)
(let ((out #$output))