mesa/subprojects
Paolo Bonzini 8ea232a9ae meson: rename Rust subprojects to NAME-SEMVER-rs
Use the convention for Rust subprojects that was adopted by Meson 1.5.0
and newer.

Distros would prefer to avoid vendored crate sources, and instead use
local sources from e.g. /usr/share/cargo/registry.  While Meson does not
support a local registry, it can be emulated with MESON_PACKAGE_CACHE_DIR.

However, because the distro might not be using the exact version of the
package, but only one that has the same semver, packagers need to add
some hacks to rewrite the wrap files.  For example, in Fedora:

    export MESON_PACKAGE_CACHE_DIR="%{cargo_registry}/"
    # So... Meson can't actually find them without tweaks
    %define inst_crate_nameversion() %(basename %{cargo_registry}/%{1}-*)
    %define rewrite_wrap_file() sed -e "/source.*/d" -e "s/%{1}-.*/%{inst_crate_nameversion %{1}}/" -i subprojects/%{1}.wrap
    %rewrite_wrap_file proc-macro2
    %rewrite_wrap_file quote
    %rewrite_wrap_file syn
    %rewrite_wrap_file unicode-ident
    %rewrite_wrap_file paste

Having a common convention for the name of Rust wraps makes it possible
to perform this transformation with a script without listing
the wraps one by one, and to share the script across multiple packages
(which will be useful when QEMU starts using Rust in a similar way to Mesa).

For an example of such a script, see
https://lore.kernel.org/r/20250722083507.678542-1-pbonzini@redhat.com/.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36284>
2025-07-24 17:52:34 +00:00
..
packagefiles meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
.gitignore subprojects: Don't ignore Meson wrappers in gitignore 2025-05-18 13:56:34 +00:00
bitflags-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
cfg-if-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
DirectX-Headers.wrap ci: Bump DirectX-Headers and Agility SDK dependencies to 1.614.1 2024-09-12 15:01:18 +00:00
equivalent-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
errno-0.3-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
expat.wrap meson: update expat wrap 2023-12-28 13:17:25 +00:00
hashbrown-0.14-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
indexmap-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
libarchive.wrap meson: update libarchive wrap 2023-12-28 13:17:25 +00:00
libc-0.2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
libdrm.wrap meson: add wrap for libdrm 2025-05-27 16:07:29 +00:00
libxml2.wrap meson: update libxml2 wrap 2023-12-28 13:17:25 +00:00
log-0.4-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
lua.wrap meson: Update lua wrap to 5.4.6-4 2023-11-15 13:29:20 +00:00
once_cell-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
paste-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
perfetto.wrap subprojects: perfetto uprev to v47.0 2024-08-08 19:29:00 +00:00
pest-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
pest_derive-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
pest_generator-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
pest_meta-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
proc-macro2-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
quote-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
remain-0.2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
roxmltree-0.20-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
rustc-hash-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
rustix-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
syn-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
thiserror-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
thiserror-impl-2-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
ucd-trie-0.1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
unicode-ident-1-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
wayland-protocols.wrap meson: update wayland-protocols source_hash 2025-02-26 10:53:25 +00:00
zerocopy-0.8-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
zerocopy-derive-0.8-rs.wrap meson: rename Rust subprojects to NAME-SEMVER-rs 2025-07-24 17:52:34 +00:00
zlib.wrap meson: upgrade zlib wrap to 1.3.1 2024-02-06 19:22:53 +00:00