ks: add completions for bash and zsh (#364049)
[NixPkgs.git] / pkgs / tools / networking / edgedb / 0001-dynamically-patchelf-binaries.patch
blob5b7b720fc7e77a26cae95ba15e4ce2aa81b1927a
1 diff --git a/src/portable/install.rs b/src/portable/install.rs
2 index 15944e4..f873349 100644
3 --- a/src/portable/install.rs
4 +++ b/src/portable/install.rs
5 @@ -134,8 +134,16 @@ fn unpack_package(cache_file: &Path, target_dir: &Path) -> anyhow::Result<()> {
6 for entry in arch.entries()? {
7 let mut entry = entry?;
8 let path = entry.path()?;
9 + let is_inside_bin = {
10 + let mut path_iter = path.iter();
11 + path_iter.next(); // discards first folder
12 + path_iter.as_path().starts_with("bin")
13 + };
14 if let Some(path) = build_path(&target_dir, &path)? {
15 - entry.unpack(path)?;
16 + entry.unpack(&path)?;
17 + if is_inside_bin {
18 + nix_patchelf_if_needed(&path);
19 + }
22 bar.finish_and_clear();
23 @@ -222,3 +230,11 @@ pub fn package(pkg_info: &PackageInfo) -> anyhow::Result<InstallInfo> {
25 Ok(info)
28 +fn nix_patchelf_if_needed(dest_path: &Path) {
29 + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
30 + .arg("--set-interpreter")
31 + .arg("@dynamicLinker@")
32 + .arg(dest_path)
33 + .output();