From c1f979d84a78bfdd308f107ae6ce3f779d9411bf Mon Sep 17 00:00:00 2001 From: Mel Henning Date: Tue, 6 May 2025 19:41:13 -0400 Subject: [PATCH] nak: Add a dependency on rustc-hash Part-of: --- .gitlab-ci/meson/build.sh | 1 + src/nouveau/compiler/meson.build | 6 +++++ .../packagefiles/rustc-hash/meson.build | 23 +++++++++++++++++++ subprojects/rustc-hash.wrap | 6 +++++ 4 files changed, 36 insertions(+) create mode 100644 subprojects/packagefiles/rustc-hash/meson.build create mode 100644 subprojects/rustc-hash.wrap diff --git a/.gitlab-ci/meson/build.sh b/.gitlab-ci/meson/build.sh index b0e02a7f8a2..758b9b2bc71 100755 --- a/.gitlab-ci/meson/build.sh +++ b/.gitlab-ci/meson/build.sh @@ -151,6 +151,7 @@ meson_subprojects=( pest_generator pest_meta roxmltree + rustc-hash indexmap ${FORCE_FALLBACK_FOR:-} ) diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build index 55f92c2b5b2..d7332e11154 100644 --- a/src/nouveau/compiler/meson.build +++ b/src/nouveau/compiler/meson.build @@ -22,6 +22,11 @@ dep_paste = dependency('paste', required : true, ) +dep_rustc_hash = dependency('rustc-hash', + fallback: ['rustc-hash', 'dep_rustc_hash'], + required: true, +) + libnak_c_files = files( 'nak.h', 'nak_nir.c', @@ -123,6 +128,7 @@ _libnak_rs = static_library( ], dependencies : [ dep_paste, + dep_rustc_hash, idep_compiler_rs, idep_nvidia_headers_rs, ], diff --git a/subprojects/packagefiles/rustc-hash/meson.build b/subprojects/packagefiles/rustc-hash/meson.build new file mode 100644 index 00000000000..4da750c91b1 --- /dev/null +++ b/subprojects/packagefiles/rustc-hash/meson.build @@ -0,0 +1,23 @@ +project( + 'rustc_hash', + 'rust', + version : '2.1.1', + license :'MIT OR Apache-2.0', +) + +rust_args = [ + '--cfg', 'feature="std"' +] + +lib = static_library( + 'rustc_hash', + 'src/lib.rs', + rust_args : rust_args, + override_options : ['rust_std=2021', 'build.rust_std=2021'], + rust_abi : 'rust', + native : true, +) + +dep_rustc_hash = declare_dependency( + link_with : [lib], +) diff --git a/subprojects/rustc-hash.wrap b/subprojects/rustc-hash.wrap new file mode 100644 index 00000000000..cc8eef99150 --- /dev/null +++ b/subprojects/rustc-hash.wrap @@ -0,0 +1,6 @@ +[wrap-file] +directory = rustc-hash-2.1.1 +source_url = https://crates.io/api/v1/crates/rustc-hash/2.1.1/download +source_filename = rustc-hash-2.1.1.tar.gz +source_hash = 357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d +patch_directory = rustc-hash