build-system: don't override RPATH

The RPATH shouldn't be overriden. Packages like conda set an RPATH. If
it is changed conda doesn't work any more.
This commit is contained in:
2024-08-09 21:14:23 +02:00
parent 5325736761
commit 2012d9bf07
+6
View File
@@ -1291,12 +1291,18 @@ _build_module() {
local -- rpath=''
local -i depth=0
for fname in "${bin_objects[@]}"; do
# don't override existing RPATH
rpath=$(patchelf --print-rpath "${fname}")
[[ -z "${rpath}" ]] || continue
(( depth=$(std::get_dir_depth "${fname}") + group_depth + 3 ))
rpath='$ORIGIN/'$(printf "../%.0s" $(${seq} 1 ${depth}))lib64
${patchelf} --force-rpath --set-rpath "${rpath}" "${fname}"
done
mapfile -t bin_objects < <(std::find_shared_objects '.')
for fname in "${bin_objects[@]}"; do
# don't override existing RPATH
rpath=$(patchelf --print-rpath "${fname}")
[[ -z "${rpath}" ]] || continue
(( depth=$(std::get_dir_depth "${fname}") + group_depth + 3 ))
rpath='$ORIGIN/'$(printf "../%.0s" $(${seq} 1 ${depth}))lib64
${patchelf} --force-rpath --set-rpath "${rpath}" "${fname}"