85 lines
2.3 KiB
Meson
85 lines
2.3 KiB
Meson
project(
|
|
'ca-certs',
|
|
version: '0.1.0',
|
|
meson_version: '>=0.60.0',
|
|
)
|
|
|
|
cargo = find_program('cargo', required: true)
|
|
sh = find_program('sh', required: true)
|
|
|
|
# Track Rust inputs explicitly so Meson knows when the Cargo build output is stale.
|
|
tracked_rust_inputs = files(
|
|
'Cargo.toml',
|
|
'Cargo.lock',
|
|
'src/main.rs',
|
|
)
|
|
|
|
# Track packaging assets in one place so install rules stay auditable.
|
|
tracked_packaging_assets = files(
|
|
'LICENSE',
|
|
'contrib/ca-certs.8',
|
|
'contrib/completions/ca-certs.bash',
|
|
'contrib/completions/ca-certs.fish',
|
|
'contrib/completions/_ca-certs',
|
|
)
|
|
|
|
tracked_install_paths = [
|
|
join_paths(get_option('bindir'), 'ca-certs'),
|
|
join_paths(get_option('datadir'), 'licenses', meson.project_name(), 'LICENSE'),
|
|
join_paths(get_option('mandir'), 'man8', 'ca-certs.8'),
|
|
join_paths(get_option('datadir'), 'bash-completion', 'completions', 'ca-certs'),
|
|
join_paths(get_option('datadir'), 'fish', 'vendor_completions.d', 'ca-certs.fish'),
|
|
join_paths(get_option('datadir'), 'zsh', 'site-functions', '_ca-certs'),
|
|
]
|
|
|
|
cargo_target_dir = meson.current_build_dir() / 'cargo-target'
|
|
|
|
ca_certs_bin = custom_target(
|
|
'ca-certs-bin',
|
|
output: 'ca-certs',
|
|
depend_files: tracked_rust_inputs,
|
|
command: [
|
|
sh, '-c',
|
|
'set -eu; src="$1"; out="$2"; target_dir="$3"; cd "$src"; CARGO_TARGET_DIR="$target_dir" "$4" build --locked --release; cp "$target_dir/release/ca-certs" "$out"',
|
|
'meson-cargo-build',
|
|
meson.project_source_root(),
|
|
'@OUTPUT@',
|
|
cargo_target_dir,
|
|
cargo,
|
|
],
|
|
build_by_default: true,
|
|
console: true,
|
|
install: true,
|
|
install_dir: get_option('bindir'),
|
|
)
|
|
|
|
install_data(
|
|
'contrib/ca-certs.8',
|
|
install_dir: join_paths(get_option('mandir'), 'man8'),
|
|
)
|
|
|
|
install_data(
|
|
'contrib/completions/ca-certs.bash',
|
|
install_dir: join_paths(get_option('datadir'), 'bash-completion', 'completions'),
|
|
rename: 'ca-certs',
|
|
)
|
|
|
|
install_data(
|
|
'contrib/completions/ca-certs.fish',
|
|
install_dir: join_paths(get_option('datadir'), 'fish', 'vendor_completions.d'),
|
|
)
|
|
|
|
install_data(
|
|
'contrib/completions/_ca-certs',
|
|
install_dir: join_paths(get_option('datadir'), 'zsh', 'site-functions'),
|
|
)
|
|
|
|
summary(
|
|
{
|
|
'tracked rust inputs': tracked_rust_inputs.length(),
|
|
'tracked packaging assets': tracked_packaging_assets.length(),
|
|
'tracked install paths': '\n ' + '\n '.join(tracked_install_paths),
|
|
},
|
|
section: 'Packaging',
|
|
)
|