2023-12-01 23:37:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2023-12-17 20:01:40 +00:00
|
|
|
for manifest in "$MESON_SOURCE_ROOT"/scheds/rust/*/Cargo.toml; do
|
2023-12-01 23:37:28 +00:00
|
|
|
source_dir="${manifest%/Cargo.toml}"
|
2024-08-25 11:03:41 +01:00
|
|
|
target_dir="${MESON_BUILD_ROOT}/scheds/rust"
|
|
|
|
name="${source_dir##*/}"
|
2023-12-01 23:37:28 +00:00
|
|
|
|
2024-07-14 19:21:14 +01:00
|
|
|
# Skip scx_mitosis
|
|
|
|
if [ "$name" = "scx_mitosis" ]; then
|
|
|
|
echo "Skipping installation of $name"
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
2023-12-03 21:47:02 +00:00
|
|
|
bins=($(ls -t "${target_dir}/"*"/${name}"))
|
|
|
|
if [ ${#bins[@]} -lt 1 ]; then
|
|
|
|
echo "Cannot find a binary for $name under $target_dir" 1>&2
|
2023-12-01 23:37:28 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-12-03 21:47:02 +00:00
|
|
|
# XXX - Can we detect the current buildtype and install the correct one?
|
|
|
|
if [ ${#bins[@]} -gt 1 ]; then
|
|
|
|
echo "Found multiple binaries for $name under $target_dir, installing the latest which may not be what you want" 1>&2
|
|
|
|
fi
|
|
|
|
|
2023-12-01 23:37:28 +00:00
|
|
|
install -D "${bins[0]}" "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin/${name}"
|
|
|
|
done
|