mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-24 11:50:23 +00:00
56bb963136
Rust build was using two separate workspaces - rust/ and scheds/rust. There's no reason to separate them and it makes doc generation tricky. Use single top level workspace so that we can drive all rust building from cargo.
57 lines
1.8 KiB
Bash
Executable File
57 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
for manifest in "$MESON_SOURCE_ROOT"/scheds/rust/*/Cargo.toml; do
|
|
source_dir="${manifest%/Cargo.toml}"
|
|
target_dir="${MESON_BUILD_ROOT}"
|
|
name="${source_dir##*/}"
|
|
|
|
# Skip scx_mitosis
|
|
if [ "$name" = "scx_mitosis" ]; then
|
|
echo "Skipping installation of $name"
|
|
continue
|
|
fi
|
|
|
|
bins=($(ls -t "${target_dir}/"*"/${name}"))
|
|
if [ ${#bins[@]} -lt 1 ]; then
|
|
echo "Cannot find a binary for $name under $target_dir" 1>&2
|
|
exit 1
|
|
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 -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}"
|
|
target_dir="${MESON_BUILD_ROOT}"
|
|
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"
|
|
fi
|
|
|
|
install -D "${bins[0]}" "${DESTDIR}/${MESON_INSTALL_PREFIX}/bin/${name}"
|
|
done
|