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-09-09 01:23:48 +01:00
|
|
|
target_dir="${MESON_BUILD_ROOT}"
|
2024-08-25 11:03:41 +01:00
|
|
|
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
|
2024-08-25 12:05:09 +01:00
|
|
|
echo "Cannot find a binary for $name under $target_dir" 1>&2
|
|
|
|
exit 1
|
2023-12-01 23:37:28 +00:00
|
|
|
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
|
2024-08-25 12:05:09 +01:00
|
|
|
echo "Found multiple binaries for $name under $target_dir, installing the latest which may not be what you want" 1>&2
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -D "${bins[0]}" "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin/${name}"
|
|
|
|
done
|
|
|
|
|
|
|
|
for manifest in "$MESON_SOURCE_ROOT"/rust/*/Cargo.toml; do
|
|
|
|
source_dir="${manifest%/Cargo.toml}"
|
2024-09-09 01:23:48 +01:00
|
|
|
target_dir="${MESON_BUILD_ROOT}"
|
2024-08-25 12:05:09 +01:00
|
|
|
name="${source_dir##*/}"
|
|
|
|
|
|
|
|
if [ ! -f "${target_dir}/"*"/${name}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
bins=($(ls -t "${target_dir}/"*"/${name}"))
|
|
|
|
if [ ${#bins[@]} -lt 1 ]; then
|
|
|
|
echo "Skipping. Cannot find a binary for $name under $target_dir" 1>&2
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Install bus spec for scx_loader
|
|
|
|
if [ "$name" = "scx_loader" ]; then
|
|
|
|
install -D -m 0644 "${source_dir}/org.scx.Loader.conf" "${DESTDIR}/usr/share/dbus-1/system.d/org.scx.Loader.conf"
|
2023-12-03 21:47:02 +00:00
|
|
|
fi
|
|
|
|
|
2023-12-01 23:37:28 +00:00
|
|
|
install -D "${bins[0]}" "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin/${name}"
|
|
|
|
done
|