diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2024-03-09 16:01:03 +0100 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2024-03-09 16:01:03 +0100 |
commit | 56815701710f92183e7a8524218ad1acc296e602 (patch) | |
tree | 1f2b2d6cd4e80fd55a9c3ddcca516362db71f4ed /pkgs/applications/science | |
parent | 9289a0678efadcd95fae82ea8c82318d3a86694a (diff) |
fix: elan: use relative paths in wrapper script
since 3.1.1, `elan` extracts to a temporary location and then moves to a final location, this threw the wrapper script off. Updating the patch to use paths relative to the wrapper script, so that it works independent of absolute location.
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r-- | pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch b/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch index 74da9d854f344..0b33d4242eb7e 100644 --- a/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch +++ b/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch @@ -2,7 +2,7 @@ diff --git a/src/elan-dist/src/component/package.rs b/src/elan-dist/src/componen index c51e76d..ae8159e 100644 --- a/src/elan-dist/src/component/package.rs +++ b/src/elan-dist/src/component/package.rs -@@ -56,6 +56,35 @@ fn unpack_without_first_dir<R: Read>(archive: &mut tar::Archive<R>, path: &Path) +@@ -56,6 +56,37 @@ fn unpack_without_first_dir<R: Read>(archive: &mut tar::Archive<R>, path: &Path) entry .unpack(&full_path) .chain_err(|| ErrorKind::ExtractingPackage)?; @@ -26,9 +26,11 @@ index c51e76d..ae8159e 100644 + use std::os::unix::fs::PermissionsExt; + let new_path = dest_path.with_extension("orig"); + ::std::fs::rename(dest_path, &new_path)?; -+ ::std::fs::write(dest_path, format!(r#"#! @shell@ -+LEAN_CC="${{LEAN_CC:-@cc@}}" exec -a "$0" {} "$@" -L {}/lib # use bundled libraries, but not bundled compiler that doesn't know about NIX_LDFLAGS -+"#, new_path.to_str().unwrap(), dest_path.parent().unwrap().parent().unwrap().to_str().unwrap()))?; ++ ::std::fs::write(dest_path, r#"#! @shell@ ++dir="$(dirname "${BASH_SOURCE[0]}")" ++# use bundled libraries, but not bundled compiler that doesn't know about NIX_LDFLAGS ++LEAN_CC="${LEAN_CC:-@cc@}" exec -a "$0" "$dir/leanc.orig" "$@" -L"$dir/../lib" ++"#)?; + ::std::fs::set_permissions(dest_path, ::std::fs::Permissions::from_mode(0o755))?; + } + |