Skip to content

Instantly share code, notes, and snippets.

@thenhnn
Created March 8, 2025 19:35
Show Gist options
  • Save thenhnn/efd3d30946b376f1fe9d3d2972c3a253 to your computer and use it in GitHub Desktop.
Save thenhnn/efd3d30946b376f1fe9d3d2972c3a253 to your computer and use it in GitHub Desktop.
mesa-asahi-edge on latest nixpkgs
diff --git a/meson.build b/meson.build
index c150bff74ff..37fa7f0531b 100644
--- a/meson.build
+++ b/meson.build
@@ -1850,7 +1850,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 b/meson.options
index 82324617884..4bde97a8568 100644
--- a/meson.options
+++ b/meson.options
@@ -738,3 +738,10 @@ option(
'none', 'dri2'
],
)
+
+option(
+ 'clang-libdir',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for clang libraries.'
+)
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 35833dc7423..41a95927cab 100644
--- a/src/gallium/targets/rusticl/meson.build
+++ b/src/gallium/targets/rusticl/meson.build
@@ -63,7 +63,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'),
)
{
lib,
fetchFromGitLab,
mesa,
}:
(mesa.override {
galliumDrivers = ["softpipe" "llvmpipe" "asahi"];
vulkanDrivers = ["swrast" "asahi"];
})
.overrideAttrs (oldAttrs: {
version = "25.1.0-asahi";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "asahi";
repo = "mesa";
rev = "asahi-20250221";
hash = "sha256-xt49IaylZYoH3LxYu6Uxd+qRrqQfjI6FDeAD8MLeWP8=";
};
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"
];
patches = [
./opencl.patch
];
postInstall =
(oldAttrs.postInstall or "")
+ ''
# we don't build anything to go in this output but it needs to exist
touch $spirv2dxil
touch $cross_tools
'';
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment