diff mbox series

[bug#61959,v4,4/7] gnu: Add asahi-mesa.

Message ID 25385bc6a85a4dc596bd07fde437666cbf81f75d.1678277362.git.roman@burningswell.com
State New
Headers show
Series Change patch order | expand

Commit Message

Roman Scherer March 8, 2023, 12:13 p.m. UTC
* gnu/packages/gl.scm (asahi-mesa): New variable.
---
 gnu/packages/gl.scm | 49 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 4ae96032cd..3b3985df71 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -52,6 +52,7 @@  (define-module (gnu packages gl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages video)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages xdisorg)
@@ -612,6 +613,54 @@  (define-public mesa-utils
     ;; glxdemo is public domain; others expat.
     (license (list license:expat license:public-domain))))
 
+(define-public asahi-mesa
+  (let ((commit "0a12b60a6b4363315ca3789e7e289240704a26da"))
+    (package/inherit mesa
+      (name "asahi-mesa")
+      (version (git-version "20221229" "0" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://gitlab.freedesktop.org/asahi/mesa")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0yjn55qy4890gi1s3dhzdhqqxrms4fzcibqr84a3vcc53ggiywmb"))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments mesa)
+         ((#:configure-flags flags)
+          `(list "-Db_ndebug=true"
+                 "-Db_lto=false"
+                 "-Ddri3=enabled"
+                 "-Degl=enabled"
+                 "-Dgallium-drivers=swrast,virgl,kmsro,asahi"
+                 "-Dgallium-extra-hud=true"
+                 "-Dgallium-opencl=disabled"
+                 "-Dgallium-rusticl=false"
+                 "-Dgallium-va=disabled"
+                 "-Dgallium-vdpau=disabled"
+                 "-Dgallium-xa=disabled"
+                 "-Dgbm=enabled"
+                 "-Dgles1=disabled"
+                 "-Dgles2=enabled"
+                 "-Dglx=dri"
+                 "-Dlibunwind=disabled"
+                 "-Dllvm=enabled"
+                 "-Dlmsensors=enabled"
+                 "-Dmicrosoft-clc=disabled"
+                 "-Dosmesa=true"
+                 "-Dplatforms=x11,wayland"
+                 "-Dshared-glapi=enabled"
+                 "-Dvalgrind=enabled"
+                 "-Dvulkan-drivers=swrast"
+                 "-Dvulkan-layers="))))
+      (inputs
+       (modify-inputs (package-inputs mesa)
+         (prepend `(,lm-sensors "lib") libglvnd libressl valgrind)
+         (replace "llvm" llvm-15)
+         (replace "wayland-protocols" wayland-protocols-next))))))
+
 (define-public glew
   (package
     (name "glew")