Bundle linux deps (#11681)

Inlcude linux deps in the bundle

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-05-13 16:10:03 -04:00 committed by GitHub
parent 8e92f19fed
commit 9af1298a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 2 deletions

View file

@ -27,7 +27,7 @@ export ZED_BUNDLE=true
channel=$(<crates/zed/RELEASE_CHANNEL)
version="$(cargo metadata --no-deps --manifest-path crates/zed/Cargo.toml --offline --format-version=1 | jq -r '.packages | map(select(.name == "zed"))[0].version')"
version="$(script/get-crate-version zed)"
# Set RELEASE_VERSION so it's compiled into GPUI and it knows about the version.
export RELEASE_VERSION="${version}"
@ -38,6 +38,7 @@ host_line=$(echo "$version_info" | grep host)
target_triple=${host_line#*: }
# Build binary in release mode
export RUSTFLAGS="-C link-args=-Wl,-rpath,\$ORIGIN/../lib"
cargo build --release --target "${target_triple}" --package zed --package cli
# Strip the binary of all debug symbols
@ -60,6 +61,17 @@ mkdir -p "${zed_dir}/bin"
cp "target/${target_triple}/release/Zed" "${zed_dir}/bin/zed"
cp "target/${target_triple}/release/cli" "${zed_dir}/bin/cli"
# Libs
find_libs() {
ldd target/debug/Zed |\
cut -d' ' -f3 |\
grep -v '\<\(libstdc++.so\|libc.so\|libgcc_s.so\|libm.so\)'
}
mkdir -p "${zed_dir}/lib"
rm -rf "${zed_dir}/lib/*"
cp $(find_libs) "${zed_dir}/lib"
# Icons
mkdir -p "${zed_dir}/share/icons/hicolor/512x512/apps"
cp "crates/zed/resources/app-icon$suffix.png" "${zed_dir}/share/icons/hicolor/512x512/apps/zed.png"