Simplify build-system further

Remove Fragile from the list of dependencies

It is not necessary for building 'gio' anymore,
since the upgrade to 'glib v2_58'.

Remove "online" and "reset_lock" Meson-options

Building Squeekboard should work offline.

Use a single "Cargo.toml"-file instead of splitting it into parts

and putting it back together when building.

Part-of: <https://gitlab.gnome.org/World/Phosh/squeekboard/-/merge_requests/623>
This commit is contained in:
MoonlightWave-12
2024-03-11 10:40:54 +01:00
parent 9cb6817da9
commit 5806b14628
8 changed files with 36 additions and 91 deletions

View File

@ -85,45 +85,15 @@ summary = [
]
message('\n'.join(summary))
# Rust deps are changing, depending on compile flags. Cargo can't handle it alone.
# As a side effect, Cargo.toml never gets used.
cargo_toml_in = files('Cargo.toml.in')
path_data = configuration_data()
path_data.set('path', meson.source_root())
cargo_toml_base = configure_file(
input: 'Cargo.toml.in',
output: 'Cargo.toml.base',
cargo_toml = configure_file(
input: 'Cargo.toml',
output: 'Cargo.toml',
configuration: path_data,
)
cargo_patch = []
cargo_build_flags += ['--features', 'zbus_v1_5,clap_v4']
cargo_deps = files('Cargo.deps')
cargo_lock = files('Cargo.lock')
if get_option('online') == true
cargo_patch = [files('Cargo.deps.online')]
endif
cat = find_program('cat')
cargo_toml = custom_target(
'Cargo.toml',
output: 'Cargo.toml',
command: [cat, cargo_toml_base, cargo_deps] + cargo_patch,
capture: true,
)
cargo_deps = [cargo_toml]
if get_option('online') == true and get_option('reset_lock') == true
cargo_lock = custom_target(
'Cargo.lock',
output: 'Cargo.lock',
command: [cat, cargo_lock],
capture: true,
)
cargo_deps += [cargo_lock]
endif
dep_cargo = find_program('cargo')
cargo_script = find_program('cargo.sh')