feat: adding the asahi configuration

This commit is contained in:
EniumRaphael 2025-02-13 21:05:38 +01:00
parent 56cfb5d7b0
commit 7609e5bf35
22 changed files with 8986 additions and 0 deletions

View file

@ -0,0 +1,44 @@
{ lib
, fetchFromGitLab
, mesa
}:
(mesa.override {
galliumDrivers = [ "softpipe" "llvmpipe" "asahi" ];
vulkanDrivers = [ "swrast" "asahi" ];
}).overrideAttrs (oldAttrs: {
version = "25.0.0-asahi";
src = fetchFromGitLab {
# tracking: https://pagure.io/fedora-asahi/mesa/commits/asahi
domain = "gitlab.freedesktop.org";
owner = "asahi";
repo = "mesa";
rev = "asahi-20241211";
hash = "sha256-Ny4M/tkraVLhUK5y6Wt7md1QBtqQqPDUv+aY4MpNA6Y=";
};
mesonFlags = let
badFlags = [
"-Dinstall-mesa-clc"
"-Dopencl-spirv"
"-Dgallium-nine"
];
isBadFlagList = f: builtins.map (b: lib.hasPrefix b f) badFlags;
isGoodFlag = f: !(builtins.foldl' (x: y: x || y) false (isBadFlagList f));
in (builtins.filter isGoodFlag oldAttrs.mesonFlags) ++ [
# we do not build any graphics drivers these features can be enabled for
"-Dgallium-va=disabled"
"-Dgallium-vdpau=disabled"
"-Dgallium-xa=disabled"
];
# replace patches with ones tweaked slightly to apply to this version
patches = [
./opencl.patch
];
postInstall = (oldAttrs.postInstall or "") + ''
# we don't build anything to go in this output but it needs to exist
touch $spirv2dxil
'';
})

View file

@ -0,0 +1,72 @@
From 01607231c06a2c2adf0eb63f2a49a33e65a2a592 Mon Sep 17 00:00:00 2001
From: Thomas Watson <twatson52@icloud.com>
Date: Sat, 30 Nov 2024 15:28:20 -0600
Subject: [PATCH] opencl.patch from nixpkgs
abd1d7f93319df76c6fee7aee7ecd39ec6136d62
---
meson.build | 2 +-
meson_options.txt | 6 ++++++
src/gallium/targets/opencl/meson.build | 2 +-
src/gallium/targets/rusticl/meson.build | 2 +-
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index db2e404a3fc..108044b0949 100644
--- a/meson.build
+++ b/meson.build
@@ -1857,7 +1857,7 @@ endif
dep_clang = null_dep
if with_clc or with_gallium_clover
- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
+ llvm_libdir = get_option('clang-libdir')
dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false)
diff --git a/meson_options.txt b/meson_options.txt
index 42e819dacd2..78da6e52976 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -29,6 +29,12 @@ option(
description : 'the window system EGL assumes for EGL_DEFAULT_DISPLAY',
)
+option(
+ 'clang-libdir',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for clang libraries.'
+)
option(
'android-stub',
type : 'boolean',
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index ab2c83556a8..a59e88e122f 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -56,7 +56,7 @@ if with_opencl_icd
configuration : _config,
input : 'mesa.icd.in',
output : 'mesa.icd',
- install : true,
+ install : false,
install_tag : 'runtime',
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)
diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
index 2b214adbbf5..7f919397ad5 100644
--- a/src/gallium/targets/rusticl/meson.build
+++ b/src/gallium/targets/rusticl/meson.build
@@ -64,7 +64,7 @@ configure_file(
configuration : _config,
input : 'rusticl.icd.in',
output : 'rusticl.icd',
- install : true,
+ install : false,
install_tag : 'runtime',
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)
--
2.47.0