port to meson cargo
Some checks failed
Gentoo Utils / build-oci-image (push) Successful in 10m53s
Gentoo Utils / check-format (push) Failing after 1m0s
Gentoo Utils / docs (push) Failing after 58s
Gentoo Utils / grep (push) Successful in 56s
Gentoo Utils / build (push) Failing after 1m2s
Gentoo Utils / test (push) Has been skipped
Gentoo Utils / fuzz (push) Has been skipped

Use the new unstable meson cargo support. This simplifies the
meson.build script and allows to use crates such as clap that require
picking up features from Cargo.toml.

This also allows us to not embed thiserror in subprojects, and instead
to simply place some patches and a meson.build in a specific directory
and meson will automatically pick them up.
This commit is contained in:
2025-12-21 04:20:53 +00:00
parent 0ec8567972
commit 50a911a43c
124 changed files with 44 additions and 6186 deletions

View File

@@ -7,24 +7,20 @@ project(
rustfmt = find_program('rustfmt')
rust = import('rust')
fs = import('fs')
sources = []
subdir('src')
rust = import('rust')
cargo = rust.workspace()
mon = dependency('mon-0.1-rs')
get = dependency('get-0.1-rs')
itertools = dependency('itertools-0.14-rs')
thiserror = subproject('thiserror').get_variable('thiserror')
thiserror = dependency('thiserror-2-rs')
gentoo_utils = static_library(
'gentoo_utils',
'src/lib.rs',
dependencies: [mon, get, itertools],
link_with: [thiserror],
)
gentoo_utils = cargo.package().library()
sources = []
subdir('src')
custom_target(
'rustfmt',
@@ -47,8 +43,7 @@ if get_option('docs').enabled()
rust.doctest(
'doctests',
gentoo_utils,
dependencies: [mon, get, itertools],
link_with: [thiserror],
dependencies: [mon, get, itertools, thiserror],
args: ['--nocapture'],
)
endif