Signed-off-by: Zhao Liu <zhao1....@intel.com> --- scripts/archive-source.sh | 2 +- scripts/make-release | 2 +- subprojects/.gitignore | 1 + .../thiserror-impl-1-rs/meson.build | 41 +++++++++++++++++++ subprojects/thiserror-impl-1-rs.wrap | 10 +++++ 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 subprojects/packagefiles/thiserror-impl-1-rs/meson.build create mode 100644 subprojects/thiserror-impl-1-rs.wrap
diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 035828c532e7..8d8a0d37ecdc 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -31,7 +31,7 @@ subprojects="keycodemapdb libvfio-user berkeley-softfloat-3 bilge-impl-0.2-rs either-1-rs foreign-0.3-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs - syn-2-rs unicode-ident-1-rs" + syn-2-rs thiserror-impl-1-rs unicode-ident-1-rs" sub_deinit="" function cleanup() { diff --git a/scripts/make-release b/scripts/make-release index 4509a9fabf50..3d3d8d4a51bc 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -44,7 +44,7 @@ SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3 bilge-impl-0.2-rs either-1-rs foreign-0.3-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs - syn-2-rs unicode-ident-1-rs" + syn-2-rs thiserror-impl-1-rs unicode-ident-1-rs" src="$1" version="$2" diff --git a/subprojects/.gitignore b/subprojects/.gitignore index f4281934ce11..e6ea570a2286 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -19,4 +19,5 @@ /proc-macro2-1.0.84 /quote-1.0.36 /syn-2.0.66 +/thiserror-impl-1.0.65 /unicode-ident-1.0.12 diff --git a/subprojects/packagefiles/thiserror-impl-1-rs/meson.build b/subprojects/packagefiles/thiserror-impl-1-rs/meson.build new file mode 100644 index 000000000000..cc5546264035 --- /dev/null +++ b/subprojects/packagefiles/thiserror-impl-1-rs/meson.build @@ -0,0 +1,41 @@ +project('thiserror-impl-1-rs', 'rust', + meson_version: '>=1.5.0', + version: '1.0.65', + license: 'MIT OR Apache-2.0', + default_options: []) + +subproject('quote-1-rs', required: true) +subproject('syn-2-rs', required: true) +subproject('proc-macro2-1-rs', required: true) + +quote_dep = dependency('quote-1-rs', native: true) +syn_dep = dependency('syn-2-rs', native: true) +proc_macro2_dep = dependency('proc-macro2-1-rs', native: true) + +rust = import('rust') + +_thiserror_impl_rs = rust.proc_macro( + 'thiserror_impl', + files('src/lib.rs'), + override_options: ['rust_std=2021', 'build.rust_std=2021'], + rust_args: [ + '--cfg', 'feature="proc-macro"', + '--cfg', 'feature="clone-impls"', + '--cfg', 'feature="derive"', + '--cfg', 'feature="extra-traits"', + '--cfg', 'feature="full"', + '--cfg', 'feature="parsing"', + '--cfg', 'feature="printing"', + ], + dependencies: [ + quote_dep, + syn_dep, + proc_macro2_dep + ], +) + +thiserror_impl_dep = declare_dependency( + link_with: _thiserror_impl_rs, +) + +meson.override_dependency('thiserror-impl-1-rs', thiserror_impl_dep) diff --git a/subprojects/thiserror-impl-1-rs.wrap b/subprojects/thiserror-impl-1-rs.wrap new file mode 100644 index 000000000000..0f2ca85b8590 --- /dev/null +++ b/subprojects/thiserror-impl-1-rs.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = thiserror-impl-1.0.65 +source_url = https://crates.io/api/v1/crates/thiserror-impl/1.0.65/download +source_filename = thiserror-impl-1.0.65.tar.gz +source_hash = ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602 +#method = cargo +patch_directory = thiserror-impl-1-rs + +# bump this version number on every change to meson.build or the patches: +# v2 -- 2.34.1