install -D "${SPELL}.sh" "${INSTALL_ROOT}/usr/bin/${SPELL}" &&
install -D "target/release/hx" "${INSTALL_ROOT}/usr/lib/${SPELL}/hx" &&

local runtime_dir="${INSTALL_ROOT}/var/lib/${SPELL}/runtime" &&
mkdir -p "$runtime_dir/grammars" &&
cp -r "runtime/queries" "$runtime_dir" &&
cp -r "runtime/themes" "$runtime_dir" &&
find "runtime/grammars" -type f -name '*.so' -exec install -D {} -t "$runtime_dir/grammars" \; &&
install -D runtime/tutor -t "$runtime_dir" &&
ln -s "${TRACK_ROOT}/var/lib/${SPELL}/runtime" "${INSTALL_ROOT}/usr/lib/${SPELL}/runtime" &&

install -D "contrib/completion/hx.bash" "${INSTALL_ROOT}/usr/share/bash-completion/completions/${SPELL}" &&
install -D "contrib/completion/hx.fish" "${INSTALL_ROOT}/usr/share/fish/vendor_completions.d/${SPELL}.fish" &&
install -D "contrib/completion/hx.zsh" "${INSTALL_ROOT}/usr/share/zsh/site-functions/_${SPELL}" &&
install -D "contrib/Helix.desktop" "${INSTALL_ROOT}/usr/share/applications/${SPELL}.desktop" &&
install -D "contrib/${SPELL}.png" -t "${INSTALL_ROOT}/usr/share/icons/hicolor/256x256/apps"
