mesa: 22.2.5 -> 22.3.1, enable rusticl

This commit is contained in:
K900 2022-12-02 18:15:42 +03:00
parent 804a0f037d
commit cd53c071f2
2 changed files with 51 additions and 15 deletions

View file

@ -19,6 +19,10 @@
, enablePatentEncumberedCodecs ? true
, libclc
, jdupes
, cmake
, rustc
, rust-bindgen
, spirv-llvm-translator_14
}:
/** Packaging design:
@ -37,9 +41,15 @@ with lib;
let
# Release calendar: https://www.mesa3d.org/release-calendar.html
# Release frequency: https://www.mesa3d.org/releasing.html#schedule
version = "22.2.5";
version = "22.3.1";
branch = versions.major version;
rust-bindgen' = rust-bindgen.override {
rust-bindgen-unwrapped = rust-bindgen.unwrapped.override {
clang = llvmPackages.clang;
};
};
self = stdenv.mkDerivation {
pname = "mesa";
inherit version;
@ -52,7 +62,7 @@ self = stdenv.mkDerivation {
"ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
"ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
];
sha256 = "sha256-hQ8GMUb467JirsBPZmwsHlYj8qGYfdok5DYbF7kSxzs=";
sha256 = "sha256-PJzWEcCFnTB6ugZZgzOGq9ykyGFi08J1ulvmLRbPMes=";
};
# TODO:
@ -105,7 +115,6 @@ self = stdenv.mkDerivation {
"-Ddri-drivers-path=${placeholder "drivers"}/lib/dri"
"-Dvdpau-libs-path=${placeholder "drivers"}/lib/vdpau"
"-Dxvmc-libs-path=${placeholder "drivers"}/lib"
"-Domx-libs-path=${placeholder "drivers"}/lib/bellagio"
"-Dva-libs-path=${placeholder "drivers"}/lib/dri"
"-Dd3d-drivers-path=${placeholder "drivers"}/lib/d3d"
@ -119,6 +128,7 @@ self = stdenv.mkDerivation {
"-Dglvnd=true"
] ++ optionals enableOpenCL [
"-Dgallium-opencl=icd" # Enable the gallium OpenCL frontend
"-Dgallium-rusticl=true" "-Drust_std=2021"
"-Dclang-libdir=${llvmPackages.clang-unwrapped.lib}/lib"
] ++ optional enablePatentEncumberedCodecs
"-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec"
@ -132,7 +142,7 @@ self = stdenv.mkDerivation {
] ++ lib.optionals (elem "wayland" eglPlatforms) [ wayland wayland-protocols ]
++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ]
++ lib.optionals stdenv.isDarwin [ libunwind ]
++ lib.optionals enableOpenCL [ libclc llvmPackages.clang llvmPackages.clang-unwrapped ]
++ lib.optionals enableOpenCL [ libclc llvmPackages.clang llvmPackages.clang-unwrapped rustc rust-bindgen' spirv-llvm-translator_14 ]
++ lib.optional withValgrind valgrind-light
# Mesa will not build zink when gallium-drivers=auto
++ lib.optional (elem "zink" galliumDrivers) vulkan-loader;
@ -188,12 +198,12 @@ self = stdenv.mkDerivation {
mkdir -p $opencl/lib
mv -t "$opencl/lib/" \
$out/lib/gallium-pipe \
$out/lib/libMesaOpenCL*
$out/lib/lib*OpenCL*
# We construct our own .icd file that contains an absolute path.
rm -r $out/etc/OpenCL
# We construct our own .icd files that contain absolute paths.
mkdir -p $opencl/etc/OpenCL/vendors/
echo $opencl/lib/libMesaOpenCL.so > $opencl/etc/OpenCL/vendors/mesa.icd
echo $opencl/lib/libRusticlOpenCL.so > $opencl/etc/OpenCL/vendors/rusticl.icd
'' + lib.optionalString enableOSMesa ''
# move libOSMesa to $osmesa, as it's relatively big
mkdir -p $osmesa/lib

View file

@ -1,5 +1,18 @@
diff --git a/meson.build b/meson.build
index e32338b3f9a..fae804fd41e 100644
--- a/meson.build
+++ b/meson.build
@@ -1894,7 +1894,7 @@ endif
dep_clang = null_dep
if with_clc
- 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 b8f753e2e1a..2163e3ab7ee 100644
index 6f307018815..ab84eb1006c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -18,6 +18,12 @@
@ -16,7 +29,7 @@ index b8f753e2e1a..2163e3ab7ee 100644
'platforms',
type : 'array',
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index 14df6b86f7f..adcd5110342 100644
index 7af210b5693..ff6ac8c61ca 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -30,6 +30,7 @@ if with_ld_version_script
@ -29,7 +42,7 @@ index 14df6b86f7f..adcd5110342 100644
polly_dep = null_dep
@@ -60,19 +61,19 @@ else
endif
if not (dep_clang.found() and dep_clang_usable)
if not _shared_llvm or not (dep_clang.found() and dep_clang_usable)
dep_clang = [
- cpp.find_library('clangCodeGen', dirs : llvm_libdir),
- cpp.find_library('clangFrontendTool', dirs : llvm_libdir),
@ -60,12 +73,25 @@ index 14df6b86f7f..adcd5110342 100644
polly_dep, polly_isl_dep,
]
# check clang once more
@@ -112,7 +113,7 @@ if with_opencl_icd
@@ -119,7 +120,7 @@ if with_opencl_icd
configuration : _config,
input : 'mesa.icd.in',
output : 'mesa.icd',
install : true,
- install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
+ install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'),
- install : true,
+ install : false,
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)
if meson.version().version_compare('>= 0.58')
diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build
index a968dee52db..69475cf3133 100644
--- a/src/gallium/targets/rusticl/meson.build
+++ b/src/gallium/targets/rusticl/meson.build
@@ -58,7 +58,7 @@ configure_file(
configuration : _config,
input : 'rusticl.icd.in',
output : 'rusticl.icd',
- install : true,
+ install : false,
install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
)