bundle: Ship install/uninstall scripts and enable remote server provisioning

This commit is contained in:
yenru0 committed 2026-09-22 13:16:30 +09:00
1 parent e2f0824c36
commit 06b53ae438
3 files changed
+153 -2

No files matched your search

+6 -2
View File
@@ -83,7 +83,7 @@ if [[ "$(uname -m)" == "aarch64" ]]; then
else
export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"
fi
cargo --config .cargo/bundle-config.toml build --release --target "${target_triple}" --package zed --package cli
cargo --config .cargo/bundle-config.toml build --release --target "${target_triple}" --package zed --package cli --features remote/build-remote-server-binary
# Build remote_server in separate invocation to prevent feature unification from other crates
# from influencing dynamic libraries required by it.
if [[ "$remote_server_triple" == "$musl_triple" ]]; then
@@ -199,6 +199,10 @@ mkdir -p "${zed_dir}/share/applications"
envsubst < "crates/zed/resources/zed.desktop.in" > "${zed_dir}/share/applications/$APP_ID.desktop"
chmod +x "${zed_dir}/share/applications/$APP_ID.desktop"
# Install/uninstall scripts ship in the archive root so it is self-contained
cp "crates/zed/resources/install.sh" "crates/zed/resources/uninstall.sh" "${temp_dir}/"
chmod 755 "${temp_dir}/install.sh" "${temp_dir}/uninstall.sh"
# Copy generated licenses so they'll end up in archive too
cp "assets/licenses.md" "${zed_dir}/licenses.md"
@@ -209,6 +213,6 @@ archive="zed-linux-${arch}.tar.gz"
rm -rf "${archive}"
remove_match="zed(-[a-zA-Z0-9]+)?-linux-$(uname -m)\.tar\.gz"
ls "${target_dir}/release" | grep -E ${remove_match} | xargs -d "\n" -I {} rm -f "${target_dir}/release/{}" || true
tar -czvf "${target_dir}/release/$archive" -C ${temp_dir} "zed$suffix.app"
tar -czvf "${target_dir}/release/$archive" -C ${temp_dir} "zed$suffix.app" install.sh uninstall.sh
gzip -f --stdout --best "${target_dir}/${remote_server_triple}/release/remote_server" > "${target_dir}/zed-remote-server-linux-${arch}.gz"